From 00086ab927dfee6b1b32f224b625325aec227bcf Mon Sep 17 00:00:00 2001 From: Sheri Nguyen Date: Thu, 13 Oct 2022 15:48:24 -0800 Subject: [PATCH 01/30] Updates for dbt-utils to dbt-core cross-db macro migration --- models/github__daily_metrics.sql | 10 +++++----- models/github__monthly_metrics.sql | 2 +- models/github__quarterly_metrics.sql | 2 +- models/github__weekly_metrics.sql | 2 +- models/intermediate/int_github__issue_joined.sql | 4 ++-- .../intermediate/int_github__issue_open_length.sql | 4 ++-- .../intermediate/int_github__pull_request_times.sql | 12 ++++++------ 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/models/github__daily_metrics.sql b/models/github__daily_metrics.sql index 21b4d38..22327a2 100644 --- a/models/github__daily_metrics.sql +++ b/models/github__daily_metrics.sql @@ -10,7 +10,7 @@ pull_requests as ( issues_opened_per_day as ( select - {{ dbt_utils.date_trunc('day', 'created_at') }} as day, + {{ dbt.date_trunc('day', 'created_at') }} as day, count(*) as number_issues_opened, sum(days_issue_open) as sum_days_issue_open, max(days_issue_open) as longest_days_issue_open @@ -20,7 +20,7 @@ issues_opened_per_day as ( issues_closed_per_day as ( select - {{ dbt_utils.date_trunc('day', 'closed_at') }} as day, + {{ dbt.date_trunc('day', 'closed_at') }} as day, count(*) as number_issues_closed from github_issues where closed_at is not null @@ -29,7 +29,7 @@ issues_closed_per_day as ( prs_opened_per_day as ( select - {{ dbt_utils.date_trunc('day', 'created_at') }} as day, + {{ dbt.date_trunc('day', 'created_at') }} as day, count(*) as number_prs_opened, sum(days_issue_open) as sum_days_pr_open, max(days_issue_open) as longest_days_pr_open @@ -39,7 +39,7 @@ prs_opened_per_day as ( prs_merged_per_day as ( select - {{ dbt_utils.date_trunc('day', 'merged_at') }} as day, + {{ dbt.date_trunc('day', 'merged_at') }} as day, count(*) as number_prs_merged from pull_requests where merged_at is not null @@ -48,7 +48,7 @@ prs_merged_per_day as ( prs_closed_without_merge_per_day as ( select - {{ dbt_utils.date_trunc('day', 'closed_at') }} as day, + {{ dbt.date_trunc('day', 'closed_at') }} as day, count(*) as number_prs_closed_without_merge from pull_requests where closed_at is not null diff --git a/models/github__monthly_metrics.sql b/models/github__monthly_metrics.sql index e11a6bd..b26b927 100644 --- a/models/github__monthly_metrics.sql +++ b/models/github__monthly_metrics.sql @@ -4,7 +4,7 @@ with daily_metrics as ( ) select - {{ dbt_utils.date_trunc('month', 'day') }} as month, + {{ dbt.date_trunc('month', 'day') }} as month, sum(number_issues_opened) as number_issues_opened, sum(number_issues_closed) as number_issues_closed, sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open, diff --git a/models/github__quarterly_metrics.sql b/models/github__quarterly_metrics.sql index f21a1f8..ccb8733 100644 --- a/models/github__quarterly_metrics.sql +++ b/models/github__quarterly_metrics.sql @@ -4,7 +4,7 @@ with daily_metrics as ( ) select - {{ dbt_utils.date_trunc('quarter', 'day') }} as quarter, + {{ dbt.date_trunc('quarter', 'day') }} as quarter, sum(number_issues_opened) as number_issues_opened, sum(number_issues_closed) as number_issues_closed, sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open, diff --git a/models/github__weekly_metrics.sql b/models/github__weekly_metrics.sql index 4b9079b..0d46a13 100644 --- a/models/github__weekly_metrics.sql +++ b/models/github__weekly_metrics.sql @@ -4,7 +4,7 @@ with daily_metrics as ( ) select - {{ dbt_utils.date_trunc('week', 'day') }} as week, + {{ dbt.date_trunc('week', 'day') }} as week, sum(number_issues_opened) as number_issues_opened, sum(number_issues_closed) as number_issues_closed, sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open, diff --git a/models/intermediate/int_github__issue_joined.sql b/models/intermediate/int_github__issue_joined.sql index 36825fe..ef3fb7d 100644 --- a/models/intermediate/int_github__issue_joined.sql +++ b/models/intermediate/int_github__issue_joined.sql @@ -60,8 +60,8 @@ pull_request as ( select issue.*, case - when issue.is_pull_request then {{ dbt_utils.concat(["'https://github.com/'",'repository_teams.repository',"'/pull/'", 'issue.issue_number']) }} - else {{ dbt_utils.concat(["'https://github.com/'",'repository_teams.repository',"'/issues/'", 'issue.issue_number']) }} + when issue.is_pull_request then {{ dbt.concat(["'https://github.com/'",'repository_teams.repository',"'/pull/'", 'issue.issue_number']) }} + else {{ dbt.concat(["'https://github.com/'",'repository_teams.repository',"'/issues/'", 'issue.issue_number']) }} end as url_link, issue_open_length.days_issue_open, issue_open_length.number_of_times_reopened, diff --git a/models/intermediate/int_github__issue_open_length.sql b/models/intermediate/int_github__issue_open_length.sql index 33029f9..7283f59 100644 --- a/models/intermediate/int_github__issue_open_length.sql +++ b/models/intermediate/int_github__issue_open_length.sql @@ -26,14 +26,14 @@ close_events_with_timestamps as ( select issue_id, updated_at as valid_starting, - coalesce(lead(updated_at) over (partition by issue_id order by updated_at), {{ dbt_utils.current_timestamp() }}) as valid_until, + coalesce(lead(updated_at) over (partition by issue_id order by updated_at), {{ dbt.current_timestamp_backcompat() }}) as valid_until, is_closed from close_events_stacked ) select issue_id, - sum({{ dbt_utils.datediff('valid_starting', 'valid_until', 'second') }}) /60/60/24 as days_issue_open, + sum({{ dbt.datediff('valid_starting', 'valid_until', 'second') }}) /60/60/24 as days_issue_open, count(*) - 1 as number_of_times_reopened from close_events_with_timestamps where not is_closed diff --git a/models/intermediate/int_github__pull_request_times.sql b/models/intermediate/int_github__pull_request_times.sql index 56fd924..026a2f7 100644 --- a/models/intermediate/int_github__pull_request_times.sql +++ b/models/intermediate/int_github__pull_request_times.sql @@ -48,19 +48,19 @@ first_request_time as ( select first_request_time.issue_id, issue_merged.merged_at, - {{ dbt_utils.datediff( + {{ dbt.datediff( 'time_of_first_request', - "coalesce(time_of_first_review_post_request, " ~ dbt_utils.current_timestamp() ~ ")", + "coalesce(time_of_first_review_post_request, " ~ dbt.current_timestamp_backcompat() ~ ")", 'second') }}/ 60/60 as hours_request_review_to_first_review, - {{ dbt_utils.datediff( + {{ dbt.datediff( 'time_of_first_request', "least( - coalesce(time_of_first_requested_reviewer_review, " ~ dbt_utils.current_timestamp() ~ "), - coalesce(issue.closed_at, " ~ dbt_utils.current_timestamp() ~ "))", + coalesce(time_of_first_requested_reviewer_review, " ~ dbt.current_timestamp_backcompat() ~ "), + coalesce(issue.closed_at, " ~ dbt.current_timestamp_backcompat() ~ "))", 'second') }} / 60/60 as hours_request_review_to_first_action, - {{ dbt_utils.datediff('time_of_first_request', 'merged_at', 'second') }}/ 60/60 as hours_request_review_to_merge + {{ dbt.datediff('time_of_first_request', 'merged_at', 'second') }}/ 60/60 as hours_request_review_to_merge from first_request_time join issue on first_request_time.issue_id = issue.issue_id left join issue_merged on first_request_time.issue_id = issue_merged.issue_id \ No newline at end of file From 50849149614c4cb07cea4fd7ecde30a9f1569ab6 Mon Sep 17 00:00:00 2001 From: Sheri Nguyen <94874400+fivetran-sheringuyen@users.noreply.github.com> Date: Thu, 13 Oct 2022 15:48:27 -0800 Subject: [PATCH 02/30] Updating dbt version --- dbt_project.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dbt_project.yml b/dbt_project.yml index 8cc5133..844ccba 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -1,7 +1,7 @@ config-version: 2 name: 'github' -version: '0.5.1' -require-dbt-version: [">=1.0.0", "<2.0.0"] +version: '0.6.0' +require-dbt-version: [">=1.2.0", "<2.0.0"] models: github: materialized: table From 9db99cb82614248dfbec81996275ee649c042606 Mon Sep 17 00:00:00 2001 From: Sheri Nguyen <94874400+fivetran-sheringuyen@users.noreply.github.com> Date: Thu, 13 Oct 2022 15:48:28 -0800 Subject: [PATCH 03/30] Updating dbt version --- integration_tests/dbt_project.yml | 34 ++++++++++++++----------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index b00b956..d4c08f8 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -1,28 +1,24 @@ name: 'github_integration_tests' -version: '0.5.1' +version: '0.6.0' config-version: 2 - profile: 'integration_tests' - vars: github_source: - issue_assignee: "{{ ref('github_issue_assignee_data') }}" - issue_closed_history: "{{ ref('github_issue_closed_history_data') }}" - issue_comment: "{{ ref('github_issue_comment_data') }}" - issue_label: "{{ ref('github_issue_label_data') }}" - label: "{{ ref('github_label_data') }}" - issue_merged: "{{ ref('github_issue_merged_data') }}" - issue: "{{ ref('github_issue_data') }}" - pull_request_review: "{{ ref('github_pull_request_review_data') }}" - pull_request: "{{ ref('github_pull_request_data') }}" - repository: "{{ ref('github_repository_data') }}" - repo_team: "{{ ref('github_repo_team_data') }}" - requested_reviewer_history: "{{ ref('github_requested_reviewer_history_data') }}" - team: "{{ ref('github_team_data') }}" - user: "{{ ref('github_user_data') }}" - + issue_assignee: "{{ ref('github_issue_assignee_data') }}" + issue_closed_history: "{{ ref('github_issue_closed_history_data') }}" + issue_comment: "{{ ref('github_issue_comment_data') }}" + issue_label: "{{ ref('github_issue_label_data') }}" + label: "{{ ref('github_label_data') }}" + issue_merged: "{{ ref('github_issue_merged_data') }}" + issue: "{{ ref('github_issue_data') }}" + pull_request_review: "{{ ref('github_pull_request_review_data') }}" + pull_request: "{{ ref('github_pull_request_data') }}" + repository: "{{ ref('github_repository_data') }}" + repo_team: "{{ ref('github_repo_team_data') }}" + requested_reviewer_history: "{{ ref('github_requested_reviewer_history_data') }}" + team: "{{ ref('github_team_data') }}" + user: "{{ ref('github_user_data') }}" github_schema: github_integration_tests - seeds: github_integration_tests: +quote_columns: "{{ true if target.type == 'redshift' else false }}" From 9f24a7ea810d63523df082e2bff28e7292e3e40f Mon Sep 17 00:00:00 2001 From: Sheri Nguyen <94874400+fivetran-sheringuyen@users.noreply.github.com> Date: Thu, 13 Oct 2022 15:48:28 -0800 Subject: [PATCH 04/30] Updating package dependencies --- packages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages.yml b/packages.yml index c82b10f..2508a24 100644 --- a/packages.yml +++ b/packages.yml @@ -1,3 +1,3 @@ packages: - package: fivetran/github_source - version: [">=0.5.0", "<0.6.0"] \ No newline at end of file + version: [">=0.5.0", "<0.6.0"] From c2b2f48a56b0c0f8974c7470ac82217d5eb7ab6b Mon Sep 17 00:00:00 2001 From: Sheri Nguyen <94874400+fivetran-sheringuyen@users.noreply.github.com> Date: Thu, 13 Oct 2022 15:48:29 -0800 Subject: [PATCH 05/30] deleting file: .circleci/config.yml --- .circleci/config.yml | 64 -------------------------------------------- 1 file changed, 64 deletions(-) delete mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 1169598..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,64 +0,0 @@ -version: 2 - -jobs: - build: - docker: - - image: circleci/python:3.7.9-stretch - - steps: - - checkout - - - run: - run: setup_creds - command: | - echo $GCLOUD_SERVICE_KEY | base64 --decode --ignore-garbage > ${HOME}/gcloud-service-key.json - - run: - name: "Setup dbt" - command: | - sudo apt install libsasl2-dev - python3 -m venv venv - . venv/bin/activate - pip install --upgrade pip setuptools - pip install -r integration_tests/requirements.txt - mkdir -p ~/.dbt - cp integration_tests/ci/sample.profiles.yml ~/.dbt/profiles.yml - - run: - name: "Run Tests - 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 run --vars '{github__using_repo_team: false}' --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 run --vars '{github__using_repo_team: false}' --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 - dbt run --target bigquery --full-refresh - dbt run --vars '{github__using_repo_team: false}' --target bigquery --full-refresh - dbt test --target bigquery - - save_cache: - key: deps2-{{ .Branch }} - paths: - - "venv" From 7c73c76817ea456d4422797f4843495aea0edac4 Mon Sep 17 00:00:00 2001 From: Sheri Nguyen <94874400+fivetran-sheringuyen@users.noreply.github.com> Date: Thu, 13 Oct 2022 15:48:29 -0800 Subject: [PATCH 06/30] deleting file: integration_tests/requirements.txt --- integration_tests/requirements.txt | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 integration_tests/requirements.txt diff --git a/integration_tests/requirements.txt b/integration_tests/requirements.txt deleted file mode 100644 index 89c6ccb..0000000 --- a/integration_tests/requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -dbt-snowflake~=1.0.0 -dbt-bigquery~=1.0.0 -dbt-redshift~=1.0.0 -dbt-postgres~=1.0.0 -dbt-spark~=1.0.0 -dbt-spark[PyHive]~=1.0.0 From c9954290ab38440ba7ece74f56771aab0fd5e6b1 Mon Sep 17 00:00:00 2001 From: Sheri Nguyen <94874400+fivetran-sheringuyen@users.noreply.github.com> Date: Thu, 13 Oct 2022 15:48:30 -0800 Subject: [PATCH 07/30] deleting file: integration_tests/ci/sample.profiles.yml --- integration_tests/ci/sample.profiles.yml | 37 ------------------------ 1 file changed, 37 deletions(-) delete mode 100644 integration_tests/ci/sample.profiles.yml diff --git a/integration_tests/ci/sample.profiles.yml b/integration_tests/ci/sample.profiles.yml deleted file mode 100644 index 1ac670e..0000000 --- a/integration_tests/ci/sample.profiles.yml +++ /dev/null @@ -1,37 +0,0 @@ - -# HEY! This file is used in the Github 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: github_integration_tests - threads: 8 - bigquery: - type: bigquery - method: service-account - keyfile: "{{ env_var('GCLOUD_SERVICE_KEY_PATH') }}" - project: 'dbt-package-testing' - schema: github_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: github_integration_tests - threads: 8 \ No newline at end of file From 15f6dd611465b3511a6a4869ecd78a2be8bea13e Mon Sep 17 00:00:00 2001 From: Sheri Nguyen <94874400+fivetran-sheringuyen@users.noreply.github.com> Date: Thu, 13 Oct 2022 15:48:30 -0800 Subject: [PATCH 08/30] adding file: integration_tests/requirements.txt --- integration_tests/requirements.txt | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 integration_tests/requirements.txt diff --git a/integration_tests/requirements.txt b/integration_tests/requirements.txt new file mode 100644 index 0000000..46e2da6 --- /dev/null +++ b/integration_tests/requirements.txt @@ -0,0 +1,7 @@ +dbt-snowflake~=1.2.0 +dbt-bigquery~=1.2.0 +dbt-redshift~=1.2.0 +dbt-postgres~=1.2.0 +dbt-spark~=1.2.0 +dbt-spark[PyHive]~=1.2.0 +dbt-databricks~=1.2.0 \ No newline at end of file From e59b64f4ce4c52cab0e7907d33d57f39c0ff9496 Mon Sep 17 00:00:00 2001 From: Sheri Nguyen <94874400+fivetran-sheringuyen@users.noreply.github.com> Date: Thu, 13 Oct 2022 15:48:31 -0800 Subject: [PATCH 09/30] adding file: integration_tests/ci/sample.profiles.yml --- integration_tests/ci/sample.profiles.yml | 54 ++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 integration_tests/ci/sample.profiles.yml diff --git a/integration_tests/ci/sample.profiles.yml b/integration_tests/ci/sample.profiles.yml new file mode 100644 index 0000000..f524bd8 --- /dev/null +++ b/integration_tests/ci/sample.profiles.yml @@ -0,0 +1,54 @@ + +# HEY! This file is used in the dbt package 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: redshift + 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: + threads: 8 + bigquery: + type: bigquery + method: service-account-json + project: 'dbt-package-testing' + schema: + threads: 8 + keyfile_json: "{{ env_var('GCLOUD_SERVICE_KEY') | as_native }}" + 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: + threads: 8 + postgres: + type: postgres + host: "{{ env_var('CI_POSTGRES_DBT_HOST') }}" + user: "{{ env_var('CI_POSTGRES_DBT_USER') }}" + pass: "{{ env_var('CI_POSTGRES_DBT_PASS') }}" + dbname: "{{ env_var('CI_POSTGRES_DBT_DBNAME') }}" + port: 5432 + schema: + threads: 8 + databricks: + catalog: null + host: "{{ env_var('CI_DATABRICKS_DBT_HOST') }}" + http_path: "{{ env_var('CI_DATABRICKS_DBT_HTTP_PATH') }}" + schema: + threads: 2 + token: "{{ env_var('CI_DATABRICKS_DBT_TOKEN') }}" + type: databricks \ No newline at end of file From 20ec603fd3f5fd1c52c0b513fdc23dff5b6297b4 Mon Sep 17 00:00:00 2001 From: Sheri Nguyen <94874400+fivetran-sheringuyen@users.noreply.github.com> Date: Thu, 13 Oct 2022 15:48:31 -0800 Subject: [PATCH 10/30] adding file: .buildkite/pipeline.yml --- .buildkite/pipeline.yml | 73 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 .buildkite/pipeline.yml diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml new file mode 100644 index 0000000..b84fe04 --- /dev/null +++ b/.buildkite/pipeline.yml @@ -0,0 +1,73 @@ +steps: + - label: ":postgres: Run Tests - Postgres" + key: "run-dbt-postgres" + plugins: + - docker#v3.13.0: + image: "python:3.8" + shell: [ "/bin/bash", "-e", "-c" ] + environment: + - "BASH_ENV=/tmp/.bashrc" + - "CI_POSTGRES_DBT_DBNAME" + - "CI_POSTGRES_DBT_HOST" + - "CI_POSTGRES_DBT_PASS" + - "CI_POSTGRES_DBT_USER" + commands: | + bash .buildkite/scripts/run_models.sh postgres + + - label: ":snowflake-db: Run Tests - Snowflake" + key: "run_dbt_snowflake" + plugins: + - docker#v3.13.0: + image: "python:3.8" + shell: [ "/bin/bash", "-e", "-c" ] + environment: + - "BASH_ENV=/tmp/.bashrc" + - "CI_SNOWFLAKE_DBT_ACCOUNT" + - "CI_SNOWFLAKE_DBT_DATABASE" + - "CI_SNOWFLAKE_DBT_PASS" + - "CI_SNOWFLAKE_DBT_ROLE" + - "CI_SNOWFLAKE_DBT_USER" + - "CI_SNOWFLAKE_DBT_WAREHOUSE" + commands: | + bash .buildkite/scripts/run_models.sh snowflake + + - label: ":gcloud: Run Tests - BigQuery" + key: "run_dbt_bigquery" + plugins: + - docker#v3.13.0: + image: "python:3.8" + shell: [ "/bin/bash", "-e", "-c" ] + environment: + - "BASH_ENV=/tmp/.bashrc" + - "GCLOUD_SERVICE_KEY" + commands: | + bash .buildkite/scripts/run_models.sh bigquery + + - label: ":amazon-redshift: Run Tests - Redshift" + key: "run_dbt_redshift" + plugins: + - docker#v3.13.0: + image: "python:3.8" + shell: [ "/bin/bash", "-e", "-c" ] + environment: + - "BASH_ENV=/tmp/.bashrc" + - "CI_REDSHIFT_DBT_DBNAME" + - "CI_REDSHIFT_DBT_HOST" + - "CI_REDSHIFT_DBT_PASS" + - "CI_REDSHIFT_DBT_USER" + commands: | + bash .buildkite/scripts/run_models.sh redshift + + - label: ":upside_down_face: Run Tests - Databricks" + key: "run_dbt_databricks" + plugins: + - docker#v3.13.0: + image: "python:3.8" + shell: [ "/bin/bash", "-e", "-c" ] + environment: + - "BASH_ENV=/tmp/.bashrc" + - "CI_DATABRICKS_DBT_HOST" + - "CI_DATABRICKS_DBT_HTTP_PATH" + - "CI_DATABRICKS_DBT_TOKEN" + commands: | + bash .buildkite/scripts/run_models.sh databricks \ No newline at end of file From 00e0b4832cdc89c51f40a0425925c4a5b80226b6 Mon Sep 17 00:00:00 2001 From: Sheri Nguyen <94874400+fivetran-sheringuyen@users.noreply.github.com> Date: Thu, 13 Oct 2022 15:48:32 -0800 Subject: [PATCH 11/30] adding file: .buildkite/scripts/run_models.sh --- .buildkite/scripts/run_models.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .buildkite/scripts/run_models.sh diff --git a/.buildkite/scripts/run_models.sh b/.buildkite/scripts/run_models.sh new file mode 100644 index 0000000..a18ae39 --- /dev/null +++ b/.buildkite/scripts/run_models.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +apt-get update +apt-get install libsasl2-dev + +python3 -m venv venv +. venv/bin/activate +pip install --upgrade pip setuptools +pip install -r integration_tests/requirements.txt +mkdir -p ~/.dbt +cp integration_tests/ci/sample.profiles.yml ~/.dbt/profiles.yml + +db=$1 +echo `pwd` +cd integration_tests +dbt deps +dbt seed --target "$db" --full-refresh +dbt run --target "$db" --full-refresh +dbt test --target "$db" +## UPDATE FOR VARS HERE, IF NO VARS, PLEASE REMOVE +dbt run --vars '{apple_search_ads__using_search_terms: True}' --target "$db" --full-refresh +dbt test --target "$db" +### END VARS CHUNK, REMOVE IF NOT USING \ No newline at end of file From 7d715355dd881a9eb4b9338abbf3a74673e12c5e Mon Sep 17 00:00:00 2001 From: Sheri Nguyen <94874400+fivetran-sheringuyen@users.noreply.github.com> Date: Thu, 13 Oct 2022 15:48:32 -0800 Subject: [PATCH 12/30] adding file: .buildkite/hooks/pre-command --- .buildkite/hooks/pre-command | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .buildkite/hooks/pre-command diff --git a/.buildkite/hooks/pre-command b/.buildkite/hooks/pre-command new file mode 100644 index 0000000..04c85c0 --- /dev/null +++ b/.buildkite/hooks/pre-command @@ -0,0 +1,24 @@ +#!/bin/bash + +set -e + +# Export secrets for Docker containers. +# Restrict exposing secrets only to the steps that need them +export GCLOUD_SERVICE_KEY=$(gcloud secrets versions access latest --secret="GCLOUD_SERVICE_KEY" --project="dbt-package-testing-363917") +export CI_POSTGRES_DBT_HOST=$(gcloud secrets versions access latest --secret="CI_POSTGRES_DBT_HOST" --project="dbt-package-testing-363917") +export CI_POSTGRES_DBT_USER=$(gcloud secrets versions access latest --secret="CI_POSTGRES_DBT_USER" --project="dbt-package-testing-363917") +export CI_POSTGRES_DBT_PASS=$(gcloud secrets versions access latest --secret="CI_POSTGRES_DBT_PASS" --project="dbt-package-testing-363917") +export CI_POSTGRES_DBT_DBNAME=$(gcloud secrets versions access latest --secret="CI_POSTGRES_DBT_DBNAME" --project="dbt-package-testing-363917") +export CI_REDSHIFT_DBT_DBNAME=$(gcloud secrets versions access latest --secret="CI_REDSHIFT_DBT_DBNAME" --project="dbt-package-testing-363917") +export CI_REDSHIFT_DBT_HOST=$(gcloud secrets versions access latest --secret="CI_REDSHIFT_DBT_HOST" --project="dbt-package-testing-363917") +export CI_REDSHIFT_DBT_PASS=$(gcloud secrets versions access latest --secret="CI_REDSHIFT_DBT_PASS" --project="dbt-package-testing-363917") +export CI_REDSHIFT_DBT_USER=$(gcloud secrets versions access latest --secret="CI_REDSHIFT_DBT_USER" --project="dbt-package-testing-363917") +export CI_SNOWFLAKE_DBT_ACCOUNT=$(gcloud secrets versions access latest --secret="CI_SNOWFLAKE_DBT_ACCOUNT" --project="dbt-package-testing-363917") +export CI_SNOWFLAKE_DBT_DATABASE=$(gcloud secrets versions access latest --secret="CI_SNOWFLAKE_DBT_DATABASE" --project="dbt-package-testing-363917") +export CI_SNOWFLAKE_DBT_PASS=$(gcloud secrets versions access latest --secret="CI_SNOWFLAKE_DBT_PASS" --project="dbt-package-testing-363917") +export CI_SNOWFLAKE_DBT_ROLE=$(gcloud secrets versions access latest --secret="CI_SNOWFLAKE_DBT_ROLE" --project="dbt-package-testing-363917") +export CI_SNOWFLAKE_DBT_USER=$(gcloud secrets versions access latest --secret="CI_SNOWFLAKE_DBT_USER" --project="dbt-package-testing-363917") +export CI_SNOWFLAKE_DBT_WAREHOUSE=$(gcloud secrets versions access latest --secret="CI_SNOWFLAKE_DBT_WAREHOUSE" --project="dbt-package-testing-363917") +export CI_DATABRICKS_DBT_HOST=$(gcloud secrets versions access latest --secret="CI_DATABRICKS_DBT_HOST" --project="dbt-package-testing-363917") +export CI_DATABRICKS_DBT_HTTP_PATH=$(gcloud secrets versions access latest --secret="CI_DATABRICKS_DBT_HTTP_PATH" --project="dbt-package-testing-363917") +export CI_DATABRICKS_DBT_TOKEN=$(gcloud secrets versions access latest --secret="CI_DATABRICKS_DBT_TOKEN" --project="dbt-package-testing-363917") \ No newline at end of file From abcac81f4a542b1b244a27eb48bde157faa6a3ee Mon Sep 17 00:00:00 2001 From: Sheri Nguyen Date: Mon, 17 Oct 2022 09:46:38 -0500 Subject: [PATCH 13/30] Update dbt adapter versions and dbt required versions --- dbt_project.yml | 2 +- integration_tests/requirements.txt | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dbt_project.yml b/dbt_project.yml index 844ccba..7a74687 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -1,7 +1,7 @@ config-version: 2 name: 'github' version: '0.6.0' -require-dbt-version: [">=1.2.0", "<2.0.0"] +require-dbt-version: [">=1.3.0", "<2.0.0"] models: github: materialized: table diff --git a/integration_tests/requirements.txt b/integration_tests/requirements.txt index 46e2da6..87ae0f9 100644 --- a/integration_tests/requirements.txt +++ b/integration_tests/requirements.txt @@ -1,7 +1,7 @@ -dbt-snowflake~=1.2.0 -dbt-bigquery~=1.2.0 -dbt-redshift~=1.2.0 -dbt-postgres~=1.2.0 -dbt-spark~=1.2.0 -dbt-spark[PyHive]~=1.2.0 -dbt-databricks~=1.2.0 \ No newline at end of file +dbt-snowflake>=1.3.0,<2.0.0 +dbt-bigquery>=1.3.0,<2.0.0 +dbt-redshift>=1.3.0,<2.0.0 +dbt-postgres>=1.3.0,<2.0.0 +dbt-spark>=1.3.0,<2.0.0 +dbt-spark[PyHive]>=1.3.0,<2.0.0 +dbt-databricks>=1.3.0,<2.0.0 \ No newline at end of file From 461a3064be4e004e0190f22a50268eea7fcf5384 Mon Sep 17 00:00:00 2001 From: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com> Date: Wed, 26 Oct 2022 14:08:49 -0500 Subject: [PATCH 14/30] update packages --- packages.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages.yml b/packages.yml index 2508a24..e4157ef 100644 --- a/packages.yml +++ b/packages.yml @@ -1,3 +1,7 @@ packages: -- package: fivetran/github_source - version: [">=0.5.0", "<0.6.0"] +# - package: fivetran/github_source +# version: [">=0.6.0", "<0.7.0"] + +# Update before merge + - git: https://github.com/fivetran/dbt_github_source.git + revision: MagicBot/dbt-utils-cross-db-migration \ No newline at end of file From f44073b0d37213f9c9f53341ba74006226719cd8 Mon Sep 17 00:00:00 2001 From: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com> Date: Wed, 26 Oct 2022 14:10:17 -0500 Subject: [PATCH 15/30] update run_models --- .buildkite/scripts/run_models.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.buildkite/scripts/run_models.sh b/.buildkite/scripts/run_models.sh index a18ae39..4e564f2 100644 --- a/.buildkite/scripts/run_models.sh +++ b/.buildkite/scripts/run_models.sh @@ -17,7 +17,5 @@ dbt deps dbt seed --target "$db" --full-refresh dbt run --target "$db" --full-refresh dbt test --target "$db" -## UPDATE FOR VARS HERE, IF NO VARS, PLEASE REMOVE -dbt run --vars '{apple_search_ads__using_search_terms: True}' --target "$db" --full-refresh +dbt run --vars '{github__using_repo_team: false}' --target "$db" --full-refresh dbt test --target "$db" -### END VARS CHUNK, REMOVE IF NOT USING \ No newline at end of file From 17926c04a21b7c144f91c259d479e5e752d07f84 Mon Sep 17 00:00:00 2001 From: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com> Date: Wed, 26 Oct 2022 14:11:50 -0500 Subject: [PATCH 16/30] update ymls --- .buildkite/pipeline.yml | 29 ------------------------ integration_tests/ci/sample.profiles.yml | 10 ++++---- 2 files changed, 5 insertions(+), 34 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index b84fe04..46cea39 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -1,19 +1,4 @@ steps: - - label: ":postgres: Run Tests - Postgres" - key: "run-dbt-postgres" - plugins: - - docker#v3.13.0: - image: "python:3.8" - shell: [ "/bin/bash", "-e", "-c" ] - environment: - - "BASH_ENV=/tmp/.bashrc" - - "CI_POSTGRES_DBT_DBNAME" - - "CI_POSTGRES_DBT_HOST" - - "CI_POSTGRES_DBT_PASS" - - "CI_POSTGRES_DBT_USER" - commands: | - bash .buildkite/scripts/run_models.sh postgres - - label: ":snowflake-db: Run Tests - Snowflake" key: "run_dbt_snowflake" plugins: @@ -57,17 +42,3 @@ steps: - "CI_REDSHIFT_DBT_USER" commands: | bash .buildkite/scripts/run_models.sh redshift - - - label: ":upside_down_face: Run Tests - Databricks" - key: "run_dbt_databricks" - plugins: - - docker#v3.13.0: - image: "python:3.8" - shell: [ "/bin/bash", "-e", "-c" ] - environment: - - "BASH_ENV=/tmp/.bashrc" - - "CI_DATABRICKS_DBT_HOST" - - "CI_DATABRICKS_DBT_HTTP_PATH" - - "CI_DATABRICKS_DBT_TOKEN" - commands: | - bash .buildkite/scripts/run_models.sh databricks \ No newline at end of file diff --git a/integration_tests/ci/sample.profiles.yml b/integration_tests/ci/sample.profiles.yml index f524bd8..b39d59e 100644 --- a/integration_tests/ci/sample.profiles.yml +++ b/integration_tests/ci/sample.profiles.yml @@ -16,13 +16,13 @@ integration_tests: pass: "{{ env_var('CI_REDSHIFT_DBT_PASS') }}" dbname: "{{ env_var('CI_REDSHIFT_DBT_DBNAME') }}" port: 5439 - schema: + schema: github_integration_tests threads: 8 bigquery: type: bigquery method: service-account-json project: 'dbt-package-testing' - schema: + schema: github_integration_tests threads: 8 keyfile_json: "{{ env_var('GCLOUD_SERVICE_KEY') | as_native }}" snowflake: @@ -33,7 +33,7 @@ integration_tests: role: "{{ env_var('CI_SNOWFLAKE_DBT_ROLE') }}" database: "{{ env_var('CI_SNOWFLAKE_DBT_DATABASE') }}" warehouse: "{{ env_var('CI_SNOWFLAKE_DBT_WAREHOUSE') }}" - schema: + schema: github_integration_tests threads: 8 postgres: type: postgres @@ -42,13 +42,13 @@ integration_tests: pass: "{{ env_var('CI_POSTGRES_DBT_PASS') }}" dbname: "{{ env_var('CI_POSTGRES_DBT_DBNAME') }}" port: 5432 - schema: + schema: github_integration_tests threads: 8 databricks: catalog: null host: "{{ env_var('CI_DATABRICKS_DBT_HOST') }}" http_path: "{{ env_var('CI_DATABRICKS_DBT_HTTP_PATH') }}" - schema: + schema: github_integration_tests threads: 2 token: "{{ env_var('CI_DATABRICKS_DBT_TOKEN') }}" type: databricks \ No newline at end of file From 62b158ca5945c2624c0060bdfab6041fd5c27bce Mon Sep 17 00:00:00 2001 From: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com> Date: Wed, 26 Oct 2022 14:13:02 -0500 Subject: [PATCH 17/30] update changelog --- CHANGELOG.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b082a07..3dcead9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,40 @@ +# dbt_github v0.6.0 +## 🚨 Breaking Changes 🚨: +[PR #26](https://github.com/fivetran/dbt_github_source/pull/26) includes the following breaking changes: +- Dispatch update for dbt-utils to dbt-core cross-db macros migration. Specifically `{{ dbt_utils. }}` have been updated to `{{ dbt. }}` for the below macros: + - `any_value` + - `bool_or` + - `cast_bool_to_text` + - `concat` + - `date_trunc` + - `dateadd` + - `datediff` + - `escape_single_quotes` + - `except` + - `hash` + - `intersect` + - `last_day` + - `length` + - `listagg` + - `position` + - `replace` + - `right` + - `safe_cast` + - `split_part` + - `string_literal` + - `type_bigint` + - `type_float` + - `type_int` + - `type_numeric` + - `type_string` + - `type_timestamp` + - `array_append` + - `array_concat` + - `array_construct` +- For `current_timestamp` and `current_timestamp_in_utc` macros, the dispatch AND the macro names have been updated to the below, respectively: + - `dbt.current_timestamp_backcompat` + - `dbt.current_timestamp_in_utc_backcompat` +- Dependencies on `fivetran/fivetran_utils` have been upgraded, previously `[">=0.3.0", "<0.4.0"]` now `[">=0.4.0", "<0.5.0"]`. # dbt_github v0.5.1 ## Fixes - The `url_link` logic within `int_github__issue_joined` was focused on only providing the correct url for pull requests. This update includes a `case when` statement to provide the accurate url logic for both Issues and Pull Requests. ([#31](https://github.com/fivetran/dbt_github/pull/31)) From 1010f741f3021d54b30fd6fa83c525dc096be5ac Mon Sep 17 00:00:00 2001 From: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com> Date: Wed, 26 Oct 2022 14:18:07 -0500 Subject: [PATCH 18/30] update readme --- README.md | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5a9e5e8..cb2a94d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,15 @@ -[![Apache License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) +

+ + + + + + + + +

+ # GitHub ([Docs](https://dbt-github.netlify.app/)) This package models GitHub data from [Fivetran's connector](https://fivetran.com/docs/applications/github). It uses data in the format described by [this ERD](https://docs.google.com/presentation/d/1lx6ez7-x-s-n2JCnCi3SjG4XMmx9ysNUvaNCaWc3I_I/edit). @@ -27,7 +38,7 @@ Include in your `packages.yml` ```yaml packages: - package: fivetran/github - version: [">=0.5.0", "<0.6.0"] + version: [">=0.6.0", "<0.7.0"] ``` ## Configuration @@ -63,6 +74,21 @@ vars: ## Database support This package has been tested on BigQuery, Snowflake and Redshift. +## Dependencies +This dbt package is dependent on the following dbt packages. Please be aware that these dependencies are installed by default within this package. For more information on the following packages, refer to the [dbt hub](https://hub.getdbt.com/) site. +> IMPORTANT: If you have any of these dependent packages in your own `packages.yml` file, we highly recommend that you remove them from your root `packages.yml` to avoid package version conflicts. + +```yml +packages: + - package: fivetran/fivetran_utils + version: [">=0.4.0", "<0.5.0"] + + - package: dbt-labs/dbt_utils + version: [">=1.0.0", "<2.0.0"] + + - package: fivetran/github + version: [">=0.6.0", "<0.7.0"] +``` ## Contributions Additional contributions to this package are very welcome! Please create issues From a80420cca2357377020887d2af088c4ac2b51ca3 Mon Sep 17 00:00:00 2001 From: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com> Date: Wed, 26 Oct 2022 14:32:43 -0500 Subject: [PATCH 19/30] regen docs --- docs/catalog.json | 2 +- docs/index.html | 24 ++++++++++++------------ docs/manifest.json | 2 +- docs/run_results.json | 1 + 4 files changed, 15 insertions(+), 14 deletions(-) create mode 100644 docs/run_results.json diff --git a/docs/catalog.json b/docs/catalog.json index c4320de..94f5bb3 100644 --- a/docs/catalog.json +++ b/docs/catalog.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "1.0.1", "generated_at": "2022-02-11T20:33:01.540743Z", "invocation_id": "76e00bc7-8790-4a70-8f9d-f2cff33a6c7c", "env": {}}, "nodes": {"model.github_source.stg_github__repository": {"metadata": {"type": "table", "schema": "dbt_joe_github", "name": "stg_github__repository", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"repository_id": {"type": "INT64", "index": 1, "name": "repository_id", "comment": null}, "full_name": {"type": "STRING", "index": 2, "name": "full_name", "comment": null}, "is_private": {"type": "BOOL", "index": 3, "name": "is_private", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 127.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 4.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__repository"}, "model.github.github__issues": {"metadata": {"type": "table", "schema": "dbt_joe_github", "name": "github__issues", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "body": {"type": "STRING", "index": 2, "name": "body", "comment": null}, "closed_at": {"type": "TIMESTAMP", "index": 3, "name": "closed_at", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "is_locked": {"type": "BOOL", "index": 5, "name": "is_locked", "comment": null}, "milestone_id": {"type": "INT64", "index": 6, "name": "milestone_id", "comment": null}, "issue_number": {"type": "INT64", "index": 7, "name": "issue_number", "comment": null}, "is_pull_request": {"type": "BOOL", "index": 8, "name": "is_pull_request", "comment": null}, "repository_id": {"type": "INT64", "index": 9, "name": "repository_id", "comment": null}, "state": {"type": "STRING", "index": 10, "name": "state", "comment": null}, "title": {"type": "STRING", "index": 11, "name": "title", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 12, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 13, "name": "user_id", "comment": null}, "url_link": {"type": "STRING", "index": 14, "name": "url_link", "comment": null}, "days_issue_open": {"type": "FLOAT64", "index": 15, "name": "days_issue_open", "comment": null}, "number_of_times_reopened": {"type": "INT64", "index": 16, "name": "number_of_times_reopened", "comment": null}, "labels": {"type": "STRING", "index": 17, "name": "labels", "comment": null}, "number_of_comments": {"type": "INT64", "index": 18, "name": "number_of_comments", "comment": null}, "repository": {"type": "STRING", "index": 19, "name": "repository", "comment": null}, "repository_team_names": {"type": "STRING", "index": 20, "name": "repository_team_names", "comment": null}, "assignees": {"type": "STRING", "index": 21, "name": "assignees", "comment": null}, "creator_login_name": {"type": "STRING", "index": 22, "name": "creator_login_name", "comment": null}, "creator_name": {"type": "STRING", "index": 23, "name": "creator_name", "comment": null}, "creator_company": {"type": "STRING", "index": 24, "name": "creator_company", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 54737.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 32.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__issues"}, "model.github.int_github__issue_open_length": {"metadata": {"type": "table", "schema": "dbt_joe_github", "name": "int_github__issue_open_length", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "days_issue_open": {"type": "FLOAT64", "index": 2, "name": "days_issue_open", "comment": null}, "number_of_times_reopened": {"type": "INT64", "index": 3, "name": "number_of_times_reopened", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2664.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 111.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.int_github__issue_open_length"}, "model.github.github__monthly_metrics": {"metadata": {"type": "table", "schema": "dbt_joe_github", "name": "github__monthly_metrics", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"month": {"type": "TIMESTAMP", "index": 1, "name": "month", "comment": null}, "number_issues_opened": {"type": "INT64", "index": 2, "name": "number_issues_opened", "comment": null}, "number_issues_closed": {"type": "INT64", "index": 3, "name": "number_issues_closed", "comment": null}, "avg_days_issue_open": {"type": "FLOAT64", "index": 4, "name": "avg_days_issue_open", "comment": null}, "longest_days_issue_open": {"type": "FLOAT64", "index": 5, "name": "longest_days_issue_open", "comment": null}, "number_prs_opened": {"type": "INT64", "index": 6, "name": "number_prs_opened", "comment": null}, "number_prs_merged": {"type": "INT64", "index": 7, "name": "number_prs_merged", "comment": null}, "number_prs_closed_without_merge": {"type": "INT64", "index": 8, "name": "number_prs_closed_without_merge", "comment": null}, "avg_days_pr_open": {"type": "FLOAT64", "index": 9, "name": "avg_days_pr_open", "comment": null}, "longest_days_pr_open": {"type": "FLOAT64", "index": 10, "name": "longest_days_pr_open", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1504.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 20.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__monthly_metrics"}, "model.github.github__pull_requests": {"metadata": {"type": "table", "schema": "dbt_joe_github", "name": "github__pull_requests", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "body": {"type": "STRING", "index": 2, "name": "body", "comment": null}, "closed_at": {"type": "TIMESTAMP", "index": 3, "name": "closed_at", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "is_locked": {"type": "BOOL", "index": 5, "name": "is_locked", "comment": null}, "milestone_id": {"type": "INT64", "index": 6, "name": "milestone_id", "comment": null}, "issue_number": {"type": "INT64", "index": 7, "name": "issue_number", "comment": null}, "is_pull_request": {"type": "BOOL", "index": 8, "name": "is_pull_request", "comment": null}, "repository_id": {"type": "INT64", "index": 9, "name": "repository_id", "comment": null}, "state": {"type": "STRING", "index": 10, "name": "state", "comment": null}, "title": {"type": "STRING", "index": 11, "name": "title", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 12, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 13, "name": "user_id", "comment": null}, "url_link": {"type": "STRING", "index": 14, "name": "url_link", "comment": null}, "days_issue_open": {"type": "FLOAT64", "index": 15, "name": "days_issue_open", "comment": null}, "number_of_times_reopened": {"type": "INT64", "index": 16, "name": "number_of_times_reopened", "comment": null}, "labels": {"type": "STRING", "index": 17, "name": "labels", "comment": null}, "number_of_comments": {"type": "INT64", "index": 18, "name": "number_of_comments", "comment": null}, "repository": {"type": "STRING", "index": 19, "name": "repository", "comment": null}, "repository_team_names": {"type": "STRING", "index": 20, "name": "repository_team_names", "comment": null}, "assignees": {"type": "STRING", "index": 21, "name": "assignees", "comment": null}, "creator_login_name": {"type": "STRING", "index": 22, "name": "creator_login_name", "comment": null}, "creator_name": {"type": "STRING", "index": 23, "name": "creator_name", "comment": null}, "creator_company": {"type": "STRING", "index": 24, "name": "creator_company", "comment": null}, "hours_request_review_to_first_review": {"type": "FLOAT64", "index": 25, "name": "hours_request_review_to_first_review", "comment": null}, "hours_request_review_to_first_action": {"type": "FLOAT64", "index": 26, "name": "hours_request_review_to_first_action", "comment": null}, "hours_request_review_to_merge": {"type": "FLOAT64", "index": 27, "name": "hours_request_review_to_merge", "comment": null}, "merged_at": {"type": "TIMESTAMP", "index": 28, "name": "merged_at", "comment": null}, "reviewers": {"type": "STRING", "index": 29, "name": "reviewers", "comment": null}, "number_of_reviews": {"type": "INT64", "index": 30, "name": "number_of_reviews", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 81412.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 80.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__pull_requests"}, "model.github_source.stg_github__issue_comment_tmp": {"metadata": {"type": "view", "schema": "dbt_joe_github", "name": "stg_github__issue_comment_tmp", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "issue_id": {"type": "INT64", "index": 5, "name": "issue_id", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 6, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 7, "name": "user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_comment_tmp"}, "model.github_source.stg_github__issue_merged": {"metadata": {"type": "table", "schema": "dbt_joe_github", "name": "stg_github__issue_merged", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "merged_at": {"type": "TIMESTAMP", "index": 2, "name": "merged_at", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1168.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 73.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_merged"}, "model.github.int_github__issue_joined": {"metadata": {"type": "table", "schema": "dbt_joe_github", "name": "int_github__issue_joined", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "body": {"type": "STRING", "index": 2, "name": "body", "comment": null}, "closed_at": {"type": "TIMESTAMP", "index": 3, "name": "closed_at", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "is_locked": {"type": "BOOL", "index": 5, "name": "is_locked", "comment": null}, "milestone_id": {"type": "INT64", "index": 6, "name": "milestone_id", "comment": null}, "issue_number": {"type": "INT64", "index": 7, "name": "issue_number", "comment": null}, "is_pull_request": {"type": "BOOL", "index": 8, "name": "is_pull_request", "comment": null}, "repository_id": {"type": "INT64", "index": 9, "name": "repository_id", "comment": null}, "state": {"type": "STRING", "index": 10, "name": "state", "comment": null}, "title": {"type": "STRING", "index": 11, "name": "title", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 12, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 13, "name": "user_id", "comment": null}, "url_link": {"type": "STRING", "index": 14, "name": "url_link", "comment": null}, "days_issue_open": {"type": "FLOAT64", "index": 15, "name": "days_issue_open", "comment": null}, "number_of_times_reopened": {"type": "INT64", "index": 16, "name": "number_of_times_reopened", "comment": null}, "labels": {"type": "STRING", "index": 17, "name": "labels", "comment": null}, "number_of_comments": {"type": "INT64", "index": 18, "name": "number_of_comments", "comment": null}, "repository": {"type": "STRING", "index": 19, "name": "repository", "comment": null}, "repository_team_names": {"type": "STRING", "index": 20, "name": "repository_team_names", "comment": null}, "assignees": {"type": "STRING", "index": 21, "name": "assignees", "comment": null}, "creator_login_name": {"type": "STRING", "index": 22, "name": "creator_login_name", "comment": null}, "creator_name": {"type": "STRING", "index": 23, "name": "creator_name", "comment": null}, "creator_company": {"type": "STRING", "index": 24, "name": "creator_company", "comment": null}, "hours_request_review_to_first_review": {"type": "FLOAT64", "index": 25, "name": "hours_request_review_to_first_review", "comment": null}, "hours_request_review_to_first_action": {"type": "FLOAT64", "index": 26, "name": "hours_request_review_to_first_action", "comment": null}, "hours_request_review_to_merge": {"type": "FLOAT64", "index": 27, "name": "hours_request_review_to_merge", "comment": null}, "merged_at": {"type": "TIMESTAMP", "index": 28, "name": "merged_at", "comment": null}, "reviewers": {"type": "STRING", "index": 29, "name": "reviewers", "comment": null}, "number_of_reviews": {"type": "INT64", "index": 30, "name": "number_of_reviews", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 132986.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 111.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.int_github__issue_joined"}, "model.github_source.stg_github__issue_label_tmp": {"metadata": {"type": "view", "schema": "dbt_joe_github", "name": "stg_github__issue_label_tmp", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "label_id": {"type": "INT64", "index": 2, "name": "label_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_label_tmp"}, "model.github_source.stg_github__issue_label": {"metadata": {"type": "table", "schema": "dbt_joe_github", "name": "stg_github__issue_label", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "label_id": {"type": "INT64", "index": 2, "name": "label_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 768.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 48.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_label"}, "model.github.int_github__issue_comments": {"metadata": {"type": "table", "schema": "dbt_joe_github", "name": "int_github__issue_comments", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "number_of_comments": {"type": "INT64", "index": 2, "name": "number_of_comments", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 592.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 37.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.int_github__issue_comments"}, "model.github_source.stg_github__label": {"metadata": {"type": "table", "schema": "dbt_joe_github", "name": "stg_github__label", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"label_id": {"type": "INT64", "index": 1, "name": "label_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "color": {"type": "STRING", "index": 3, "name": "color", "comment": null}, "description": {"type": "STRING", "index": 4, "name": "description", "comment": null}, "is_default": {"type": "BOOL", "index": 5, "name": "is_default", "comment": null}, "label": {"type": "STRING", "index": 6, "name": "label", "comment": null}, "url": {"type": "STRING", "index": 7, "name": "url", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2018.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 15.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__label"}, "model.github_source.stg_github__pull_request_tmp": {"metadata": {"type": "view", "schema": "dbt_joe_github", "name": "stg_github__pull_request_tmp", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "base_label": {"type": "STRING", "index": 3, "name": "base_label", "comment": null}, "base_ref": {"type": "STRING", "index": 4, "name": "base_ref", "comment": null}, "base_repo_id": {"type": "INT64", "index": 5, "name": "base_repo_id", "comment": null}, "base_sha": {"type": "STRING", "index": 6, "name": "base_sha", "comment": null}, "base_user_id": {"type": "INT64", "index": 7, "name": "base_user_id", "comment": null}, "draft": {"type": "BOOL", "index": 8, "name": "draft", "comment": null}, "head_label": {"type": "STRING", "index": 9, "name": "head_label", "comment": null}, "head_ref": {"type": "STRING", "index": 10, "name": "head_ref", "comment": null}, "head_repo_id": {"type": "INT64", "index": 11, "name": "head_repo_id", "comment": null}, "head_sha": {"type": "STRING", "index": 12, "name": "head_sha", "comment": null}, "head_user_id": {"type": "INT64", "index": 13, "name": "head_user_id", "comment": null}, "issue_id": {"type": "INT64", "index": 14, "name": "issue_id", "comment": null}, "merge_commit_sha": {"type": "STRING", "index": 15, "name": "merge_commit_sha", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__pull_request_tmp"}, "model.github.int_github__issue_assignees": {"metadata": {"type": "table", "schema": "dbt_joe_github", "name": "int_github__issue_assignees", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "assignees": {"type": "STRING", "index": 2, "name": "assignees", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 764.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 26.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.int_github__issue_assignees"}, "model.github.int_github__pull_request_reviewers": {"metadata": {"type": "table", "schema": "dbt_joe_github", "name": "int_github__pull_request_reviewers", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"pull_request_id": {"type": "INT64", "index": 1, "name": "pull_request_id", "comment": null}, "reviewers": {"type": "STRING", "index": 2, "name": "reviewers", "comment": null}, "number_of_reviews": {"type": "INT64", "index": 3, "name": "number_of_reviews", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2620.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 46.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.int_github__pull_request_reviewers"}, "model.github_source.stg_github__issue_closed_history": {"metadata": {"type": "table", "schema": "dbt_joe_github", "name": "stg_github__issue_closed_history", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 2, "name": "updated_at", "comment": null}, "is_closed": {"type": "BOOL", "index": 3, "name": "is_closed", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1819.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 107.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_closed_history"}, "model.github.int_github__pull_request_times": {"metadata": {"type": "table", "schema": "dbt_joe_github", "name": "int_github__pull_request_times", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "merged_at": {"type": "TIMESTAMP", "index": 2, "name": "merged_at", "comment": null}, "hours_request_review_to_first_review": {"type": "FLOAT64", "index": 3, "name": "hours_request_review_to_first_review", "comment": null}, "hours_request_review_to_first_action": {"type": "FLOAT64", "index": 4, "name": "hours_request_review_to_first_action", "comment": null}, "hours_request_review_to_merge": {"type": "FLOAT64", "index": 5, "name": "hours_request_review_to_merge", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1464.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 37.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.int_github__pull_request_times"}, "model.github_source.stg_github__pull_request_review": {"metadata": {"type": "table", "schema": "dbt_joe_github", "name": "stg_github__pull_request_review", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"pull_request_review_id": {"type": "INT64", "index": 1, "name": "pull_request_review_id", "comment": null}, "pull_request_id": {"type": "INT64", "index": 2, "name": "pull_request_id", "comment": null}, "submitted_at": {"type": "TIMESTAMP", "index": 3, "name": "submitted_at", "comment": null}, "state": {"type": "STRING", "index": 4, "name": "state", "comment": null}, "user_id": {"type": "INT64", "index": 5, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 4499.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 105.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__pull_request_review"}, "model.github_source.stg_github__issue": {"metadata": {"type": "table", "schema": "dbt_joe_github", "name": "stg_github__issue", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "body": {"type": "STRING", "index": 2, "name": "body", "comment": null}, "closed_at": {"type": "TIMESTAMP", "index": 3, "name": "closed_at", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "is_locked": {"type": "BOOL", "index": 5, "name": "is_locked", "comment": null}, "milestone_id": {"type": "INT64", "index": 6, "name": "milestone_id", "comment": null}, "issue_number": {"type": "INT64", "index": 7, "name": "issue_number", "comment": null}, "is_pull_request": {"type": "BOOL", "index": 8, "name": "is_pull_request", "comment": null}, "repository_id": {"type": "INT64", "index": 9, "name": "repository_id", "comment": null}, "state": {"type": "STRING", "index": 10, "name": "state", "comment": null}, "title": {"type": "STRING", "index": 11, "name": "title", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 12, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 13, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 116611.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 112.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue"}, "model.github_source.stg_github__requested_reviewer_history": {"metadata": {"type": "table", "schema": "dbt_joe_github", "name": "stg_github__requested_reviewer_history", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"pull_request_id": {"type": "INT64", "index": 1, "name": "pull_request_id", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 2, "name": "created_at", "comment": null}, "requested_id": {"type": "INT64", "index": 3, "name": "requested_id", "comment": null}, "removed": {"type": "BOOL", "index": 4, "name": "removed", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1375.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 55.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__requested_reviewer_history"}, "model.github_source.stg_github__repository_tmp": {"metadata": {"type": "view", "schema": "dbt_joe_github", "name": "stg_github__repository_tmp", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "archived": {"type": "BOOL", "index": 3, "name": "archived", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "default_branch": {"type": "STRING", "index": 5, "name": "default_branch", "comment": null}, "description": {"type": "STRING", "index": 6, "name": "description", "comment": null}, "fork": {"type": "BOOL", "index": 7, "name": "fork", "comment": null}, "full_name": {"type": "STRING", "index": 8, "name": "full_name", "comment": null}, "homepage": {"type": "STRING", "index": 9, "name": "homepage", "comment": null}, "language": {"type": "STRING", "index": 10, "name": "language", "comment": null}, "name": {"type": "STRING", "index": 11, "name": "name", "comment": null}, "owner_id": {"type": "INT64", "index": 12, "name": "owner_id", "comment": null}, "private": {"type": "BOOL", "index": 13, "name": "private", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__repository_tmp"}, "model.github.github__quarterly_metrics": {"metadata": {"type": "table", "schema": "dbt_joe_github", "name": "github__quarterly_metrics", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"quarter": {"type": "TIMESTAMP", "index": 1, "name": "quarter", "comment": null}, "number_issues_opened": {"type": "INT64", "index": 2, "name": "number_issues_opened", "comment": null}, "number_issues_closed": {"type": "INT64", "index": 3, "name": "number_issues_closed", "comment": null}, "avg_days_issue_open": {"type": "FLOAT64", "index": 4, "name": "avg_days_issue_open", "comment": null}, "longest_days_issue_open": {"type": "FLOAT64", "index": 5, "name": "longest_days_issue_open", "comment": null}, "number_prs_opened": {"type": "INT64", "index": 6, "name": "number_prs_opened", "comment": null}, "number_prs_merged": {"type": "INT64", "index": 7, "name": "number_prs_merged", "comment": null}, "number_prs_closed_without_merge": {"type": "INT64", "index": 8, "name": "number_prs_closed_without_merge", "comment": null}, "avg_days_pr_open": {"type": "FLOAT64", "index": 9, "name": "avg_days_pr_open", "comment": null}, "longest_days_pr_open": {"type": "FLOAT64", "index": 10, "name": "longest_days_pr_open", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 624.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 8.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__quarterly_metrics"}, "model.github_source.stg_github__repo_team": {"metadata": {"type": "table", "schema": "dbt_joe_github", "name": "stg_github__repo_team", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"repository_id": {"type": "INT64", "index": 1, "name": "repository_id", "comment": null}, "team_id": {"type": "INT64", "index": 2, "name": "team_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 64.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 4.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__repo_team"}, "model.github_source.stg_github__issue_merged_tmp": {"metadata": {"type": "view", "schema": "dbt_joe_github", "name": "stg_github__issue_merged_tmp", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"commit_sha": {"type": "STRING", "index": 1, "name": "commit_sha", "comment": null}, "issue_id": {"type": "INT64", "index": 2, "name": "issue_id", "comment": null}, "merged_at": {"type": "TIMESTAMP", "index": 3, "name": "merged_at", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 5, "name": "actor_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_merged_tmp"}, "model.github_source.stg_github__team_tmp": {"metadata": {"type": "view", "schema": "dbt_joe_github", "name": "stg_github__team_tmp", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "description": {"type": "STRING", "index": 3, "name": "description", "comment": null}, "name": {"type": "STRING", "index": 4, "name": "name", "comment": null}, "org_id": {"type": "INT64", "index": 5, "name": "org_id", "comment": null}, "parent_id": {"type": "INT64", "index": 6, "name": "parent_id", "comment": null}, "privacy": {"type": "STRING", "index": 7, "name": "privacy", "comment": null}, "slug": {"type": "STRING", "index": 8, "name": "slug", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__team_tmp"}, "model.github_source.stg_github__issue_assignee": {"metadata": {"type": "table", "schema": "dbt_joe_github", "name": "stg_github__issue_assignee", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "user_id": {"type": "INT64", "index": 2, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 432.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 27.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_assignee"}, "model.github_source.stg_github__user_tmp": {"metadata": {"type": "view", "schema": "dbt_joe_github", "name": "stg_github__user_tmp", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "bio": {"type": "STRING", "index": 3, "name": "bio", "comment": null}, "blog": {"type": "STRING", "index": 4, "name": "blog", "comment": null}, "company": {"type": "STRING", "index": 5, "name": "company", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 6, "name": "created_at", "comment": null}, "hireable": {"type": "BOOL", "index": 7, "name": "hireable", "comment": null}, "location": {"type": "STRING", "index": 8, "name": "location", "comment": null}, "login": {"type": "STRING", "index": 9, "name": "login", "comment": null}, "name": {"type": "STRING", "index": 10, "name": "name", "comment": null}, "site_admin": {"type": "BOOL", "index": 11, "name": "site_admin", "comment": null}, "type": {"type": "STRING", "index": 12, "name": "type", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 13, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__user_tmp"}, "model.github_source.stg_github__label_tmp": {"metadata": {"type": "view", "schema": "dbt_joe_github", "name": "stg_github__label_tmp", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "color": {"type": "STRING", "index": 3, "name": "color", "comment": null}, "description": {"type": "STRING", "index": 4, "name": "description", "comment": null}, "is_default": {"type": "BOOL", "index": 5, "name": "is_default", "comment": null}, "name": {"type": "STRING", "index": 6, "name": "name", "comment": null}, "url": {"type": "STRING", "index": 7, "name": "url", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__label_tmp"}, "model.github_source.stg_github__team": {"metadata": {"type": "table", "schema": "dbt_joe_github", "name": "stg_github__team", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"team_id": {"type": "INT64", "index": 1, "name": "team_id", "comment": null}, "description": {"type": "STRING", "index": 2, "name": "description", "comment": null}, "name": {"type": "STRING", "index": 3, "name": "name", "comment": null}, "parent_id": {"type": "INT64", "index": 4, "name": "parent_id", "comment": null}, "privacy": {"type": "STRING", "index": 5, "name": "privacy", "comment": null}, "slug": {"type": "STRING", "index": 6, "name": "slug", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 7822.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 106.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__team"}, "model.github.int_github__issue_labels": {"metadata": {"type": "table", "schema": "dbt_joe_github", "name": "int_github__issue_labels", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "labels": {"type": "STRING", "index": 2, "name": "labels", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 296.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 37.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.int_github__issue_labels"}, "model.github_source.stg_github__issue_comment": {"metadata": {"type": "table", "schema": "dbt_joe_github", "name": "stg_github__issue_comment", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"issue_comment_id": {"type": "INT64", "index": 1, "name": "issue_comment_id", "comment": null}, "issue_id": {"type": "INT64", "index": 2, "name": "issue_id", "comment": null}, "user_id": {"type": "INT64", "index": 3, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 3768.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 157.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_comment"}, "model.github_source.stg_github__issue_closed_history_tmp": {"metadata": {"type": "view", "schema": "dbt_joe_github", "name": "stg_github__issue_closed_history_tmp", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 2, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 4, "name": "actor_id", "comment": null}, "closed": {"type": "BOOL", "index": 5, "name": "closed", "comment": null}, "commit_sha": {"type": "STRING", "index": 6, "name": "commit_sha", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_closed_history_tmp"}, "model.github_source.stg_github__issue_tmp": {"metadata": {"type": "view", "schema": "dbt_joe_github", "name": "stg_github__issue_tmp", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "closed_at": {"type": "TIMESTAMP", "index": 4, "name": "closed_at", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 5, "name": "created_at", "comment": null}, "locked": {"type": "BOOL", "index": 6, "name": "locked", "comment": null}, "milestone_id": {"type": "INT64", "index": 7, "name": "milestone_id", "comment": null}, "number": {"type": "INT64", "index": 8, "name": "number", "comment": null}, "pull_request": {"type": "BOOL", "index": 9, "name": "pull_request", "comment": null}, "repository_id": {"type": "INT64", "index": 10, "name": "repository_id", "comment": null}, "state": {"type": "STRING", "index": 11, "name": "state", "comment": null}, "title": {"type": "STRING", "index": 12, "name": "title", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 13, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 14, "name": "user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_tmp"}, "model.github_source.stg_github__repo_team_tmp": {"metadata": {"type": "view", "schema": "dbt_joe_github", "name": "stg_github__repo_team_tmp", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"repository_id": {"type": "INT64", "index": 1, "name": "repository_id", "comment": null}, "team_id": {"type": "INT64", "index": 2, "name": "team_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "permission": {"type": "STRING", "index": 4, "name": "permission", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__repo_team_tmp"}, "model.github_source.stg_github__user": {"metadata": {"type": "table", "schema": "dbt_joe_github", "name": "stg_github__user", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"user_id": {"type": "INT64", "index": 1, "name": "user_id", "comment": null}, "login_name": {"type": "STRING", "index": 2, "name": "login_name", "comment": null}, "name": {"type": "STRING", "index": 3, "name": "name", "comment": null}, "company": {"type": "STRING", "index": 4, "name": "company", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1108.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 30.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__user"}, "model.github_source.stg_github__issue_assignee_tmp": {"metadata": {"type": "view", "schema": "dbt_joe_github", "name": "stg_github__issue_assignee_tmp", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "user_id": {"type": "INT64", "index": 2, "name": "user_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_assignee_tmp"}, "model.github.github__weekly_metrics": {"metadata": {"type": "table", "schema": "dbt_joe_github", "name": "github__weekly_metrics", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"week": {"type": "TIMESTAMP", "index": 1, "name": "week", "comment": null}, "number_issues_opened": {"type": "INT64", "index": 2, "name": "number_issues_opened", "comment": null}, "number_issues_closed": {"type": "INT64", "index": 3, "name": "number_issues_closed", "comment": null}, "avg_days_issue_open": {"type": "FLOAT64", "index": 4, "name": "avg_days_issue_open", "comment": null}, "longest_days_issue_open": {"type": "FLOAT64", "index": 5, "name": "longest_days_issue_open", "comment": null}, "number_prs_opened": {"type": "INT64", "index": 6, "name": "number_prs_opened", "comment": null}, "number_prs_merged": {"type": "INT64", "index": 7, "name": "number_prs_merged", "comment": null}, "number_prs_closed_without_merge": {"type": "INT64", "index": 8, "name": "number_prs_closed_without_merge", "comment": null}, "avg_days_pr_open": {"type": "FLOAT64", "index": 9, "name": "avg_days_pr_open", "comment": null}, "longest_days_pr_open": {"type": "FLOAT64", "index": 10, "name": "longest_days_pr_open", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 3584.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 55.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__weekly_metrics"}, "model.github_source.stg_github__pull_request_review_tmp": {"metadata": {"type": "view", "schema": "dbt_joe_github", "name": "stg_github__pull_request_review_tmp", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "commit_sha": {"type": "STRING", "index": 4, "name": "commit_sha", "comment": null}, "pull_request_id": {"type": "INT64", "index": 5, "name": "pull_request_id", "comment": null}, "state": {"type": "STRING", "index": 6, "name": "state", "comment": null}, "submitted_at": {"type": "TIMESTAMP", "index": 7, "name": "submitted_at", "comment": null}, "user_id": {"type": "INT64", "index": 8, "name": "user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__pull_request_review_tmp"}, "model.github.github__daily_metrics": {"metadata": {"type": "table", "schema": "dbt_joe_github", "name": "github__daily_metrics", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"day": {"type": "TIMESTAMP", "index": 1, "name": "day", "comment": null}, "number_issues_opened": {"type": "INT64", "index": 2, "name": "number_issues_opened", "comment": null}, "number_issues_closed": {"type": "INT64", "index": 3, "name": "number_issues_closed", "comment": null}, "sum_days_issue_open": {"type": "FLOAT64", "index": 4, "name": "sum_days_issue_open", "comment": null}, "longest_days_issue_open": {"type": "FLOAT64", "index": 5, "name": "longest_days_issue_open", "comment": null}, "number_prs_opened": {"type": "INT64", "index": 6, "name": "number_prs_opened", "comment": null}, "number_prs_merged": {"type": "INT64", "index": 7, "name": "number_prs_merged", "comment": null}, "number_prs_closed_without_merge": {"type": "INT64", "index": 8, "name": "number_prs_closed_without_merge", "comment": null}, "sum_days_pr_open": {"type": "FLOAT64", "index": 9, "name": "sum_days_pr_open", "comment": null}, "longest_days_pr_open": {"type": "FLOAT64", "index": 10, "name": "longest_days_pr_open", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 6080.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 99.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__daily_metrics"}, "model.github_source.stg_github__pull_request": {"metadata": {"type": "table", "schema": "dbt_joe_github", "name": "stg_github__pull_request", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"pull_request_id": {"type": "INT64", "index": 1, "name": "pull_request_id", "comment": null}, "issue_id": {"type": "INT64", "index": 2, "name": "issue_id", "comment": null}, "head_repo_id": {"type": "INT64", "index": 3, "name": "head_repo_id", "comment": null}, "head_user_id": {"type": "INT64", "index": 4, "name": "head_user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2560.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 80.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__pull_request"}, "model.github.int_github__repository_teams": {"metadata": {"type": "table", "schema": "dbt_joe_github", "name": "int_github__repository_teams", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"repository_id": {"type": "INT64", "index": 1, "name": "repository_id", "comment": null}, "repository": {"type": "STRING", "index": 2, "name": "repository", "comment": null}, "repository_team_names": {"type": "STRING", "index": 3, "name": "repository_team_names", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 143.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 4.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.int_github__repository_teams"}, "model.github_source.stg_github__requested_reviewer_history_tmp": {"metadata": {"type": "view", "schema": "dbt_joe_github", "name": "stg_github__requested_reviewer_history_tmp", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"created_at": {"type": "TIMESTAMP", "index": 1, "name": "created_at", "comment": null}, "pull_request_id": {"type": "INT64", "index": 2, "name": "pull_request_id", "comment": null}, "requested_id": {"type": "INT64", "index": 3, "name": "requested_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 5, "name": "actor_id", "comment": null}, "removed": {"type": "BOOL", "index": 6, "name": "removed", "comment": null}, "requested_reviewer_type": {"type": "STRING", "index": 7, "name": "requested_reviewer_type", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__requested_reviewer_history_tmp"}}, "sources": {"source.github_source.github.repository": {"metadata": {"type": "table", "schema": "github_new", "name": "repository", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "archived": {"type": "BOOL", "index": 3, "name": "archived", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "default_branch": {"type": "STRING", "index": 5, "name": "default_branch", "comment": null}, "description": {"type": "STRING", "index": 6, "name": "description", "comment": null}, "fork": {"type": "BOOL", "index": 7, "name": "fork", "comment": null}, "full_name": {"type": "STRING", "index": 8, "name": "full_name", "comment": null}, "homepage": {"type": "STRING", "index": 9, "name": "homepage", "comment": null}, "language": {"type": "STRING", "index": 10, "name": "language", "comment": null}, "name": {"type": "STRING", "index": 11, "name": "name", "comment": null}, "owner_id": {"type": "INT64", "index": 12, "name": "owner_id", "comment": null}, "private": {"type": "BOOL", "index": 13, "name": "private", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 666.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 4.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.repository"}, "source.github_source.github.label": {"metadata": {"type": "table", "schema": "github_new", "name": "label", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "color": {"type": "STRING", "index": 3, "name": "color", "comment": null}, "description": {"type": "STRING", "index": 4, "name": "description", "comment": null}, "is_default": {"type": "BOOL", "index": 5, "name": "is_default", "comment": null}, "name": {"type": "STRING", "index": 6, "name": "name", "comment": null}, "url": {"type": "STRING", "index": 7, "name": "url", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2018.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 15.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.label"}, "source.github_source.github.issue_assignee": {"metadata": {"type": "table", "schema": "github_new", "name": "issue_assignee", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "user_id": {"type": "INT64", "index": 2, "name": "user_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 648.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 27.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.issue_assignee"}, "source.github_source.github.pull_request_review": {"metadata": {"type": "table", "schema": "github_new", "name": "pull_request_review", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "commit_sha": {"type": "STRING", "index": 4, "name": "commit_sha", "comment": null}, "pull_request_id": {"type": "INT64", "index": 5, "name": "pull_request_id", "comment": null}, "state": {"type": "STRING", "index": 6, "name": "state", "comment": null}, "submitted_at": {"type": "TIMESTAMP", "index": 7, "name": "submitted_at", "comment": null}, "user_id": {"type": "INT64", "index": 8, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 16654.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 105.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.pull_request_review"}, "source.github_source.github.issue_merged": {"metadata": {"type": "table", "schema": "github_new", "name": "issue_merged", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"commit_sha": {"type": "STRING", "index": 1, "name": "commit_sha", "comment": null}, "issue_id": {"type": "INT64", "index": 2, "name": "issue_id", "comment": null}, "merged_at": {"type": "TIMESTAMP", "index": 3, "name": "merged_at", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 5, "name": "actor_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 5402.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 73.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.issue_merged"}, "source.github_source.github.repo_team": {"metadata": {"type": "table", "schema": "github_new", "name": "repo_team", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"repository_id": {"type": "INT64", "index": 1, "name": "repository_id", "comment": null}, "team_id": {"type": "INT64", "index": 2, "name": "team_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "permission": {"type": "STRING", "index": 4, "name": "permission", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 124.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 4.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.repo_team"}, "source.github_source.github.issue_closed_history": {"metadata": {"type": "table", "schema": "github_new", "name": "issue_closed_history", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 2, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 4, "name": "actor_id", "comment": null}, "closed": {"type": "BOOL", "index": 5, "name": "closed", "comment": null}, "commit_sha": {"type": "STRING", "index": 6, "name": "commit_sha", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 3531.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 107.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.issue_closed_history"}, "source.github_source.github.issue": {"metadata": {"type": "table", "schema": "github_new", "name": "issue", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "closed_at": {"type": "TIMESTAMP", "index": 4, "name": "closed_at", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 5, "name": "created_at", "comment": null}, "locked": {"type": "BOOL", "index": 6, "name": "locked", "comment": null}, "milestone_id": {"type": "INT64", "index": 7, "name": "milestone_id", "comment": null}, "number": {"type": "INT64", "index": 8, "name": "number", "comment": null}, "pull_request": {"type": "BOOL", "index": 9, "name": "pull_request", "comment": null}, "repository_id": {"type": "INT64", "index": 10, "name": "repository_id", "comment": null}, "state": {"type": "STRING", "index": 11, "name": "state", "comment": null}, "title": {"type": "STRING", "index": 12, "name": "title", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 13, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 14, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 117507.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 112.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.issue"}, "source.github_source.github.requested_reviewer_history": {"metadata": {"type": "table", "schema": "github_new", "name": "requested_reviewer_history", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"created_at": {"type": "TIMESTAMP", "index": 1, "name": "created_at", "comment": null}, "pull_request_id": {"type": "INT64", "index": 2, "name": "pull_request_id", "comment": null}, "requested_id": {"type": "INT64", "index": 3, "name": "requested_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 5, "name": "actor_id", "comment": null}, "removed": {"type": "BOOL", "index": 6, "name": "removed", "comment": null}, "requested_reviewer_type": {"type": "STRING", "index": 7, "name": "requested_reviewer_type", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2585.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 55.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.requested_reviewer_history"}, "source.github_source.github.team": {"metadata": {"type": "table", "schema": "github_new", "name": "team", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "description": {"type": "STRING", "index": 3, "name": "description", "comment": null}, "name": {"type": "STRING", "index": 4, "name": "name", "comment": null}, "org_id": {"type": "INT64", "index": 5, "name": "org_id", "comment": null}, "parent_id": {"type": "INT64", "index": 6, "name": "parent_id", "comment": null}, "privacy": {"type": "STRING", "index": 7, "name": "privacy", "comment": null}, "slug": {"type": "STRING", "index": 8, "name": "slug", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 9518.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 106.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.team"}, "source.github_source.github.issue_label": {"metadata": {"type": "table", "schema": "github_new", "name": "issue_label", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "label_id": {"type": "INT64", "index": 2, "name": "label_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1152.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 48.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.issue_label"}, "source.github_source.github.issue_comment": {"metadata": {"type": "table", "schema": "github_new", "name": "issue_comment", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "issue_id": {"type": "INT64", "index": 5, "name": "issue_id", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 6, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 7, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 69210.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 157.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.issue_comment"}, "source.github_source.github.pull_request": {"metadata": {"type": "table", "schema": "github_new", "name": "pull_request", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "base_label": {"type": "STRING", "index": 3, "name": "base_label", "comment": null}, "base_ref": {"type": "STRING", "index": 4, "name": "base_ref", "comment": null}, "base_repo_id": {"type": "INT64", "index": 5, "name": "base_repo_id", "comment": null}, "base_sha": {"type": "STRING", "index": 6, "name": "base_sha", "comment": null}, "base_user_id": {"type": "INT64", "index": 7, "name": "base_user_id", "comment": null}, "draft": {"type": "BOOL", "index": 8, "name": "draft", "comment": null}, "head_label": {"type": "STRING", "index": 9, "name": "head_label", "comment": null}, "head_ref": {"type": "STRING", "index": 10, "name": "head_ref", "comment": null}, "head_repo_id": {"type": "INT64", "index": 11, "name": "head_repo_id", "comment": null}, "head_sha": {"type": "STRING", "index": 12, "name": "head_sha", "comment": null}, "head_user_id": {"type": "INT64", "index": 13, "name": "head_user_id", "comment": null}, "issue_id": {"type": "INT64", "index": 14, "name": "issue_id", "comment": null}, "merge_commit_sha": {"type": "STRING", "index": 15, "name": "merge_commit_sha", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 20337.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 80.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.pull_request"}, "source.github_source.github.user": {"metadata": {"type": "table", "schema": "github_new", "name": "user", "database": "bigquery-proj", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "bio": {"type": "STRING", "index": 3, "name": "bio", "comment": null}, "blog": {"type": "STRING", "index": 4, "name": "blog", "comment": null}, "company": {"type": "STRING", "index": 5, "name": "company", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 6, "name": "created_at", "comment": null}, "hireable": {"type": "BOOL", "index": 7, "name": "hireable", "comment": null}, "location": {"type": "STRING", "index": 8, "name": "location", "comment": null}, "login": {"type": "STRING", "index": 9, "name": "login", "comment": null}, "name": {"type": "STRING", "index": 10, "name": "name", "comment": null}, "site_admin": {"type": "BOOL", "index": 11, "name": "site_admin", "comment": null}, "type": {"type": "STRING", "index": 12, "name": "type", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 13, "name": "updated_at", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 3053.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 30.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.user"}}, "errors": null} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "1.3.0", "generated_at": "2022-10-26T19:31:54.439013Z", "invocation_id": "56400515-88f7-4836-88ef-853ef5bcc0a5", "env": {}}, "nodes": {"model.github_source.stg_github__pull_request_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__pull_request_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "base_label": {"type": "STRING", "index": 3, "name": "base_label", "comment": null}, "base_ref": {"type": "STRING", "index": 4, "name": "base_ref", "comment": null}, "base_repo_id": {"type": "INT64", "index": 5, "name": "base_repo_id", "comment": null}, "base_sha": {"type": "STRING", "index": 6, "name": "base_sha", "comment": null}, "base_user_id": {"type": "INT64", "index": 7, "name": "base_user_id", "comment": null}, "head_label": {"type": "STRING", "index": 8, "name": "head_label", "comment": null}, "head_ref": {"type": "STRING", "index": 9, "name": "head_ref", "comment": null}, "head_repo_id": {"type": "INT64", "index": 10, "name": "head_repo_id", "comment": null}, "head_sha": {"type": "STRING", "index": 11, "name": "head_sha", "comment": null}, "head_user_id": {"type": "INT64", "index": 12, "name": "head_user_id", "comment": null}, "issue_id": {"type": "INT64", "index": 13, "name": "issue_id", "comment": null}, "merge_commit_sha": {"type": "STRING", "index": 14, "name": "merge_commit_sha", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__pull_request_tmp"}, "model.github_source.stg_github__label": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__label", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"label_id": {"type": "INT64", "index": 1, "name": "label_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "color": {"type": "STRING", "index": 3, "name": "color", "comment": null}, "description": {"type": "STRING", "index": 4, "name": "description", "comment": null}, "is_default": {"type": "BOOL", "index": 5, "name": "is_default", "comment": null}, "label": {"type": "STRING", "index": 6, "name": "label", "comment": null}, "url": {"type": "STRING", "index": 7, "name": "url", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 15.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2016.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__label"}, "seed.github_integration_tests.github_repo_team_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_repo_team_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"repository_id": {"type": "INT64", "index": 1, "name": "repository_id", "comment": null}, "team_id": {"type": "INT64", "index": 2, "name": "team_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "permission": {"type": "STRING", "index": 4, "name": "permission", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 8.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 464.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_repo_team_data"}, "model.github_source.stg_github__pull_request_review_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__pull_request_review_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "commit_sha": {"type": "STRING", "index": 4, "name": "commit_sha", "comment": null}, "pull_request_id": {"type": "INT64", "index": 5, "name": "pull_request_id", "comment": null}, "state": {"type": "STRING", "index": 6, "name": "state", "comment": null}, "submitted_at": {"type": "TIMESTAMP", "index": 7, "name": "submitted_at", "comment": null}, "user_id": {"type": "INT64", "index": 8, "name": "user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__pull_request_review_tmp"}, "model.github_source.stg_github__issue_label_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__issue_label_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "label_id": {"type": "INT64", "index": 2, "name": "label_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_label_tmp"}, "seed.github_integration_tests.github_issue_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "closed_at": {"type": "TIMESTAMP", "index": 4, "name": "closed_at", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 5, "name": "created_at", "comment": null}, "locked": {"type": "BOOL", "index": 6, "name": "locked", "comment": null}, "milestone_id": {"type": "INT64", "index": 7, "name": "milestone_id", "comment": null}, "number": {"type": "INT64", "index": 8, "name": "number", "comment": null}, "pull_request": {"type": "BOOL", "index": 9, "name": "pull_request", "comment": null}, "repository_id": {"type": "INT64", "index": 10, "name": "repository_id", "comment": null}, "state": {"type": "STRING", "index": 11, "name": "state", "comment": null}, "title": {"type": "STRING", "index": 12, "name": "title", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 13, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 14, "name": "user_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 197.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 40530.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_data"}, "model.github_source.stg_github__issue_assignee_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__issue_assignee_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "user_id": {"type": "INT64", "index": 2, "name": "user_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_assignee_tmp"}, "model.github_source.stg_github__repository_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__repository_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "archived": {"type": "BOOL", "index": 3, "name": "archived", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "default_branch": {"type": "STRING", "index": 5, "name": "default_branch", "comment": null}, "description": {"type": "STRING", "index": 6, "name": "description", "comment": null}, "fork": {"type": "BOOL", "index": 7, "name": "fork", "comment": null}, "full_name": {"type": "STRING", "index": 8, "name": "full_name", "comment": null}, "homepage": {"type": "INT64", "index": 9, "name": "homepage", "comment": null}, "language": {"type": "STRING", "index": 10, "name": "language", "comment": null}, "name": {"type": "STRING", "index": 11, "name": "name", "comment": null}, "owner_id": {"type": "INT64", "index": 12, "name": "owner_id", "comment": null}, "private": {"type": "BOOL", "index": 13, "name": "private", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__repository_tmp"}, "model.github_source.stg_github__pull_request_review": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__pull_request_review", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"pull_request_review_id": {"type": "INT64", "index": 1, "name": "pull_request_review_id", "comment": null}, "pull_request_id": {"type": "INT64", "index": 2, "name": "pull_request_id", "comment": null}, "submitted_at": {"type": "TIMESTAMP", "index": 3, "name": "submitted_at", "comment": null}, "state": {"type": "STRING", "index": 4, "name": "state", "comment": null}, "user_id": {"type": "INT64", "index": 5, "name": "user_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 114.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 4835.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__pull_request_review"}, "model.github.github__monthly_metrics": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github__monthly_metrics", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"month": {"type": "TIMESTAMP", "index": 1, "name": "month", "comment": null}, "number_issues_opened": {"type": "INT64", "index": 2, "name": "number_issues_opened", "comment": null}, "number_issues_closed": {"type": "INT64", "index": 3, "name": "number_issues_closed", "comment": null}, "avg_days_issue_open": {"type": "FLOAT64", "index": 4, "name": "avg_days_issue_open", "comment": null}, "longest_days_issue_open": {"type": "FLOAT64", "index": 5, "name": "longest_days_issue_open", "comment": null}, "number_prs_opened": {"type": "INT64", "index": 6, "name": "number_prs_opened", "comment": null}, "number_prs_merged": {"type": "INT64", "index": 7, "name": "number_prs_merged", "comment": null}, "number_prs_closed_without_merge": {"type": "INT64", "index": 8, "name": "number_prs_closed_without_merge", "comment": null}, "avg_days_pr_open": {"type": "FLOAT64", "index": 9, "name": "avg_days_pr_open", "comment": null}, "longest_days_pr_open": {"type": "FLOAT64", "index": 10, "name": "longest_days_pr_open", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 25.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1888.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__monthly_metrics"}, "seed.github_integration_tests.github_issue_comment_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_comment_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "created_at": {"type": "DATETIME", "index": 4, "name": "created_at", "comment": null}, "issue_id": {"type": "INT64", "index": 5, "name": "issue_id", "comment": null}, "updated_at": {"type": "DATETIME", "index": 6, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 7, "name": "user_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 43.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 4902.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_comment_data"}, "seed.github_integration_tests.github_issue_label_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_label_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "label_id": {"type": "INT64", "index": 2, "name": "label_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 46.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1104.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_label_data"}, "model.github_source.stg_github__label_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__label_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "color": {"type": "STRING", "index": 3, "name": "color", "comment": null}, "description": {"type": "STRING", "index": 4, "name": "description", "comment": null}, "is_default": {"type": "BOOL", "index": 5, "name": "is_default", "comment": null}, "name": {"type": "STRING", "index": 6, "name": "name", "comment": null}, "url": {"type": "STRING", "index": 7, "name": "url", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__label_tmp"}, "model.github_source.stg_github__pull_request": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__pull_request", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"pull_request_id": {"type": "INT64", "index": 1, "name": "pull_request_id", "comment": null}, "issue_id": {"type": "INT64", "index": 2, "name": "issue_id", "comment": null}, "head_repo_id": {"type": "INT64", "index": 3, "name": "head_repo_id", "comment": null}, "head_user_id": {"type": "INT64", "index": 4, "name": "head_user_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 167.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 5320.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__pull_request"}, "model.github_source.stg_github__issue_merged_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__issue_merged_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"commit_sha": {"type": "STRING", "index": 1, "name": "commit_sha", "comment": null}, "issue_id": {"type": "INT64", "index": 2, "name": "issue_id", "comment": null}, "merged_at": {"type": "TIMESTAMP", "index": 3, "name": "merged_at", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 5, "name": "actor_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_merged_tmp"}, "seed.github_integration_tests.github_requested_reviewer_history_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_requested_reviewer_history_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"created_at": {"type": "TIMESTAMP", "index": 1, "name": "created_at", "comment": null}, "pull_request_id": {"type": "INT64", "index": 2, "name": "pull_request_id", "comment": null}, "requested_id": {"type": "INT64", "index": 3, "name": "requested_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 5, "name": "actor_id", "comment": null}, "removed": {"type": "BOOL", "index": 6, "name": "removed", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 41.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1681.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_requested_reviewer_history_data"}, "model.github_source.stg_github__issue_closed_history_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__issue_closed_history_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 2, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 4, "name": "actor_id", "comment": null}, "closed": {"type": "BOOL", "index": 5, "name": "closed", "comment": null}, "commit_sha": {"type": "INT64", "index": 6, "name": "commit_sha", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_closed_history_tmp"}, "model.github_source.stg_github__issue_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__issue_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "closed_at": {"type": "TIMESTAMP", "index": 4, "name": "closed_at", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 5, "name": "created_at", "comment": null}, "locked": {"type": "BOOL", "index": 6, "name": "locked", "comment": null}, "milestone_id": {"type": "INT64", "index": 7, "name": "milestone_id", "comment": null}, "number": {"type": "INT64", "index": 8, "name": "number", "comment": null}, "pull_request": {"type": "BOOL", "index": 9, "name": "pull_request", "comment": null}, "repository_id": {"type": "INT64", "index": 10, "name": "repository_id", "comment": null}, "state": {"type": "STRING", "index": 11, "name": "state", "comment": null}, "title": {"type": "STRING", "index": 12, "name": "title", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 13, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 14, "name": "user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_tmp"}, "model.github_source.stg_github__user_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__user_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "bio": {"type": "STRING", "index": 3, "name": "bio", "comment": null}, "blog": {"type": "STRING", "index": 4, "name": "blog", "comment": null}, "company": {"type": "STRING", "index": 5, "name": "company", "comment": null}, "created_at": {"type": "DATETIME", "index": 6, "name": "created_at", "comment": null}, "hireable": {"type": "BOOL", "index": 7, "name": "hireable", "comment": null}, "location": {"type": "STRING", "index": 8, "name": "location", "comment": null}, "login": {"type": "STRING", "index": 9, "name": "login", "comment": null}, "name": {"type": "STRING", "index": 10, "name": "name", "comment": null}, "site_admin": {"type": "BOOL", "index": 11, "name": "site_admin", "comment": null}, "type": {"type": "STRING", "index": 12, "name": "type", "comment": null}, "updated_at": {"type": "DATETIME", "index": 13, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__user_tmp"}, "model.github_source.stg_github__issue": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__issue", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "body": {"type": "STRING", "index": 2, "name": "body", "comment": null}, "closed_at": {"type": "TIMESTAMP", "index": 3, "name": "closed_at", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "is_locked": {"type": "BOOL", "index": 5, "name": "is_locked", "comment": null}, "milestone_id": {"type": "INT64", "index": 6, "name": "milestone_id", "comment": null}, "issue_number": {"type": "INT64", "index": 7, "name": "issue_number", "comment": null}, "is_pull_request": {"type": "BOOL", "index": 8, "name": "is_pull_request", "comment": null}, "repository_id": {"type": "INT64", "index": 9, "name": "repository_id", "comment": null}, "state": {"type": "STRING", "index": 10, "name": "state", "comment": null}, "title": {"type": "STRING", "index": 11, "name": "title", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 12, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 13, "name": "user_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 197.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 38954.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue"}, "seed.github_integration_tests.github_pull_request_review_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_pull_request_review_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "commit_sha": {"type": "STRING", "index": 4, "name": "commit_sha", "comment": null}, "pull_request_id": {"type": "INT64", "index": 5, "name": "pull_request_id", "comment": null}, "state": {"type": "STRING", "index": 6, "name": "state", "comment": null}, "submitted_at": {"type": "TIMESTAMP", "index": 7, "name": "submitted_at", "comment": null}, "user_id": {"type": "INT64", "index": 8, "name": "user_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 114.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 18059.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_pull_request_review_data"}, "model.github_source.stg_github__team": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__team", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"team_id": {"type": "INT64", "index": 1, "name": "team_id", "comment": null}, "description": {"type": "STRING", "index": 2, "name": "description", "comment": null}, "name": {"type": "STRING", "index": 3, "name": "name", "comment": null}, "parent_id": {"type": "INT64", "index": 4, "name": "parent_id", "comment": null}, "privacy": {"type": "STRING", "index": 5, "name": "privacy", "comment": null}, "slug": {"type": "STRING", "index": 6, "name": "slug", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 19.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2042.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__team"}, "model.github.github__quarterly_metrics": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github__quarterly_metrics", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"quarter": {"type": "TIMESTAMP", "index": 1, "name": "quarter", "comment": null}, "number_issues_opened": {"type": "INT64", "index": 2, "name": "number_issues_opened", "comment": null}, "number_issues_closed": {"type": "INT64", "index": 3, "name": "number_issues_closed", "comment": null}, "avg_days_issue_open": {"type": "FLOAT64", "index": 4, "name": "avg_days_issue_open", "comment": null}, "longest_days_issue_open": {"type": "FLOAT64", "index": 5, "name": "longest_days_issue_open", "comment": null}, "number_prs_opened": {"type": "INT64", "index": 6, "name": "number_prs_opened", "comment": null}, "number_prs_merged": {"type": "INT64", "index": 7, "name": "number_prs_merged", "comment": null}, "number_prs_closed_without_merge": {"type": "INT64", "index": 8, "name": "number_prs_closed_without_merge", "comment": null}, "avg_days_pr_open": {"type": "FLOAT64", "index": 9, "name": "avg_days_pr_open", "comment": null}, "longest_days_pr_open": {"type": "FLOAT64", "index": 10, "name": "longest_days_pr_open", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 9.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 720.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__quarterly_metrics"}, "seed.github_integration_tests.github_issue_closed_history_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_closed_history_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 2, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 4, "name": "actor_id", "comment": null}, "closed": {"type": "BOOL", "index": 5, "name": "closed", "comment": null}, "commit_sha": {"type": "INT64", "index": 6, "name": "commit_sha", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 171.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 5643.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_closed_history_data"}, "model.github_source.stg_github__team_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__team_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "description": {"type": "STRING", "index": 3, "name": "description", "comment": null}, "name": {"type": "STRING", "index": 4, "name": "name", "comment": null}, "org_id": {"type": "INT64", "index": 5, "name": "org_id", "comment": null}, "parent_id": {"type": "INT64", "index": 6, "name": "parent_id", "comment": null}, "privacy": {"type": "STRING", "index": 7, "name": "privacy", "comment": null}, "slug": {"type": "STRING", "index": 8, "name": "slug", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__team_tmp"}, "model.github.github__weekly_metrics": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github__weekly_metrics", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"week": {"type": "TIMESTAMP", "index": 1, "name": "week", "comment": null}, "number_issues_opened": {"type": "INT64", "index": 2, "name": "number_issues_opened", "comment": null}, "number_issues_closed": {"type": "INT64", "index": 3, "name": "number_issues_closed", "comment": null}, "avg_days_issue_open": {"type": "FLOAT64", "index": 4, "name": "avg_days_issue_open", "comment": null}, "longest_days_issue_open": {"type": "FLOAT64", "index": 5, "name": "longest_days_issue_open", "comment": null}, "number_prs_opened": {"type": "INT64", "index": 6, "name": "number_prs_opened", "comment": null}, "number_prs_merged": {"type": "INT64", "index": 7, "name": "number_prs_merged", "comment": null}, "number_prs_closed_without_merge": {"type": "INT64", "index": 8, "name": "number_prs_closed_without_merge", "comment": null}, "avg_days_pr_open": {"type": "FLOAT64", "index": 9, "name": "avg_days_pr_open", "comment": null}, "longest_days_pr_open": {"type": "FLOAT64", "index": 10, "name": "longest_days_pr_open", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 102.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 6672.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__weekly_metrics"}, "model.github_source.stg_github__issue_comment": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__issue_comment", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_comment_id": {"type": "INT64", "index": 1, "name": "issue_comment_id", "comment": null}, "issue_id": {"type": "INT64", "index": 2, "name": "issue_id", "comment": null}, "user_id": {"type": "INT64", "index": 3, "name": "user_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 43.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1032.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_comment"}, "seed.github_integration_tests.github_pull_request_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_pull_request_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "base_label": {"type": "STRING", "index": 3, "name": "base_label", "comment": null}, "base_ref": {"type": "STRING", "index": 4, "name": "base_ref", "comment": null}, "base_repo_id": {"type": "INT64", "index": 5, "name": "base_repo_id", "comment": null}, "base_sha": {"type": "STRING", "index": 6, "name": "base_sha", "comment": null}, "base_user_id": {"type": "INT64", "index": 7, "name": "base_user_id", "comment": null}, "head_label": {"type": "STRING", "index": 8, "name": "head_label", "comment": null}, "head_ref": {"type": "STRING", "index": 9, "name": "head_ref", "comment": null}, "head_repo_id": {"type": "INT64", "index": 10, "name": "head_repo_id", "comment": null}, "head_sha": {"type": "STRING", "index": 11, "name": "head_sha", "comment": null}, "head_user_id": {"type": "INT64", "index": 12, "name": "head_user_id", "comment": null}, "issue_id": {"type": "INT64", "index": 13, "name": "issue_id", "comment": null}, "merge_commit_sha": {"type": "STRING", "index": 14, "name": "merge_commit_sha", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 167.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 56627.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_pull_request_data"}, "model.github_source.stg_github__requested_reviewer_history": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__requested_reviewer_history", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"pull_request_id": {"type": "INT64", "index": 1, "name": "pull_request_id", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 2, "name": "created_at", "comment": null}, "requested_id": {"type": "INT64", "index": 3, "name": "requested_id", "comment": null}, "removed": {"type": "BOOL", "index": 4, "name": "removed", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 41.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1025.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__requested_reviewer_history"}, "seed.github_integration_tests.github_repository_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_repository_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "archived": {"type": "BOOL", "index": 3, "name": "archived", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "default_branch": {"type": "STRING", "index": 5, "name": "default_branch", "comment": null}, "description": {"type": "STRING", "index": 6, "name": "description", "comment": null}, "fork": {"type": "BOOL", "index": 7, "name": "fork", "comment": null}, "full_name": {"type": "STRING", "index": 8, "name": "full_name", "comment": null}, "homepage": {"type": "INT64", "index": 9, "name": "homepage", "comment": null}, "language": {"type": "STRING", "index": 10, "name": "language", "comment": null}, "name": {"type": "STRING", "index": 11, "name": "name", "comment": null}, "owner_id": {"type": "INT64", "index": 12, "name": "owner_id", "comment": null}, "private": {"type": "BOOL", "index": 13, "name": "private", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 24.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 5793.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_repository_data"}, "model.github_source.stg_github__repository": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__repository", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"repository_id": {"type": "INT64", "index": 1, "name": "repository_id", "comment": null}, "full_name": {"type": "STRING", "index": 2, "name": "full_name", "comment": null}, "is_private": {"type": "BOOL", "index": 3, "name": "is_private", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 24.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1800.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__repository"}, "model.github.github__issues": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github__issues", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "body": {"type": "STRING", "index": 2, "name": "body", "comment": null}, "closed_at": {"type": "TIMESTAMP", "index": 3, "name": "closed_at", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "is_locked": {"type": "BOOL", "index": 5, "name": "is_locked", "comment": null}, "milestone_id": {"type": "INT64", "index": 6, "name": "milestone_id", "comment": null}, "issue_number": {"type": "INT64", "index": 7, "name": "issue_number", "comment": null}, "is_pull_request": {"type": "BOOL", "index": 8, "name": "is_pull_request", "comment": null}, "repository_id": {"type": "INT64", "index": 9, "name": "repository_id", "comment": null}, "state": {"type": "STRING", "index": 10, "name": "state", "comment": null}, "title": {"type": "STRING", "index": 11, "name": "title", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 12, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 13, "name": "user_id", "comment": null}, "url_link": {"type": "STRING", "index": 14, "name": "url_link", "comment": null}, "days_issue_open": {"type": "FLOAT64", "index": 15, "name": "days_issue_open", "comment": null}, "number_of_times_reopened": {"type": "INT64", "index": 16, "name": "number_of_times_reopened", "comment": null}, "labels": {"type": "STRING", "index": 17, "name": "labels", "comment": null}, "number_of_comments": {"type": "INT64", "index": 18, "name": "number_of_comments", "comment": null}, "repository": {"type": "STRING", "index": 19, "name": "repository", "comment": null}, "repository_team_names": {"type": "STRING", "index": 20, "name": "repository_team_names", "comment": null}, "assignees": {"type": "STRING", "index": 21, "name": "assignees", "comment": null}, "creator_login_name": {"type": "STRING", "index": 22, "name": "creator_login_name", "comment": null}, "creator_name": {"type": "STRING", "index": 23, "name": "creator_name", "comment": null}, "creator_company": {"type": "STRING", "index": 24, "name": "creator_company", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 30.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 16053.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__issues"}, "model.github_source.stg_github__issue_comment_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__issue_comment_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "created_at": {"type": "DATETIME", "index": 4, "name": "created_at", "comment": null}, "issue_id": {"type": "INT64", "index": 5, "name": "issue_id", "comment": null}, "updated_at": {"type": "DATETIME", "index": 6, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 7, "name": "user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_comment_tmp"}, "model.github_source.stg_github__issue_label": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__issue_label", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "label_id": {"type": "INT64", "index": 2, "name": "label_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 46.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 736.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_label"}, "model.github_source.stg_github__repo_team_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__repo_team_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"repository_id": {"type": "INT64", "index": 1, "name": "repository_id", "comment": null}, "team_id": {"type": "INT64", "index": 2, "name": "team_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "permission": {"type": "STRING", "index": 4, "name": "permission", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__repo_team_tmp"}, "model.github_source.stg_github__user": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__user", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"user_id": {"type": "INT64", "index": 1, "name": "user_id", "comment": null}, "login_name": {"type": "STRING", "index": 2, "name": "login_name", "comment": null}, "name": {"type": "STRING", "index": 3, "name": "name", "comment": null}, "company": {"type": "STRING", "index": 4, "name": "company", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 17.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 3502.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__user"}, "seed.github_integration_tests.github_label_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_label_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "color": {"type": "STRING", "index": 3, "name": "color", "comment": null}, "description": {"type": "STRING", "index": 4, "name": "description", "comment": null}, "is_default": {"type": "BOOL", "index": 5, "name": "is_default", "comment": null}, "name": {"type": "STRING", "index": 6, "name": "name", "comment": null}, "url": {"type": "STRING", "index": 7, "name": "url", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 15.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2016.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_label_data"}, "seed.github_integration_tests.github_team_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_team_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "description": {"type": "STRING", "index": 3, "name": "description", "comment": null}, "name": {"type": "STRING", "index": 4, "name": "name", "comment": null}, "org_id": {"type": "INT64", "index": 5, "name": "org_id", "comment": null}, "parent_id": {"type": "INT64", "index": 6, "name": "parent_id", "comment": null}, "privacy": {"type": "STRING", "index": 7, "name": "privacy", "comment": null}, "slug": {"type": "STRING", "index": 8, "name": "slug", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 19.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2346.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_team_data"}, "model.github_source.stg_github__issue_closed_history": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__issue_closed_history", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 2, "name": "updated_at", "comment": null}, "is_closed": {"type": "BOOL", "index": 3, "name": "is_closed", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 171.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2907.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_closed_history"}, "seed.github_integration_tests.github_issue_merged_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_merged_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"commit_sha": {"type": "STRING", "index": 1, "name": "commit_sha", "comment": null}, "issue_id": {"type": "INT64", "index": 2, "name": "issue_id", "comment": null}, "merged_at": {"type": "TIMESTAMP", "index": 3, "name": "merged_at", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 5, "name": "actor_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 110.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 8140.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_merged_data"}, "seed.github_integration_tests.github_issue_assignee_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_assignee_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "user_id": {"type": "INT64", "index": 2, "name": "user_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 200.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 4800.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_assignee_data"}, "model.github.github__pull_requests": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github__pull_requests", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "body": {"type": "STRING", "index": 2, "name": "body", "comment": null}, "closed_at": {"type": "TIMESTAMP", "index": 3, "name": "closed_at", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "is_locked": {"type": "BOOL", "index": 5, "name": "is_locked", "comment": null}, "milestone_id": {"type": "INT64", "index": 6, "name": "milestone_id", "comment": null}, "issue_number": {"type": "INT64", "index": 7, "name": "issue_number", "comment": null}, "is_pull_request": {"type": "BOOL", "index": 8, "name": "is_pull_request", "comment": null}, "repository_id": {"type": "INT64", "index": 9, "name": "repository_id", "comment": null}, "state": {"type": "STRING", "index": 10, "name": "state", "comment": null}, "title": {"type": "STRING", "index": 11, "name": "title", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 12, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 13, "name": "user_id", "comment": null}, "url_link": {"type": "STRING", "index": 14, "name": "url_link", "comment": null}, "days_issue_open": {"type": "FLOAT64", "index": 15, "name": "days_issue_open", "comment": null}, "number_of_times_reopened": {"type": "INT64", "index": 16, "name": "number_of_times_reopened", "comment": null}, "labels": {"type": "STRING", "index": 17, "name": "labels", "comment": null}, "number_of_comments": {"type": "INT64", "index": 18, "name": "number_of_comments", "comment": null}, "repository": {"type": "STRING", "index": 19, "name": "repository", "comment": null}, "repository_team_names": {"type": "STRING", "index": 20, "name": "repository_team_names", "comment": null}, "assignees": {"type": "STRING", "index": 21, "name": "assignees", "comment": null}, "creator_login_name": {"type": "STRING", "index": 22, "name": "creator_login_name", "comment": null}, "creator_name": {"type": "STRING", "index": 23, "name": "creator_name", "comment": null}, "creator_company": {"type": "STRING", "index": 24, "name": "creator_company", "comment": null}, "hours_request_review_to_first_review": {"type": "FLOAT64", "index": 25, "name": "hours_request_review_to_first_review", "comment": null}, "hours_request_review_to_first_action": {"type": "FLOAT64", "index": 26, "name": "hours_request_review_to_first_action", "comment": null}, "hours_request_review_to_merge": {"type": "FLOAT64", "index": 27, "name": "hours_request_review_to_merge", "comment": null}, "merged_at": {"type": "TIMESTAMP", "index": 28, "name": "merged_at", "comment": null}, "reviewers": {"type": "STRING", "index": 29, "name": "reviewers", "comment": null}, "number_of_reviews": {"type": "INT64", "index": 30, "name": "number_of_reviews", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 167.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 106809.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__pull_requests"}, "model.github.github__daily_metrics": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github__daily_metrics", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"day": {"type": "TIMESTAMP", "index": 1, "name": "day", "comment": null}, "number_issues_opened": {"type": "INT64", "index": 2, "name": "number_issues_opened", "comment": null}, "number_issues_closed": {"type": "INT64", "index": 3, "name": "number_issues_closed", "comment": null}, "sum_days_issue_open": {"type": "FLOAT64", "index": 4, "name": "sum_days_issue_open", "comment": null}, "longest_days_issue_open": {"type": "FLOAT64", "index": 5, "name": "longest_days_issue_open", "comment": null}, "number_prs_opened": {"type": "INT64", "index": 6, "name": "number_prs_opened", "comment": null}, "number_prs_merged": {"type": "INT64", "index": 7, "name": "number_prs_merged", "comment": null}, "number_prs_closed_without_merge": {"type": "INT64", "index": 8, "name": "number_prs_closed_without_merge", "comment": null}, "sum_days_pr_open": {"type": "FLOAT64", "index": 9, "name": "sum_days_pr_open", "comment": null}, "longest_days_pr_open": {"type": "FLOAT64", "index": 10, "name": "longest_days_pr_open", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 305.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 17552.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__daily_metrics"}, "seed.github_integration_tests.github_user_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_user_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "bio": {"type": "STRING", "index": 3, "name": "bio", "comment": null}, "blog": {"type": "STRING", "index": 4, "name": "blog", "comment": null}, "company": {"type": "STRING", "index": 5, "name": "company", "comment": null}, "created_at": {"type": "DATETIME", "index": 6, "name": "created_at", "comment": null}, "hireable": {"type": "BOOL", "index": 7, "name": "hireable", "comment": null}, "location": {"type": "STRING", "index": 8, "name": "location", "comment": null}, "login": {"type": "STRING", "index": 9, "name": "login", "comment": null}, "name": {"type": "STRING", "index": 10, "name": "name", "comment": null}, "site_admin": {"type": "BOOL", "index": 11, "name": "site_admin", "comment": null}, "type": {"type": "STRING", "index": 12, "name": "type", "comment": null}, "updated_at": {"type": "DATETIME", "index": 13, "name": "updated_at", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 17.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 7405.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_user_data"}, "model.github_source.stg_github__issue_assignee": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__issue_assignee", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "user_id": {"type": "INT64", "index": 2, "name": "user_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 200.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 3200.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_assignee"}, "model.github_source.stg_github__requested_reviewer_history_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__requested_reviewer_history_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"created_at": {"type": "TIMESTAMP", "index": 1, "name": "created_at", "comment": null}, "pull_request_id": {"type": "INT64", "index": 2, "name": "pull_request_id", "comment": null}, "requested_id": {"type": "INT64", "index": 3, "name": "requested_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 5, "name": "actor_id", "comment": null}, "removed": {"type": "BOOL", "index": 6, "name": "removed", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__requested_reviewer_history_tmp"}, "model.github_source.stg_github__repo_team": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__repo_team", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"repository_id": {"type": "INT64", "index": 1, "name": "repository_id", "comment": null}, "team_id": {"type": "INT64", "index": 2, "name": "team_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 8.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 128.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__repo_team"}, "model.github_source.stg_github__issue_merged": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__issue_merged", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "merged_at": {"type": "TIMESTAMP", "index": 2, "name": "merged_at", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 110.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1760.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_merged"}}, "sources": {}, "errors": null} \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 0c4d0ec..182b6b4 100644 --- a/docs/index.html +++ b/docs/index.html @@ -24,7 +24,7 @@
icons
- diff --git a/docs/manifest.json b/docs/manifest.json index cb53a54..082f062 100644 --- a/docs/manifest.json +++ b/docs/manifest.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v4.json", "dbt_version": "1.0.1", "generated_at": "2022-02-11T20:32:54.856770Z", "invocation_id": "76e00bc7-8790-4a70-8f9d-f2cff33a6c7c", "env": {}, "project_id": "759b74ce43947f5f4c91aeddc3e5bad3", "user_id": "57178664-37b2-4047-9572-68ec8b488cd7", "send_anonymous_usage_stats": true, "adapter_type": "bigquery"}, "nodes": {"model.github.github__weekly_metrics": {"raw_sql": "with daily_metrics as (\n select *\n from {{ ref('github__daily_metrics') }}\n)\n\nselect \n {{ dbt_utils.date_trunc('week', 'day') }} as week, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.date_trunc"], "nodes": ["model.github.github__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github", "github__weekly_metrics"], "unique_id": "model.github.github__weekly_metrics", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github", "path": "github__weekly_metrics.sql", "original_file_path": "models/github__weekly_metrics.sql", "name": "github__weekly_metrics", "alias": "github__weekly_metrics", "checksum": {"name": "sha256", "checksum": "27f7200fb353429bc01143ad0d0acdeab3e2941cfc735b0ab5eeeca61e4d2e96"}, "tags": [], "refs": [["github__daily_metrics"]], "sources": [], "description": "Summary numbers for issues and pull requests by week\n", "columns": {"week": {"name": "week", "description": "The reporting week", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_opened": {"name": "number_issues_opened", "description": "The total number of issues created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_closed": {"name": "number_issues_closed", "description": "The total number of issues closed during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_issue_open": {"name": "avg_days_issue_open", "description": "The average number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_issue_open": {"name": "longest_days_issue_open", "description": "The longest number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_opened": {"name": "number_prs_opened", "description": "The total number of pull requests created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_merged": {"name": "number_prs_merged", "description": "The total number of pull requests merged during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_closed_without_merge": {"name": "number_prs_closed_without_merge", "description": "The total number of pull requests closed without a merge during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_pr_open": {"name": "avg_days_pr_open", "description": "The average number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_pr_open": {"name": "longest_days_pr_open", "description": "The longest number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__weekly_metrics.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "github"}, "created_at": 1644611543.088029, "compiled_sql": "with daily_metrics as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`github__daily_metrics`\n)\n\nselect \n \n timestamp_trunc(\n cast(day as timestamp),\n week\n )\n\n as week, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery-proj`.`dbt_joe_github`.`github__weekly_metrics`"}, "model.github.github__monthly_metrics": {"raw_sql": "with daily_metrics as (\n select *\n from {{ ref('github__daily_metrics') }}\n)\n\nselect \n {{ dbt_utils.date_trunc('month', 'day') }} as month, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.date_trunc"], "nodes": ["model.github.github__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github", "github__monthly_metrics"], "unique_id": "model.github.github__monthly_metrics", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github", "path": "github__monthly_metrics.sql", "original_file_path": "models/github__monthly_metrics.sql", "name": "github__monthly_metrics", "alias": "github__monthly_metrics", "checksum": {"name": "sha256", "checksum": "d72441a23dfbe9639dc0b6c27461f51a7ad7c8b1ba47e4c6607c8084c34cb302"}, "tags": [], "refs": [["github__daily_metrics"]], "sources": [], "description": "Summary numbers for issues and pull requests by month\n", "columns": {"month": {"name": "month", "description": "The reporting month", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_opened": {"name": "number_issues_opened", "description": "The total number of issues created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_closed": {"name": "number_issues_closed", "description": "The total number of issues closed during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_issue_open": {"name": "avg_days_issue_open", "description": "The average number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_issue_open": {"name": "longest_days_issue_open", "description": "The longest number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_opened": {"name": "number_prs_opened", "description": "The total number of pull requests created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_merged": {"name": "number_prs_merged", "description": "The total number of pull requests merged during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_closed_without_merge": {"name": "number_prs_closed_without_merge", "description": "The total number of pull requests closed without a merge during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_pr_open": {"name": "avg_days_pr_open", "description": "The average number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_pr_open": {"name": "longest_days_pr_open", "description": "The longest number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__monthly_metrics.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "github"}, "created_at": 1644611543.0928042, "compiled_sql": "with daily_metrics as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`github__daily_metrics`\n)\n\nselect \n \n timestamp_trunc(\n cast(day as timestamp),\n month\n )\n\n as month, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery-proj`.`dbt_joe_github`.`github__monthly_metrics`"}, "model.github.github__quarterly_metrics": {"raw_sql": "with daily_metrics as (\n select *\n from {{ ref('github__daily_metrics') }}\n)\n\nselect \n {{ dbt_utils.date_trunc('quarter', 'day') }} as quarter, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\n\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.date_trunc"], "nodes": ["model.github.github__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github", "github__quarterly_metrics"], "unique_id": "model.github.github__quarterly_metrics", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github", "path": "github__quarterly_metrics.sql", "original_file_path": "models/github__quarterly_metrics.sql", "name": "github__quarterly_metrics", "alias": "github__quarterly_metrics", "checksum": {"name": "sha256", "checksum": "5edece979ea8c683858022ab9cc666af55972015456ba4047d9e8476c523b0c1"}, "tags": [], "refs": [["github__daily_metrics"]], "sources": [], "description": "Summary numbers for issues and pull requests by quarter\n", "columns": {"quarter": {"name": "quarter", "description": "The reporting quarter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_opened": {"name": "number_issues_opened", "description": "The total number of issues created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_closed": {"name": "number_issues_closed", "description": "The total number of issues closed during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_issue_open": {"name": "avg_days_issue_open", "description": "The average number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_issue_open": {"name": "longest_days_issue_open", "description": "The longest number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_opened": {"name": "number_prs_opened", "description": "The total number of pull requests created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_merged": {"name": "number_prs_merged", "description": "The total number of pull requests merged during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_closed_without_merge": {"name": "number_prs_closed_without_merge", "description": "The total number of pull requests closed without a merge during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_pr_open": {"name": "avg_days_pr_open", "description": "The average number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_pr_open": {"name": "longest_days_pr_open", "description": "The longest number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__quarterly_metrics.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "github"}, "created_at": 1644611543.0976698, "compiled_sql": "with daily_metrics as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`github__daily_metrics`\n)\n\nselect \n \n timestamp_trunc(\n cast(day as timestamp),\n quarter\n )\n\n as quarter, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\n\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery-proj`.`dbt_joe_github`.`github__quarterly_metrics`"}, "model.github.github__pull_requests": {"raw_sql": "with issue_joined as (\n select *\n from {{ ref('int_github__issue_joined') }} \n)\n\nselect\n *\nfrom issue_joined\nwhere is_pull_request", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.github.int_github__issue_joined"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github", "github__pull_requests"], "unique_id": "model.github.github__pull_requests", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github", "path": "github__pull_requests.sql", "original_file_path": "models/github__pull_requests.sql", "name": "github__pull_requests", "alias": "github__pull_requests", "checksum": {"name": "sha256", "checksum": "ab4761ae05c0aabc7585d92ed7c68e12b53317a47a4278810e1777a051f43350"}, "tags": [], "refs": [["int_github__issue_joined"]], "sources": [], "description": "Basic information about pull_requests as well as additional fields about reviews and time between actions\n", "columns": {"issue_id": {"name": "issue_id", "description": "The unique ID of an issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "body": {"name": "body", "description": "the text body of the description of the pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed_at": {"name": "closed_at", "description": "Timestamp of when the pull request was closed. NULL for pull requests that are still open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the pull request was created", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_locked": {"name": "is_locked", "description": "Boolean indicating whether the issue is locked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "milestone_id": {"name": "milestone_id", "description": "Foreign key that references the milestone.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_pull_request": {"name": "is_pull_request", "description": "Boolean indiciating whether the issue is a pull request.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_number": {"name": "issue_number", "description": "The number of the pull request. Unique within a repository, but not accross.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_id": {"name": "repository_id", "description": "Foreign key that references the repository table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the issue was last updated", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "days_issue_open": {"name": "days_issue_open", "description": "The number of days an issue has been open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_times_reopened": {"name": "number_of_times_reopened", "description": "Total number of times the issue was reopened", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_comments": {"name": "number_of_comments", "description": "The total number of comments included in the issue", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_login_name": {"name": "creator_login_name", "description": "User that created the issue login name", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_name": {"name": "creator_name", "description": "User that created the issue name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_company": {"name": "creator_company", "description": "User that created the issue company name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the pull request is open or closed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url_link": {"name": "url_link", "description": "A link to the pull request on github.com", "meta": {}, "data_type": null, "quote": null, "tags": []}, "labels": {"name": "labels", "description": "The labels currently applied to the pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository": {"name": "repository", "description": "The repository that the pull request applies to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_team_names": {"name": "repository_team_names", "description": "An aggreate of the teams associated with the repository", "meta": {}, "data_type": null, "quote": null, "tags": []}, "assignees": {"name": "assignees", "description": "Users who have been assigned to the pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hours_request_review_to_first_review": {"name": "hours_request_review_to_first_review", "description": "Number of hours between the first request for review and a review", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hours_request_review_to_first_action": {"name": "hours_request_review_to_first_action", "description": "Number of hours between the first request for review and any action besides dismissing the request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hours_request_review_to_merge": {"name": "hours_request_review_to_merge", "description": "Number of hours between the first request for review and the pull request being merged", "meta": {}, "data_type": null, "quote": null, "tags": []}, "merged_at": {"name": "merged_at", "description": "Timestamp of when the pull request was merged", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reviewers": {"name": "reviewers", "description": "List of Users who reviewed the pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_reviews": {"name": "number_of_reviews", "description": "Number of times a pull request was reviewed", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__pull_requests.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "github"}, "created_at": 1644611543.075528, "compiled_sql": "with __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n), __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n), __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n), __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n), __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), \n current_timestamp\n) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n), __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n), __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, \n current_timestamp\n) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n/ 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, \n current_timestamp\n),\n coalesce(issue.closed_at, \n current_timestamp\n)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n/ 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n), __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n), __dbt__cte__int_github__issue_joined as (\nwith issue as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue`\n), \n\nissue_labels as (\n select *\n from __dbt__cte__int_github__issue_labels\n), \n\nrepository_teams as (\n select \n \n *\n from __dbt__cte__int_github__repository_teams\n\n \n), \n\nissue_assignees as (\n select *\n from __dbt__cte__int_github__issue_assignees\n), \n\nissue_open_length as (\n select *\n from __dbt__cte__int_github__issue_open_length\n), \n\nissue_comments as (\n select *\n from __dbt__cte__int_github__issue_comments\n), \n\ncreator as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__user`\n), \n\npull_request_times as (\n select *\n from __dbt__cte__int_github__pull_request_times\n), \n\npull_request_reviewers as (\n select *\n from __dbt__cte__int_github__pull_request_reviewers\n), \n\npull_request as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__pull_request`\n)\n\nselect\n issue.*,\n 'https://github.com/' || repository_teams.repository || '/pull/' || issue.issue_number as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n \n repository_teams.repository_team_names,\n \n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id\n),issue_joined as (\n select *\n from __dbt__cte__int_github__issue_joined \n)\n\nselect\n *\nfrom issue_joined\nwhere is_pull_request", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.github.int_github__issue_label_joined", "sql": " __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n)"}, {"id": "model.github.int_github__issue_labels", "sql": " __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n)"}, {"id": "model.github.int_github__repository_teams", "sql": " __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n)"}, {"id": "model.github.int_github__issue_assignees", "sql": " __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n)"}, {"id": "model.github.int_github__issue_open_length", "sql": " __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), \n current_timestamp\n) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n)"}, {"id": "model.github.int_github__issue_comments", "sql": " __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n)"}, {"id": "model.github.int_github__pull_request_times", "sql": " __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, \n current_timestamp\n) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n/ 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, \n current_timestamp\n),\n coalesce(issue.closed_at, \n current_timestamp\n)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n/ 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n)"}, {"id": "model.github.int_github__pull_request_reviewers", "sql": " __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n)"}, {"id": "model.github.int_github__issue_joined", "sql": " __dbt__cte__int_github__issue_joined as (\nwith issue as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue`\n), \n\nissue_labels as (\n select *\n from __dbt__cte__int_github__issue_labels\n), \n\nrepository_teams as (\n select \n \n *\n from __dbt__cte__int_github__repository_teams\n\n \n), \n\nissue_assignees as (\n select *\n from __dbt__cte__int_github__issue_assignees\n), \n\nissue_open_length as (\n select *\n from __dbt__cte__int_github__issue_open_length\n), \n\nissue_comments as (\n select *\n from __dbt__cte__int_github__issue_comments\n), \n\ncreator as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__user`\n), \n\npull_request_times as (\n select *\n from __dbt__cte__int_github__pull_request_times\n), \n\npull_request_reviewers as (\n select *\n from __dbt__cte__int_github__pull_request_reviewers\n), \n\npull_request as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__pull_request`\n)\n\nselect\n issue.*,\n 'https://github.com/' || repository_teams.repository || '/pull/' || issue.issue_number as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n \n repository_teams.repository_team_names,\n \n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id\n)"}], "relation_name": "`bigquery-proj`.`dbt_joe_github`.`github__pull_requests`"}, "model.github.github__daily_metrics": {"raw_sql": "with github_issues as (\n select *\n from {{ ref('github__issues') }}\n), \n\npull_requests as (\n select *\n from {{ ref('github__pull_requests') }}\n), \n\nissues_opened_per_day as (\n select \n {{ dbt_utils.date_trunc('day', 'created_at') }} as day, \n count(*) as number_issues_opened,\n sum(days_issue_open) as sum_days_issue_open,\n max(days_issue_open) as longest_days_issue_open\n from github_issues\n group by 1\n), \n\nissues_closed_per_day as (\n select \n {{ dbt_utils.date_trunc('day', 'closed_at') }} as day, \n count(*) as number_issues_closed\n from github_issues\n where closed_at is not null\n group by 1\n), \n\nprs_opened_per_day as (\n select \n {{ dbt_utils.date_trunc('day', 'created_at') }} as day, \n count(*) as number_prs_opened,\n sum(days_issue_open) as sum_days_pr_open,\n max(days_issue_open) as longest_days_pr_open\n from pull_requests\n group by 1\n), \n\nprs_merged_per_day as (\n select \n {{ dbt_utils.date_trunc('day', 'merged_at') }} as day, \n count(*) as number_prs_merged\n from pull_requests\n where merged_at is not null\n group by 1\n), \n\nprs_closed_without_merge_per_day as (\n select \n {{ dbt_utils.date_trunc('day', 'closed_at') }} as day, \n count(*) as number_prs_closed_without_merge\n from pull_requests\n where closed_at is not null\n and merged_at is null\n group by 1\n), \n\nissues_per_day as (\n select \n coalesce(issues_opened_per_day.day, \n issues_closed_per_day.day\n ) as day,\n number_issues_opened,\n number_issues_closed, \n sum_days_issue_open,\n longest_days_issue_open\n from issues_opened_per_day\n full outer join issues_closed_per_day on issues_opened_per_day.day = issues_closed_per_day.day\n), \n\nprs_per_day as (\n select \n coalesce(prs_opened_per_day.day, \n prs_merged_per_day.day,\n prs_closed_without_merge_per_day.day\n ) as day,\n number_prs_opened,\n number_prs_merged,\n number_prs_closed_without_merge,\n sum_days_pr_open,\n longest_days_pr_open\n from prs_opened_per_day\n full outer join prs_merged_per_day on prs_opened_per_day.day = prs_merged_per_day.day\n full outer join prs_closed_without_merge_per_day on coalesce(prs_opened_per_day.day, prs_merged_per_day.day) = prs_closed_without_merge_per_day.day\n)\n\nselect \n coalesce(issues_per_day.day, prs_per_day.day) as day,\n coalesce(number_issues_opened, 0) as number_issues_opened,\n coalesce(number_issues_closed, 0) as number_issues_closed,\n sum_days_issue_open,\n longest_days_issue_open,\n coalesce(number_prs_opened, 0) as number_prs_opened,\n coalesce(number_prs_merged, 0) as number_prs_merged,\n coalesce(number_prs_closed_without_merge, 0) as number_prs_closed_without_merge,\n sum_days_pr_open,\n longest_days_pr_open\nfrom issues_per_day \nfull outer join prs_per_day on issues_per_day.day = prs_per_day.day\norder by day desc", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.date_trunc"], "nodes": ["model.github.github__issues", "model.github.github__pull_requests"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github", "github__daily_metrics"], "unique_id": "model.github.github__daily_metrics", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github", "path": "github__daily_metrics.sql", "original_file_path": "models/github__daily_metrics.sql", "name": "github__daily_metrics", "alias": "github__daily_metrics", "checksum": {"name": "sha256", "checksum": "b7ad58c3a2480c6343553529381cc6ebe6a6c57aea0ffbed079d2c83626a5f7b"}, "tags": [], "refs": [["github__issues"], ["github__pull_requests"]], "sources": [], "description": "Summary numbers for issues and pull requests by day\n", "columns": {"day": {"name": "day", "description": "The reporting day", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_opened": {"name": "number_issues_opened", "description": "The total number of issues created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_closed": {"name": "number_issues_closed", "description": "The total number of issues closed during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sum_days_issue_open": {"name": "sum_days_issue_open", "description": "The total number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_issue_open": {"name": "longest_days_issue_open", "description": "The longest number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_opened": {"name": "number_prs_opened", "description": "The total number of pull requests created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_merged": {"name": "number_prs_merged", "description": "The total number of pull requests merged during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_closed_without_merge": {"name": "number_prs_closed_without_merge", "description": "The total number of pull requests closed without a merge during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sum_days_pr_open": {"name": "sum_days_pr_open", "description": "The total number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_pr_open": {"name": "longest_days_pr_open", "description": "The longest number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__daily_metrics.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "github"}, "created_at": 1644611543.082088, "compiled_sql": "with github_issues as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`github__issues`\n), \n\npull_requests as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`github__pull_requests`\n), \n\nissues_opened_per_day as (\n select \n \n timestamp_trunc(\n cast(created_at as timestamp),\n day\n )\n\n as day, \n count(*) as number_issues_opened,\n sum(days_issue_open) as sum_days_issue_open,\n max(days_issue_open) as longest_days_issue_open\n from github_issues\n group by 1\n), \n\nissues_closed_per_day as (\n select \n \n timestamp_trunc(\n cast(closed_at as timestamp),\n day\n )\n\n as day, \n count(*) as number_issues_closed\n from github_issues\n where closed_at is not null\n group by 1\n), \n\nprs_opened_per_day as (\n select \n \n timestamp_trunc(\n cast(created_at as timestamp),\n day\n )\n\n as day, \n count(*) as number_prs_opened,\n sum(days_issue_open) as sum_days_pr_open,\n max(days_issue_open) as longest_days_pr_open\n from pull_requests\n group by 1\n), \n\nprs_merged_per_day as (\n select \n \n timestamp_trunc(\n cast(merged_at as timestamp),\n day\n )\n\n as day, \n count(*) as number_prs_merged\n from pull_requests\n where merged_at is not null\n group by 1\n), \n\nprs_closed_without_merge_per_day as (\n select \n \n timestamp_trunc(\n cast(closed_at as timestamp),\n day\n )\n\n as day, \n count(*) as number_prs_closed_without_merge\n from pull_requests\n where closed_at is not null\n and merged_at is null\n group by 1\n), \n\nissues_per_day as (\n select \n coalesce(issues_opened_per_day.day, \n issues_closed_per_day.day\n ) as day,\n number_issues_opened,\n number_issues_closed, \n sum_days_issue_open,\n longest_days_issue_open\n from issues_opened_per_day\n full outer join issues_closed_per_day on issues_opened_per_day.day = issues_closed_per_day.day\n), \n\nprs_per_day as (\n select \n coalesce(prs_opened_per_day.day, \n prs_merged_per_day.day,\n prs_closed_without_merge_per_day.day\n ) as day,\n number_prs_opened,\n number_prs_merged,\n number_prs_closed_without_merge,\n sum_days_pr_open,\n longest_days_pr_open\n from prs_opened_per_day\n full outer join prs_merged_per_day on prs_opened_per_day.day = prs_merged_per_day.day\n full outer join prs_closed_without_merge_per_day on coalesce(prs_opened_per_day.day, prs_merged_per_day.day) = prs_closed_without_merge_per_day.day\n)\n\nselect \n coalesce(issues_per_day.day, prs_per_day.day) as day,\n coalesce(number_issues_opened, 0) as number_issues_opened,\n coalesce(number_issues_closed, 0) as number_issues_closed,\n sum_days_issue_open,\n longest_days_issue_open,\n coalesce(number_prs_opened, 0) as number_prs_opened,\n coalesce(number_prs_merged, 0) as number_prs_merged,\n coalesce(number_prs_closed_without_merge, 0) as number_prs_closed_without_merge,\n sum_days_pr_open,\n longest_days_pr_open\nfrom issues_per_day \nfull outer join prs_per_day on issues_per_day.day = prs_per_day.day\norder by day desc", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery-proj`.`dbt_joe_github`.`github__daily_metrics`"}, "model.github.github__issues": {"raw_sql": "with issue_joined as (\n select *\n from {{ ref('int_github__issue_joined') }} \n)\n\nselect\n issue_id,\n body,\n closed_at,\n created_at,\n is_locked,\n milestone_id,\n issue_number,\n is_pull_request,\n repository_id,\n state,\n title,\n updated_at,\n user_id,\n url_link,\n days_issue_open,\n number_of_times_reopened,\n labels,\n number_of_comments,\n repository,\n {% if var('github__using_repo_team', true) %}\n repository_team_names,\n {% endif %}\n assignees,\n creator_login_name,\n creator_name,\n creator_company\nfrom issue_joined\nwhere not is_pull_request", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.github.int_github__issue_joined"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github", "github__issues"], "unique_id": "model.github.github__issues", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github", "path": "github__issues.sql", "original_file_path": "models/github__issues.sql", "name": "github__issues", "alias": "github__issues", "checksum": {"name": "sha256", "checksum": "382d94f82ea63be958d53cc7353d6e3e792844f45ab9c48609e03355eb68a133"}, "tags": [], "refs": [["int_github__issue_joined"]], "sources": [], "description": "Basic information about issues as well as additional fields for things like assignees, projects, labels and open time\n", "columns": {"issue_id": {"name": "issue_id", "description": "The unique ID of an issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "body": {"name": "body", "description": "The text body of the issue's main description", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed_at": {"name": "closed_at", "description": "The timestamp for when an issue was last closed. \"null\" for issues that are open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The timestamp for when an issue was created", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_locked": {"name": "is_locked", "description": "Boolean indicating if the issue is locked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "milestone_id": {"name": "milestone_id", "description": "Foreign key that references the milestone table representing the current milestone the issue is in", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_number": {"name": "issue_number", "description": "The number of the issue. Is unique within a repository, but not accross", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_pull_request": {"name": "is_pull_request", "description": "Boolean indicating whether the issue is a pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_id": {"name": "repository_id", "description": "Foreign key that references the repository table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the issue is open or closed", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the issue", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the issue was last updated", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url_link": {"name": "url_link", "description": "a link to the issue on github.com", "meta": {}, "data_type": null, "quote": null, "tags": []}, "days_issue_open": {"name": "days_issue_open", "description": "The number of days an issue has been open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_times_reopened": {"name": "number_of_times_reopened", "description": "Total number of times the issue was reopened", "meta": {}, "data_type": null, "quote": null, "tags": []}, "labels": {"name": "labels", "description": "A list of the labels that are currently applied to the issue", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_comments": {"name": "number_of_comments", "description": "The total number of comments included in the issue", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_login_name": {"name": "creator_login_name", "description": "User that created the issue login name", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_name": {"name": "creator_name", "description": "User that created the issue name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_company": {"name": "creator_company", "description": "User that created the issue company name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository": {"name": "repository", "description": "The repository that the issue is applicable to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_team_names": {"name": "repository_team_names", "description": "An aggreate of the teams associated with the repository", "meta": {}, "data_type": null, "quote": null, "tags": []}, "assignees": {"name": "assignees", "description": "The current list of users assigned to the issue", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__issues.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "github"}, "created_at": 1644611543.0622, "compiled_sql": "with __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n), __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n), __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n), __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n), __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), \n current_timestamp\n) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n), __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n), __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, \n current_timestamp\n) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n/ 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, \n current_timestamp\n),\n coalesce(issue.closed_at, \n current_timestamp\n)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n/ 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n), __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n), __dbt__cte__int_github__issue_joined as (\nwith issue as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue`\n), \n\nissue_labels as (\n select *\n from __dbt__cte__int_github__issue_labels\n), \n\nrepository_teams as (\n select \n \n *\n from __dbt__cte__int_github__repository_teams\n\n \n), \n\nissue_assignees as (\n select *\n from __dbt__cte__int_github__issue_assignees\n), \n\nissue_open_length as (\n select *\n from __dbt__cte__int_github__issue_open_length\n), \n\nissue_comments as (\n select *\n from __dbt__cte__int_github__issue_comments\n), \n\ncreator as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__user`\n), \n\npull_request_times as (\n select *\n from __dbt__cte__int_github__pull_request_times\n), \n\npull_request_reviewers as (\n select *\n from __dbt__cte__int_github__pull_request_reviewers\n), \n\npull_request as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__pull_request`\n)\n\nselect\n issue.*,\n 'https://github.com/' || repository_teams.repository || '/pull/' || issue.issue_number as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n \n repository_teams.repository_team_names,\n \n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id\n),issue_joined as (\n select *\n from __dbt__cte__int_github__issue_joined \n)\n\nselect\n issue_id,\n body,\n closed_at,\n created_at,\n is_locked,\n milestone_id,\n issue_number,\n is_pull_request,\n repository_id,\n state,\n title,\n updated_at,\n user_id,\n url_link,\n days_issue_open,\n number_of_times_reopened,\n labels,\n number_of_comments,\n repository,\n \n repository_team_names,\n \n assignees,\n creator_login_name,\n creator_name,\n creator_company\nfrom issue_joined\nwhere not is_pull_request", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.github.int_github__issue_label_joined", "sql": " __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n)"}, {"id": "model.github.int_github__issue_labels", "sql": " __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n)"}, {"id": "model.github.int_github__repository_teams", "sql": " __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n)"}, {"id": "model.github.int_github__issue_assignees", "sql": " __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n)"}, {"id": "model.github.int_github__issue_open_length", "sql": " __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), \n current_timestamp\n) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n)"}, {"id": "model.github.int_github__issue_comments", "sql": " __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n)"}, {"id": "model.github.int_github__pull_request_times", "sql": " __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, \n current_timestamp\n) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n/ 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, \n current_timestamp\n),\n coalesce(issue.closed_at, \n current_timestamp\n)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n/ 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n)"}, {"id": "model.github.int_github__pull_request_reviewers", "sql": " __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n)"}, {"id": "model.github.int_github__issue_joined", "sql": " __dbt__cte__int_github__issue_joined as (\nwith issue as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue`\n), \n\nissue_labels as (\n select *\n from __dbt__cte__int_github__issue_labels\n), \n\nrepository_teams as (\n select \n \n *\n from __dbt__cte__int_github__repository_teams\n\n \n), \n\nissue_assignees as (\n select *\n from __dbt__cte__int_github__issue_assignees\n), \n\nissue_open_length as (\n select *\n from __dbt__cte__int_github__issue_open_length\n), \n\nissue_comments as (\n select *\n from __dbt__cte__int_github__issue_comments\n), \n\ncreator as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__user`\n), \n\npull_request_times as (\n select *\n from __dbt__cte__int_github__pull_request_times\n), \n\npull_request_reviewers as (\n select *\n from __dbt__cte__int_github__pull_request_reviewers\n), \n\npull_request as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__pull_request`\n)\n\nselect\n issue.*,\n 'https://github.com/' || repository_teams.repository || '/pull/' || issue.issue_number as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n \n repository_teams.repository_team_names,\n \n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id\n)"}], "relation_name": "`bigquery-proj`.`dbt_joe_github`.`github__issues`"}, "model.github.int_github__pull_request_times": {"raw_sql": "with pull_request_review as (\n select *\n from {{ var('pull_request_review') }}\n), \n\npull_request as (\n select *\n from {{ var('pull_request')}}\n), \n\nrequested_reviewer_history as (\n select *\n from {{ var('requested_reviewer_history')}}\n where not removed\n), \n\nissue as (\n select *\n from {{ var('issue') }}\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from {{ var('issue_merged')}}\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n {{ dbt_utils.datediff(\n 'time_of_first_request', \n \"coalesce(time_of_first_review_post_request, \" ~ dbt_utils.current_timestamp() ~ \")\", \n 'second') \n }}/ 60/60 as hours_request_review_to_first_review,\n {{ dbt_utils.datediff(\n 'time_of_first_request', \n \"least(\n coalesce(time_of_first_requested_reviewer_review, \" ~ dbt_utils.current_timestamp() ~ \"),\n coalesce(issue.closed_at, \" ~ dbt_utils.current_timestamp() ~ \"))\", \n 'second') \n }} / 60/60 as hours_request_review_to_first_action,\n {{ dbt_utils.datediff('time_of_first_request', 'merged_at', 'second') }}/ 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.current_timestamp", "macro.dbt_utils.datediff"], "nodes": ["model.github_source.stg_github__pull_request_review", "model.github_source.stg_github__pull_request", "model.github_source.stg_github__requested_reviewer_history", "model.github_source.stg_github__issue", "model.github_source.stg_github__issue_merged"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github", "intermediate", "int_github__pull_request_times"], "unique_id": "model.github.int_github__pull_request_times", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github", "path": "intermediate/int_github__pull_request_times.sql", "original_file_path": "models/intermediate/int_github__pull_request_times.sql", "name": "int_github__pull_request_times", "alias": "int_github__pull_request_times", "checksum": {"name": "sha256", "checksum": "de10f1162b5f6d2b33b9f2207cdd7b2eba62d2ba6869118ad5f265f6f9acf70c"}, "tags": [], "refs": [["stg_github__pull_request_review"], ["stg_github__pull_request"], ["stg_github__requested_reviewer_history"], ["stg_github__issue"], ["stg_github__issue_merged"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__pull_request_times.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "github"}, "created_at": 1644611542.611027, "compiled_sql": "with pull_request_review as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, \n current_timestamp\n) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n/ 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, \n current_timestamp\n),\n coalesce(issue.closed_at, \n current_timestamp\n)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n/ 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__pull_request_reviewers": {"raw_sql": "with pull_request_review as (\n select *\n from {{ var('pull_request_review') }}\n), \n\ngithub_user as (\n select *\n from {{ var('user')}}\n)\n\nselect\n pull_request_review.pull_request_id,\n {{ fivetran_utils.string_agg( 'github_user.login_name', \"', '\" )}} as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.github_source.stg_github__pull_request_review", "model.github_source.stg_github__user"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github", "intermediate", "int_github__pull_request_reviewers"], "unique_id": "model.github.int_github__pull_request_reviewers", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github", "path": "intermediate/int_github__pull_request_reviewers.sql", "original_file_path": "models/intermediate/int_github__pull_request_reviewers.sql", "name": "int_github__pull_request_reviewers", "alias": "int_github__pull_request_reviewers", "checksum": {"name": "sha256", "checksum": "fd5518273ce75ae9066be686308ee078ce9a3df73f3799620f8eb6e611655cd7"}, "tags": [], "refs": [["stg_github__pull_request_review"], ["stg_github__user"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__pull_request_reviewers.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "github"}, "created_at": 1644611542.6301582, "compiled_sql": "with pull_request_review as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__issue_label_joined": {"raw_sql": "with issue_label as (\n\n select *\n from {{ var('issue_label') }}\n\n), label as (\n\n select *\n from {{ var('label') }}\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.github_source.stg_github__issue_label", "model.github_source.stg_github__label"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github", "intermediate", "int_github__issue_label_joined"], "unique_id": "model.github.int_github__issue_label_joined", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github", "path": "intermediate/int_github__issue_label_joined.sql", "original_file_path": "models/intermediate/int_github__issue_label_joined.sql", "name": "int_github__issue_label_joined", "alias": "int_github__issue_label_joined", "checksum": {"name": "sha256", "checksum": "6f1b225ff9958e67fae4ea1ba0be10ebb9426da364c758c37d0b83305d575d98"}, "tags": [], "refs": [["stg_github__issue_label"], ["stg_github__label"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_label_joined.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "github"}, "created_at": 1644611542.64064, "compiled_sql": "with issue_label as (\n\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__issue_joined": {"raw_sql": "with issue as (\n select *\n from {{ var('issue') }}\n), \n\nissue_labels as (\n select *\n from {{ ref('int_github__issue_labels')}}\n), \n\nrepository_teams as (\n select \n {% if var('github__using_repo_team', true) %}\n *\n from {{ ref('int_github__repository_teams') }}\n\n {% else %}\n repository_id,\n full_name as repository\n from {{ var('repository') }}\n\n {% endif %}\n), \n\nissue_assignees as (\n select *\n from {{ ref('int_github__issue_assignees')}}\n), \n\nissue_open_length as (\n select *\n from {{ ref('int_github__issue_open_length')}}\n), \n\nissue_comments as (\n select *\n from {{ ref('int_github__issue_comments')}}\n), \n\ncreator as (\n select *\n from {{ var('user')}}\n), \n\npull_request_times as (\n select *\n from {{ ref('int_github__pull_request_times')}}\n), \n\npull_request_reviewers as (\n select *\n from {{ ref('int_github__pull_request_reviewers')}}\n), \n\npull_request as (\n select *\n from {{ var('pull_request')}}\n)\n\nselect\n issue.*,\n {{ dbt_utils.concat([\"'https://github.com/'\",'repository_teams.repository',\"'/pull/'\", 'issue.issue_number']) }} as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n {% if var('github__using_repo_team', true) %}\n repository_teams.repository_team_names,\n {% endif %}\n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.concat"], "nodes": ["model.github_source.stg_github__issue", "model.github.int_github__issue_labels", "model.github.int_github__repository_teams", "model.github.int_github__issue_assignees", "model.github.int_github__issue_open_length", "model.github.int_github__issue_comments", "model.github_source.stg_github__user", "model.github.int_github__pull_request_times", "model.github.int_github__pull_request_reviewers", "model.github_source.stg_github__pull_request"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github", "intermediate", "int_github__issue_joined"], "unique_id": "model.github.int_github__issue_joined", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github", "path": "intermediate/int_github__issue_joined.sql", "original_file_path": "models/intermediate/int_github__issue_joined.sql", "name": "int_github__issue_joined", "alias": "int_github__issue_joined", "checksum": {"name": "sha256", "checksum": "820f08356e8d112f0a4d335d71cc829218ea4a26882acf117ac97a4d90d614f9"}, "tags": [], "refs": [["stg_github__issue"], ["int_github__issue_labels"], ["int_github__repository_teams"], ["int_github__issue_assignees"], ["int_github__issue_open_length"], ["int_github__issue_comments"], ["stg_github__user"], ["int_github__pull_request_times"], ["int_github__pull_request_reviewers"], ["stg_github__pull_request"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_joined.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "github"}, "created_at": 1644611542.647637, "compiled_sql": "with __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n), __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n), __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n), __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n), __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), \n current_timestamp\n) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n), __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n), __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, \n current_timestamp\n) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n/ 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, \n current_timestamp\n),\n coalesce(issue.closed_at, \n current_timestamp\n)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n/ 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n), __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n),issue as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue`\n), \n\nissue_labels as (\n select *\n from __dbt__cte__int_github__issue_labels\n), \n\nrepository_teams as (\n select \n \n *\n from __dbt__cte__int_github__repository_teams\n\n \n), \n\nissue_assignees as (\n select *\n from __dbt__cte__int_github__issue_assignees\n), \n\nissue_open_length as (\n select *\n from __dbt__cte__int_github__issue_open_length\n), \n\nissue_comments as (\n select *\n from __dbt__cte__int_github__issue_comments\n), \n\ncreator as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__user`\n), \n\npull_request_times as (\n select *\n from __dbt__cte__int_github__pull_request_times\n), \n\npull_request_reviewers as (\n select *\n from __dbt__cte__int_github__pull_request_reviewers\n), \n\npull_request as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__pull_request`\n)\n\nselect\n issue.*,\n 'https://github.com/' || repository_teams.repository || '/pull/' || issue.issue_number as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n \n repository_teams.repository_team_names,\n \n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.github.int_github__issue_label_joined", "sql": " __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n)"}, {"id": "model.github.int_github__issue_labels", "sql": " __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n)"}, {"id": "model.github.int_github__repository_teams", "sql": " __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n)"}, {"id": "model.github.int_github__issue_assignees", "sql": " __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n)"}, {"id": "model.github.int_github__issue_open_length", "sql": " __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), \n current_timestamp\n) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n)"}, {"id": "model.github.int_github__issue_comments", "sql": " __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n)"}, {"id": "model.github.int_github__pull_request_times", "sql": " __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, \n current_timestamp\n) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n/ 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, \n current_timestamp\n),\n coalesce(issue.closed_at, \n current_timestamp\n)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n/ 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n)"}, {"id": "model.github.int_github__pull_request_reviewers", "sql": " __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n)"}], "relation_name": null}, "model.github.int_github__issue_labels": {"raw_sql": "with issue_label as (\n select *\n from {{ ref('int_github__issue_label_joined') }}\n)\n\nselect\n issue_id,\n {{ fivetran_utils.string_agg( 'label', \"', '\" )}} as labels\nfrom issue_label\ngroup by issue_id", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.github.int_github__issue_label_joined"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github", "intermediate", "int_github__issue_labels"], "unique_id": "model.github.int_github__issue_labels", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github", "path": "intermediate/int_github__issue_labels.sql", "original_file_path": "models/intermediate/int_github__issue_labels.sql", "name": "int_github__issue_labels", "alias": "int_github__issue_labels", "checksum": {"name": "sha256", "checksum": "126b7de5034d8b9e5067e9d0a346ea3d93132574cc3ae85d4d711270404f4064"}, "tags": [], "refs": [["int_github__issue_label_joined"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_labels.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "github"}, "created_at": 1644611542.6630132, "compiled_sql": "with __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n),issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.github.int_github__issue_label_joined", "sql": " __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n)"}], "relation_name": null}, "model.github.int_github__issue_assignees": {"raw_sql": "with issue_assignee as (\n select *\n from {{ var('issue_assignee') }}\n), \n\ngithub_user as (\n select *\n from {{ var('user')}}\n)\n\nselect\n issue_assignee.issue_id,\n {{ fivetran_utils.string_agg( 'github_user.login_name', \"', '\" )}} as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.github_source.stg_github__issue_assignee", "model.github_source.stg_github__user"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github", "intermediate", "int_github__issue_assignees"], "unique_id": "model.github.int_github__issue_assignees", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github", "path": "intermediate/int_github__issue_assignees.sql", "original_file_path": "models/intermediate/int_github__issue_assignees.sql", "name": "int_github__issue_assignees", "alias": "int_github__issue_assignees", "checksum": {"name": "sha256", "checksum": "837310bb78ff6f1460babc622037227dbc0c5776aae3ce3f5e9de48cb2ffac9c"}, "tags": [], "refs": [["stg_github__issue_assignee"], ["stg_github__user"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_assignees.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "github"}, "created_at": 1644611542.6686049, "compiled_sql": "with issue_assignee as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__issue_comments": {"raw_sql": "with issue_comment as (\n select *\n from {{ var('issue_comment') }}\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.github_source.stg_github__issue_comment"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github", "intermediate", "int_github__issue_comments"], "unique_id": "model.github.int_github__issue_comments", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github", "path": "intermediate/int_github__issue_comments.sql", "original_file_path": "models/intermediate/int_github__issue_comments.sql", "name": "int_github__issue_comments", "alias": "int_github__issue_comments", "checksum": {"name": "sha256", "checksum": "b56ffccc19ec39a1d1bc4137557c8e1971167f97e673ea30d0f713bd34bc111a"}, "tags": [], "refs": [["stg_github__issue_comment"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_comments.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "github"}, "created_at": 1644611542.677058, "compiled_sql": "with issue_comment as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__issue_open_length": {"raw_sql": "with issue as (\n select *\n from {{ var('issue') }}\n), \n\nissue_closed_history as (\n select *\n from {{ var('issue_closed_history') }}\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), {{ dbt_utils.current_timestamp() }}) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum({{ dbt_utils.datediff('valid_starting', 'valid_until', 'second') }}) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.current_timestamp", "macro.dbt_utils.datediff"], "nodes": ["model.github_source.stg_github__issue", "model.github_source.stg_github__issue_closed_history"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github", "intermediate", "int_github__issue_open_length"], "unique_id": "model.github.int_github__issue_open_length", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github", "path": "intermediate/int_github__issue_open_length.sql", "original_file_path": "models/intermediate/int_github__issue_open_length.sql", "name": "int_github__issue_open_length", "alias": "int_github__issue_open_length", "checksum": {"name": "sha256", "checksum": "8defe87d655eea838b4ac89d51c7b938ceca6753ddb91b05a72f00f1980d65dc"}, "tags": [], "refs": [["stg_github__issue"], ["stg_github__issue_closed_history"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_open_length.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "schema": "github"}, "created_at": 1644611542.6829371, "compiled_sql": "with issue as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), \n current_timestamp\n) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__repository_teams": {"raw_sql": "{{ config(enabled=var('github__using_repo_team', True)) }}\n\nwith repository as (\n select *\n from {{ var('repository')}}\n),\n\nrepo_teams as (\n select *\n from {{ var('repo_team')}}\n),\n\nteams as (\n select *\n from {{ var('team')}}\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n {{ fivetran_utils.string_agg('team_name', \"', '\" ) }} as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.github_source.stg_github__repository", "model.github_source.stg_github__repo_team", "model.github_source.stg_github__team"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github", "intermediate", "int_github__repository_teams"], "unique_id": "model.github.int_github__repository_teams", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github", "path": "intermediate/int_github__repository_teams.sql", "original_file_path": "models/intermediate/int_github__repository_teams.sql", "name": "int_github__repository_teams", "alias": "int_github__repository_teams", "checksum": {"name": "sha256", "checksum": "aa75375faa9f533b0c9c935f80ed6e9c7b90f20249089e7d64b7b47194f9044e"}, "tags": [], "refs": [["stg_github__repository"], ["stg_github__repo_team"], ["stg_github__team"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__repository_teams.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "enabled": true, "schema": "github"}, "created_at": 1644611542.690699, "compiled_sql": "\n\nwith repository as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github_source.stg_github__issue_comment": {"raw_sql": "with issue_comment as (\n\n select *\n from {{ ref('stg_github__issue_comment_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_comment_tmp')),\n staging_columns=get_issue_comment_columns()\n )\n }}\n\n from issue_comment\n\n), fields as (\n\n select \n id as issue_comment_id,\n issue_id,\n user_id\n\n from macro\n)\n\nselect *\nfrom fields", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_comment_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__issue_comment_tmp", "model.github_source.stg_github__issue_comment_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github_source", "stg_github__issue_comment"], "unique_id": "model.github_source.stg_github__issue_comment", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "stg_github__issue_comment.sql", "original_file_path": "models/stg_github__issue_comment.sql", "name": "stg_github__issue_comment", "alias": "stg_github__issue_comment", "checksum": {"name": "sha256", "checksum": "2f96156ac9d0de0afe220888eb6912117a7d04b1680b8fb1f5890dfbbcdb2994"}, "tags": [], "refs": [["stg_github__issue_comment_tmp"], ["stg_github__issue_comment_tmp"]], "sources": [], "description": "Table that contains comments made on issues", "columns": {"issue_comment_id": {"name": "issue_comment_id", "description": "System generated unique id for the issue comment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue_comment.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "github"}, "created_at": 1644611543.189533, "compiled_sql": "with issue_comment as (\n\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_comment_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n body\n \n as \n \n body\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 issue_id\n \n as \n \n issue_id\n \n, \n \n \n updated_at\n \n as \n \n updated_at\n \n, \n \n \n user_id\n \n as \n \n user_id\n \n\n\n\n\n from issue_comment\n\n), fields as (\n\n select \n id as issue_comment_id,\n issue_id,\n user_id\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery-proj`.`dbt_joe_github`.`stg_github__issue_comment`"}, "model.github_source.stg_github__requested_reviewer_history": {"raw_sql": "with requested_reviewer_history as (\n\n select *\n from {{ ref('stg_github__requested_reviewer_history_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__requested_reviewer_history_tmp')),\n staging_columns=get_requested_reviewer_history_columns()\n )\n }}\n\n from requested_reviewer_history\n\n), fields as (\n\n select \n pull_request_id,\n cast(created_at as {{ dbt_utils.type_timestamp() }}) as created_at,\n requested_id,\n removed\n\n from macro\n)\n\nselect *\nfrom fields", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_requested_reviewer_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt_utils.type_timestamp"], "nodes": ["model.github_source.stg_github__requested_reviewer_history_tmp", "model.github_source.stg_github__requested_reviewer_history_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github_source", "stg_github__requested_reviewer_history"], "unique_id": "model.github_source.stg_github__requested_reviewer_history", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "stg_github__requested_reviewer_history.sql", "original_file_path": "models/stg_github__requested_reviewer_history.sql", "name": "stg_github__requested_reviewer_history", "alias": "stg_github__requested_reviewer_history", "checksum": {"name": "sha256", "checksum": "570638f0a7d213c989aadc694cf9aeccd0f8a45106e0cb6859c5c12f2183103c"}, "tags": [], "refs": [["stg_github__requested_reviewer_history_tmp"], ["stg_github__requested_reviewer_history_tmp"]], "sources": [], "description": "Table containing when a user requests another user to review a pull request", "columns": {"pull_request_id": {"name": "pull_request_id", "description": "Foreign key that references the pull request table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the review was submitted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "requested_id": {"name": "requested_id", "description": "Foreign key that references the user table, representing the user that was requested to review a PR.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "removed": {"name": "removed", "description": "Boolean variable indicating if the requester was removed from the PR (true) or added to the PR (false).", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__requested_reviewer_history.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "github"}, "created_at": 1644611543.205771, "compiled_sql": "with requested_reviewer_history as (\n\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__requested_reviewer_history_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n actor_id\n \n as \n \n actor_id\n \n, \n \n \n created_at\n \n as \n \n created_at\n \n, \n \n \n pull_request_id\n \n as \n \n pull_request_id\n \n, \n \n \n removed\n \n as \n \n removed\n \n, \n \n \n requested_id\n \n as \n \n requested_id\n \n\n\n\n\n from requested_reviewer_history\n\n), fields as (\n\n select \n pull_request_id,\n cast(created_at as \n timestamp\n) as created_at,\n requested_id,\n removed\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery-proj`.`dbt_joe_github`.`stg_github__requested_reviewer_history`"}, "model.github_source.stg_github__issue_label": {"raw_sql": "with issue_label as (\n\n select *\n from {{ ref('stg_github__issue_label_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_label_tmp')),\n staging_columns=get_issue_label_columns()\n )\n }}\n\n from issue_label\n\n), fields as (\n\n select \n issue_id,\n label_id\n from macro\n)\n\nselect *\nfrom fields", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_label_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__issue_label_tmp", "model.github_source.stg_github__issue_label_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github_source", "stg_github__issue_label"], "unique_id": "model.github_source.stg_github__issue_label", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "stg_github__issue_label.sql", "original_file_path": "models/stg_github__issue_label.sql", "name": "stg_github__issue_label", "alias": "stg_github__issue_label", "checksum": {"name": "sha256", "checksum": "bbc4b8e82ab26b7cb753ead2165a6d483171b6def78a34c8ab6b2c9d1dc1357c"}, "tags": [], "refs": [["stg_github__issue_label_tmp"], ["stg_github__issue_label_tmp"]], "sources": [], "description": "The current labels attached to an issue", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "label_id": {"name": "label_id", "description": "Unique identifier of the used label", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue_label.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "github"}, "created_at": 1644611543.187943, "compiled_sql": "with issue_label as (\n\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_label_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n label_id\n \n as \n \n label_id\n \n, \n \n \n issue_id\n \n as \n \n issue_id\n \n\n\n\n\n from issue_label\n\n), fields as (\n\n select \n issue_id,\n label_id\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery-proj`.`dbt_joe_github`.`stg_github__issue_label`"}, "model.github_source.stg_github__issue_merged": {"raw_sql": "with issue_merged as (\n\n select *\n from {{ ref('stg_github__issue_merged_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_merged_tmp')),\n staging_columns=get_issue_merged_columns()\n )\n }}\n\n from issue_merged\n\n), fields as (\n\n select \n issue_id,\n cast(merged_at as {{ dbt_utils.type_timestamp() }}) as merged_at\n\n from macro\n)\n\nselect *\nfrom fields", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_merged_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt_utils.type_timestamp"], "nodes": ["model.github_source.stg_github__issue_merged_tmp", "model.github_source.stg_github__issue_merged_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github_source", "stg_github__issue_merged"], "unique_id": "model.github_source.stg_github__issue_merged", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "stg_github__issue_merged.sql", "original_file_path": "models/stg_github__issue_merged.sql", "name": "stg_github__issue_merged", "alias": "stg_github__issue_merged", "checksum": {"name": "sha256", "checksum": "d8cd38cd761436b9ef7b26e052177464dd458e5510148748c3b2e07ec2875514"}, "tags": [], "refs": [["stg_github__issue_merged_tmp"], ["stg_github__issue_merged_tmp"]], "sources": [], "description": "Table that tracks when an issue (always a pull request) is merged", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table. This table will only reference issues that are pull requests", "meta": {}, "data_type": null, "quote": null, "tags": []}, "merged_at": {"name": "merged_at", "description": "Timestamp of when the code merge took place", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue_merged.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "github"}, "created_at": 1644611543.1907141, "compiled_sql": "with issue_merged as (\n\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_merged_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n actor_id\n \n as \n \n actor_id\n \n, \n \n \n commit_sha\n \n as \n \n commit_sha\n \n, \n \n \n issue_id\n \n as \n \n issue_id\n \n, \n \n \n merged_at\n \n as \n \n merged_at\n \n\n\n\n\n from issue_merged\n\n), fields as (\n\n select \n issue_id,\n cast(merged_at as \n timestamp\n) as merged_at\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery-proj`.`dbt_joe_github`.`stg_github__issue_merged`"}, "model.github_source.stg_github__issue_closed_history": {"raw_sql": "with issue_closed_history as (\n\n select *\n from {{ ref('stg_github__issue_closed_history_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_closed_history_tmp')),\n staging_columns=get_issue_closed_history_columns()\n )\n }}\n\n from issue_closed_history\n\n), fields as (\n\n select \n issue_id,\n cast(updated_at as {{ dbt_utils.type_timestamp() }}) as updated_at,\n closed as is_closed\n\n from macro\n)\n\nselect *\nfrom fields", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_closed_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt_utils.type_timestamp"], "nodes": ["model.github_source.stg_github__issue_closed_history_tmp", "model.github_source.stg_github__issue_closed_history_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github_source", "stg_github__issue_closed_history"], "unique_id": "model.github_source.stg_github__issue_closed_history", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "stg_github__issue_closed_history.sql", "original_file_path": "models/stg_github__issue_closed_history.sql", "name": "stg_github__issue_closed_history", "alias": "stg_github__issue_closed_history", "checksum": {"name": "sha256", "checksum": "1f9e4cacc179c124053888388bd752520544889250ad295cedc4a52e78319e41"}, "tags": [], "refs": [["stg_github__issue_closed_history_tmp"], ["stg_github__issue_closed_history_tmp"]], "sources": [], "description": "Table to track when an issue is closed or re-opened", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the action took place", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_closed": {"name": "is_closed", "description": "Boolean variable for if the issue was closed (true) or re-opened (false)", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue_closed_history.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "github"}, "created_at": 1644611543.186723, "compiled_sql": "with issue_closed_history as (\n\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_closed_history_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n actor_id\n \n as \n \n actor_id\n \n, \n \n \n closed\n \n as \n \n closed\n \n, \n \n \n commit_sha\n \n as \n \n commit_sha\n \n, \n \n \n issue_id\n \n as \n \n issue_id\n \n, \n \n \n updated_at\n \n as \n \n updated_at\n \n\n\n\n\n from issue_closed_history\n\n), fields as (\n\n select \n issue_id,\n cast(updated_at as \n timestamp\n) as updated_at,\n closed as is_closed\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery-proj`.`dbt_joe_github`.`stg_github__issue_closed_history`"}, "model.github_source.stg_github__issue_assignee": {"raw_sql": "with issue_assignee as (\n\n select *\n from {{ ref('stg_github__issue_assignee_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_assignee_tmp')),\n staging_columns=get_issue_assignee_columns()\n )\n }}\n\n from issue_assignee\n\n), fields as (\n\n select \n issue_id,\n user_id\n from macro\n)\n\nselect *\nfrom fields", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_assignee_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__issue_assignee_tmp", "model.github_source.stg_github__issue_assignee_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github_source", "stg_github__issue_assignee"], "unique_id": "model.github_source.stg_github__issue_assignee", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "stg_github__issue_assignee.sql", "original_file_path": "models/stg_github__issue_assignee.sql", "name": "stg_github__issue_assignee", "alias": "stg_github__issue_assignee", "checksum": {"name": "sha256", "checksum": "1ee1ae6a0a648f4fddde4964f184b889bfd09ca43f0560fb10faaa8544b2f90d"}, "tags": [], "refs": [["stg_github__issue_assignee_tmp"], ["stg_github__issue_assignee_tmp"]], "sources": [], "description": "Table with the current user(s) assigned to an issue", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue_assignee.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "github"}, "created_at": 1644611543.181945, "compiled_sql": "with issue_assignee as (\n\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_assignee_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n issue_id\n \n as \n \n issue_id\n \n, \n \n \n user_id\n \n as \n \n user_id\n \n\n\n\n\n from issue_assignee\n\n), fields as (\n\n select \n issue_id,\n user_id\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery-proj`.`dbt_joe_github`.`stg_github__issue_assignee`"}, "model.github_source.stg_github__repository": {"raw_sql": "with repository as (\n\n select *\n from {{ ref('stg_github__repository_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__repository_tmp')),\n staging_columns=get_repository_columns()\n )\n }}\n\n from repository\n\n), fields as (\n\n select \n id as repository_id,\n full_name,\n private as is_private\n\n from macro\n)\n\nselect *\nfrom fields", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_repository_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__repository_tmp", "model.github_source.stg_github__repository_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github_source", "stg_github__repository"], "unique_id": "model.github_source.stg_github__repository", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "stg_github__repository.sql", "original_file_path": "models/stg_github__repository.sql", "name": "stg_github__repository", "alias": "stg_github__repository", "checksum": {"name": "sha256", "checksum": "52faadfa1a36e8b144c01bdba106b9b22c58154bbd60b69c069c409f1b2f4712"}, "tags": [], "refs": [["stg_github__repository_tmp"], ["stg_github__repository_tmp"]], "sources": [], "description": "Table representing the file structure of a directory under git control", "columns": {"repository_id": {"name": "repository_id", "description": "System generated unique id for the repository.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "full_name": {"name": "full_name", "description": "The name of the git repository.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_private": {"name": "is_private", "description": "Boolean field indicating whether the repository is private (true) or public (false).", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__repository.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "github"}, "created_at": 1644611543.203402, "compiled_sql": "with repository as (\n\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__repository_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\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 created_at\n \n as \n \n created_at\n \n, \n \n \n default_branch\n \n as \n \n default_branch\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n fork\n \n as \n \n fork\n \n, \n \n \n full_name\n \n as \n \n full_name\n \n, \n \n \n homepage\n \n as \n \n homepage\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n language\n \n as \n \n language\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n owner_id\n \n as \n \n owner_id\n \n, \n \n \n private\n \n as \n \n private\n \n\n\n\n\n from repository\n\n), fields as (\n\n select \n id as repository_id,\n full_name,\n private as is_private\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery-proj`.`dbt_joe_github`.`stg_github__repository`"}, "model.github_source.stg_github__user": {"raw_sql": "with github_user as (\n\n select *\n from {{ ref('stg_github__user_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__user_tmp')),\n staging_columns=get_user_columns()\n )\n }}\n \n \n from github_user\n\n), fields as (\n\n select\n id as user_id,\n login as login_name,\n name,\n company\n\n from macro\n)\n\nselect *\nfrom fields", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_user_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__user_tmp", "model.github_source.stg_github__user_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github_source", "stg_github__user"], "unique_id": "model.github_source.stg_github__user", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "stg_github__user.sql", "original_file_path": "models/stg_github__user.sql", "name": "stg_github__user", "alias": "stg_github__user", "checksum": {"name": "sha256", "checksum": "3fade99df6af62e01efd3bdabe4245077eeb17d7c05a33eae885ab9cebfb33a6"}, "tags": [], "refs": [["stg_github__user_tmp"], ["stg_github__user_tmp"]], "sources": [], "description": "Table representing contributors to a git project", "columns": {"user_id": {"name": "user_id", "description": "System generated unique id for the user.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "login_name": {"name": "login_name", "description": "The alias the user uses to login to github.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the user", "meta": {}, "data_type": null, "quote": null, "tags": []}, "company": {"name": "company", "description": "The company of the user.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__user.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "github"}, "created_at": 1644611543.2107258, "compiled_sql": "with github_user as (\n\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__user_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n company\n \n as \n \n company\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n login\n \n as \n \n login\n \n, \n \n \n name\n \n as \n \n name\n \n\n\n\n \n \n from github_user\n\n), fields as (\n\n select\n id as user_id,\n login as login_name,\n name,\n company\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery-proj`.`dbt_joe_github`.`stg_github__user`"}, "model.github_source.stg_github__pull_request_review": {"raw_sql": "with pull_request_review as (\n\n select *\n from {{ ref('stg_github__pull_request_review_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__pull_request_review_tmp')),\n staging_columns=get_pull_request_review_columns()\n )\n }}\n\n from pull_request_review\n\n), fields as (\n\n select \n id as pull_request_review_id,\n pull_request_id,\n cast(submitted_at as {{ dbt_utils.type_timestamp() }}) as submitted_at,\n state,\n user_id\n\n from macro\n)\n\nselect *\nfrom fields", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_pull_request_review_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt_utils.type_timestamp"], "nodes": ["model.github_source.stg_github__pull_request_review_tmp", "model.github_source.stg_github__pull_request_review_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github_source", "stg_github__pull_request_review"], "unique_id": "model.github_source.stg_github__pull_request_review", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "stg_github__pull_request_review.sql", "original_file_path": "models/stg_github__pull_request_review.sql", "name": "stg_github__pull_request_review", "alias": "stg_github__pull_request_review", "checksum": {"name": "sha256", "checksum": "7f5beac06c39edff543e748221ad80c75ffc425d5fb4eb64a9fb802d2ae9a636"}, "tags": [], "refs": [["stg_github__pull_request_review_tmp"], ["stg_github__pull_request_review_tmp"]], "sources": [], "description": "Table containing reviews made to pull requests", "columns": {"pull_request_review_id": {"name": "pull_request_review_id", "description": "System generated unique id for the pull request review.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pull_request_id": {"name": "pull_request_id", "description": "Foreign key that references the pull request table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "submitted_at": {"name": "submitted_at", "description": "Timestamp of when the request for review was submitted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the review was an approval, request for change, comment, dismissal.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table, representing the user that reviewed the pull request.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__pull_request_review.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "github"}, "created_at": 1644611543.198501, "compiled_sql": "with pull_request_review as (\n\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__pull_request_review_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n body\n \n as \n \n body\n \n, \n \n \n commit_sha\n \n as \n \n commit_sha\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n pull_request_id\n \n as \n \n pull_request_id\n \n, \n \n \n state\n \n as \n \n state\n \n, \n \n \n submitted_at\n \n as \n \n submitted_at\n \n, \n \n \n user_id\n \n as \n \n user_id\n \n\n\n\n\n from pull_request_review\n\n), fields as (\n\n select \n id as pull_request_review_id,\n pull_request_id,\n cast(submitted_at as \n timestamp\n) as submitted_at,\n state,\n user_id\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery-proj`.`dbt_joe_github`.`stg_github__pull_request_review`"}, "model.github_source.stg_github__repo_team": {"raw_sql": "{{ config(enabled=var('github__using_repo_team', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_github__repo_team_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__repo_team_tmp')),\n staging_columns=get_repo_team_columns()\n )\n }}\n \n from base\n \n), final as (\n \n select \n repository_id,\n team_id\n from fields\n)\n\nselect * from final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_repo_team_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__repo_team_tmp", "model.github_source.stg_github__repo_team_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github_source", "stg_github__repo_team"], "unique_id": "model.github_source.stg_github__repo_team", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "stg_github__repo_team.sql", "original_file_path": "models/stg_github__repo_team.sql", "name": "stg_github__repo_team", "alias": "stg_github__repo_team", "checksum": {"name": "sha256", "checksum": "bbf2296c63f5601191f285d1b9509717c9af73282ef8faae25df101d5c2058ec"}, "tags": [], "refs": [["stg_github__repo_team_tmp"], ["stg_github__repo_team_tmp"]], "sources": [], "description": "Table representing the mapping relationships between repositories and teams", "columns": {"repository_id": {"name": "repository_id", "description": "Reference to the respective repository for the record.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "team_id": {"name": "team_id", "description": "Reference to the respective team for the record.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__repo_team.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "enabled": true, "schema": "github"}, "created_at": 1644611543.201786, "compiled_sql": "\n\nwith base as (\n\n select * \n from `bigquery-proj`.`dbt_joe_github`.`stg_github__repo_team_tmp`\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n permission\n \n as \n \n permission\n \n, \n \n \n repository_id\n \n as \n \n repository_id\n \n, \n \n \n team_id\n \n as \n \n team_id\n \n\n\n\n \n from base\n \n), final as (\n \n select \n repository_id,\n team_id\n from fields\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery-proj`.`dbt_joe_github`.`stg_github__repo_team`"}, "model.github_source.stg_github__label": {"raw_sql": "with issue_label as (\n\n select *\n from {{ ref('stg_github__label_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__label_tmp')),\n staging_columns=get_label_columns()\n )\n }}\n\n from issue_label\n\n), fields as (\n\n select \n id as label_id,\n _fivetran_synced,\t\n color,\n description,\n is_default,\n name as label,\n url\n from macro\n)\n\nselect *\nfrom fields", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_label_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__label_tmp", "model.github_source.stg_github__label_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github_source", "stg_github__label"], "unique_id": "model.github_source.stg_github__label", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "stg_github__label.sql", "original_file_path": "models/stg_github__label.sql", "name": "stg_github__label", "alias": "stg_github__label", "checksum": {"name": "sha256", "checksum": "65919f8309be5eb259a6143e007f38f4ac91c1692d10990206708faa17f086e1"}, "tags": [], "refs": [["stg_github__label_tmp"], ["stg_github__label_tmp"]], "sources": [], "description": "Table that contains labels that are used across your Github account within individual repositories.", "columns": {"label_id": {"name": "label_id", "description": "Unique identifier of the Github label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of the record being synced by Fivetran", "meta": {}, "data_type": null, "quote": null, "tags": []}, "color": {"name": "color", "description": "The color of the label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "The description of the label indicating the purpose", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_default": {"name": "is_default", "description": "Boolean flagging if the label is default on creation", "meta": {}, "data_type": null, "quote": null, "tags": []}, "label": {"name": "label", "description": "Name of the label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url": {"name": "url", "description": "Url where the label was used", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__label.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "github"}, "created_at": 1644611543.185154, "compiled_sql": "with issue_label as (\n\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__label_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\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 description\n \n as \n \n description\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n is_default\n \n as \n \n is_default\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n url\n \n as \n \n url\n \n\n\n\n\n from issue_label\n\n), fields as (\n\n select \n id as label_id,\n _fivetran_synced,\t\n color,\n description,\n is_default,\n name as label,\n url\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery-proj`.`dbt_joe_github`.`stg_github__label`"}, "model.github_source.stg_github__issue": {"raw_sql": "with issue as (\n\n select *\n from {{ ref('stg_github__issue_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_tmp')),\n staging_columns=get_issue_columns()\n )\n }}\n\n from issue \n\n), fields as (\n\n select \n id as issue_id,\n body,\n cast(closed_at as {{ dbt_utils.type_timestamp() }}) as closed_at,\n cast(created_at as {{ dbt_utils.type_timestamp() }}) as created_at,\n locked as is_locked,\n milestone_id,\n number as issue_number,\n pull_request as is_pull_request,\n repository_id,\n state,\n title,\n cast(updated_at as {{ dbt_utils.type_timestamp() }}) as updated_at,\n user_id\n \n from macro\n)\n\nselect *\nfrom fields", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt_utils.type_timestamp"], "nodes": ["model.github_source.stg_github__issue_tmp", "model.github_source.stg_github__issue_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github_source", "stg_github__issue"], "unique_id": "model.github_source.stg_github__issue", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "stg_github__issue.sql", "original_file_path": "models/stg_github__issue.sql", "name": "stg_github__issue", "alias": "stg_github__issue", "checksum": {"name": "sha256", "checksum": "b2073beb87a919644bbaca1370f9865be45ae0e572f44b0063154bb98f0b7a30"}, "tags": [], "refs": [["stg_github__issue_tmp"], ["stg_github__issue_tmp"]], "sources": [], "description": "Table that contains 1 entry for every issue created. Pull Requests also create an entry in this table, and there is a boolean field to determine if an entry is a pull request.", "columns": {"issue_id": {"name": "issue_id", "description": "System generated unique id for the issue. This is not the number that appears in the URL.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "body": {"name": "body", "description": "The text of the main description of the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed_at": {"name": "closed_at", "description": "Timestamp of when the issue was closed, NULL for issues that are open.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_locked": {"name": "is_locked", "description": "Boolean indicating whether the issue is locked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the issue was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "milestone_id": {"name": "milestone_id", "description": "Foreign key that references the milestone table representing the current milestone the issue is in.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_number": {"name": "issue_number", "description": "The issue number within a repository. Is unique by repository, but not across repositories.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_pull_request": {"name": "is_pull_request", "description": "Boolean for is the issue is a pull request (true) ot regular issue (false)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_id": {"name": "repository_id", "description": "Foreign key that references the repository table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the issue is open or closed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "Title of the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the last update was made to the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table, representing the user that created the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "github"}, "created_at": 1644611543.196076, "compiled_sql": "with issue as (\n\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n body\n \n as \n \n body\n \n, \n \n \n closed_at\n \n as \n \n closed_at\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 locked\n \n as \n \n locked\n \n, \n \n \n milestone_id\n \n as \n \n milestone_id\n \n, \n \n \n number\n \n as \n \n number\n \n, \n \n \n pull_request\n \n as \n \n pull_request\n \n, \n \n \n repository_id\n \n as \n \n repository_id\n \n, \n \n \n state\n \n as \n \n state\n \n, \n \n \n title\n \n as \n \n title\n \n, \n \n \n updated_at\n \n as \n \n updated_at\n \n, \n \n \n user_id\n \n as \n \n user_id\n \n\n\n\n\n from issue \n\n), fields as (\n\n select \n id as issue_id,\n body,\n cast(closed_at as \n timestamp\n) as closed_at,\n cast(created_at as \n timestamp\n) as created_at,\n locked as is_locked,\n milestone_id,\n number as issue_number,\n pull_request as is_pull_request,\n repository_id,\n state,\n title,\n cast(updated_at as \n timestamp\n) as updated_at,\n user_id\n \n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery-proj`.`dbt_joe_github`.`stg_github__issue`"}, "model.github_source.stg_github__team": {"raw_sql": "with base as (\n\n select * \n from {{ ref('stg_github__team_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__team_tmp')),\n staging_columns=get_team_columns()\n )\n }}\n \n from base\n \n), final as (\n \n select \n id as team_id,\n description,\n name,\n parent_id,\n privacy,\n slug\n from fields\n)\n\nselect * \nfrom final", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_team_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__team_tmp", "model.github_source.stg_github__team_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github_source", "stg_github__team"], "unique_id": "model.github_source.stg_github__team", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "stg_github__team.sql", "original_file_path": "models/stg_github__team.sql", "name": "stg_github__team", "alias": "stg_github__team", "checksum": {"name": "sha256", "checksum": "219e47883ec9f076dc1c27b22f72534709edaedd60e8ad9dc1b13db05499f4a4"}, "tags": [], "refs": [["stg_github__team_tmp"], ["stg_github__team_tmp"]], "sources": [], "description": "Table containing teams and team details", "columns": {"team_id": {"name": "team_id", "description": "System generated unique id for the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "User created description of the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "User created name of the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "Reference to the parent team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "privacy": {"name": "privacy", "description": "Type of privacy permissions associated with the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "slug": {"name": "slug", "description": "Url friendly version of the team name.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__team.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "github"}, "created_at": 1644611543.208771, "compiled_sql": "with base as (\n\n select * \n from `bigquery-proj`.`dbt_joe_github`.`stg_github__team_tmp`\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n description\n \n as \n \n description\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 org_id\n \n as \n \n org_id\n \n, \n \n \n parent_id\n \n as \n \n parent_id\n \n, \n \n \n privacy\n \n as \n \n privacy\n \n, \n \n \n slug\n \n as \n \n slug\n \n\n\n\n \n from base\n \n), final as (\n \n select \n id as team_id,\n description,\n name,\n parent_id,\n privacy,\n slug\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery-proj`.`dbt_joe_github`.`stg_github__team`"}, "model.github_source.stg_github__pull_request": {"raw_sql": "with pull_request as (\n\n select *\n from {{ ref('stg_github__pull_request_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__pull_request_tmp')),\n staging_columns=get_pull_request_columns()\n )\n }}\n\n from pull_request\n\n), fields as (\n\n select \n id as pull_request_id,\n issue_id,\n head_repo_id,\n head_user_id\n\n from macro\n)\n\nselect *\nfrom fields", "compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_pull_request_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__pull_request_tmp", "model.github_source.stg_github__pull_request_tmp"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "table", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github_source", "stg_github__pull_request"], "unique_id": "model.github_source.stg_github__pull_request", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "stg_github__pull_request.sql", "original_file_path": "models/stg_github__pull_request.sql", "name": "stg_github__pull_request", "alias": "stg_github__pull_request", "checksum": {"name": "sha256", "checksum": "c2b1a593030492afcf35407523b636105f42f1cf3fd14f6067e31ba76d70dfe8"}, "tags": [], "refs": [["stg_github__pull_request_tmp"], ["stg_github__pull_request_tmp"]], "sources": [], "description": "A special type of issue that is created when a user wants to merge one branch of code into another", "columns": {"pull_request_id": {"name": "pull_request_id", "description": "System generated unique id for the pull request.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "head_repo_id": {"name": "head_repo_id", "description": "Foreign key that references the repository table, referencing the current branch.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "head_user_id": {"name": "head_user_id", "description": "Foreign key that references the user table, referencing who created the current branch.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__pull_request.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "github"}, "created_at": 1644611543.20045, "compiled_sql": "with pull_request as (\n\n select *\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__pull_request_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n base_label\n \n as \n \n base_label\n \n, \n \n \n base_ref\n \n as \n \n base_ref\n \n, \n \n \n base_repo_id\n \n as \n \n base_repo_id\n \n, \n \n \n base_sha\n \n as \n \n base_sha\n \n, \n \n \n base_user_id\n \n as \n \n base_user_id\n \n, \n \n \n head_label\n \n as \n \n head_label\n \n, \n \n \n head_ref\n \n as \n \n head_ref\n \n, \n \n \n head_repo_id\n \n as \n \n head_repo_id\n \n, \n \n \n head_sha\n \n as \n \n head_sha\n \n, \n \n \n head_user_id\n \n as \n \n head_user_id\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n issue_id\n \n as \n \n issue_id\n \n, \n \n \n merge_commit_sha\n \n as \n \n merge_commit_sha\n \n\n\n\n\n from pull_request\n\n), fields as (\n\n select \n id as pull_request_id,\n issue_id,\n head_repo_id,\n head_user_id\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery-proj`.`dbt_joe_github`.`stg_github__pull_request`"}, "model.github_source.stg_github__repository_tmp": {"raw_sql": "select *\nfrom {{ var('repository') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.repository"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github_source", "tmp", "stg_github__repository_tmp"], "unique_id": "model.github_source.stg_github__repository_tmp", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "tmp/stg_github__repository_tmp.sql", "original_file_path": "models/tmp/stg_github__repository_tmp.sql", "name": "stg_github__repository_tmp", "alias": "stg_github__repository_tmp", "checksum": {"name": "sha256", "checksum": "e090c8cb68dc96c49ee363d95e9bbaf417dd03e2ec675bfdc3d9cefdf889cfc8"}, "tags": [], "refs": [], "sources": [["github", "repository"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__repository_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "github"}, "created_at": 1644611542.9537878, "compiled_sql": "select *\nfrom `bigquery-proj`.`github_new`.`repository`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery-proj`.`dbt_joe_github`.`stg_github__repository_tmp`"}, "model.github_source.stg_github__label_tmp": {"raw_sql": "select *\nfrom {{ var('label') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.label"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github_source", "tmp", "stg_github__label_tmp"], "unique_id": "model.github_source.stg_github__label_tmp", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "tmp/stg_github__label_tmp.sql", "original_file_path": "models/tmp/stg_github__label_tmp.sql", "name": "stg_github__label_tmp", "alias": "stg_github__label_tmp", "checksum": {"name": "sha256", "checksum": "8e66aceee9e6c677e3b0b105b85de66edea0f4141bef42cd097fd9a236abcf2f"}, "tags": [], "refs": [], "sources": [["github", "label"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__label_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "github"}, "created_at": 1644611542.960912, "compiled_sql": "select *\nfrom `bigquery-proj`.`github_new`.`label`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery-proj`.`dbt_joe_github`.`stg_github__label_tmp`"}, "model.github_source.stg_github__requested_reviewer_history_tmp": {"raw_sql": "select *\nfrom {{ var('requested_reviewer_history') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.requested_reviewer_history"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github_source", "tmp", "stg_github__requested_reviewer_history_tmp"], "unique_id": "model.github_source.stg_github__requested_reviewer_history_tmp", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "tmp/stg_github__requested_reviewer_history_tmp.sql", "original_file_path": "models/tmp/stg_github__requested_reviewer_history_tmp.sql", "name": "stg_github__requested_reviewer_history_tmp", "alias": "stg_github__requested_reviewer_history_tmp", "checksum": {"name": "sha256", "checksum": "ed713a77bb2c7407b63c6cc1eb5da22d3267a585bd972dabeb7c86e568180aaf"}, "tags": [], "refs": [], "sources": [["github", "requested_reviewer_history"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__requested_reviewer_history_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "github"}, "created_at": 1644611542.966536, "compiled_sql": "select *\nfrom `bigquery-proj`.`github_new`.`requested_reviewer_history`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery-proj`.`dbt_joe_github`.`stg_github__requested_reviewer_history_tmp`"}, "model.github_source.stg_github__issue_comment_tmp": {"raw_sql": "select *\nfrom {{ var('issue_comment') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.issue_comment"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github_source", "tmp", "stg_github__issue_comment_tmp"], "unique_id": "model.github_source.stg_github__issue_comment_tmp", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "tmp/stg_github__issue_comment_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_comment_tmp.sql", "name": "stg_github__issue_comment_tmp", "alias": "stg_github__issue_comment_tmp", "checksum": {"name": "sha256", "checksum": "0954877e30180964df220c97f9b398d775fc74106c25666bf9dd98c5449a72a1"}, "tags": [], "refs": [], "sources": [["github", "issue_comment"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_comment_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "github"}, "created_at": 1644611542.972259, "compiled_sql": "select *\nfrom `bigquery-proj`.`github_new`.`issue_comment`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery-proj`.`dbt_joe_github`.`stg_github__issue_comment_tmp`"}, "model.github_source.stg_github__pull_request_review_tmp": {"raw_sql": "select *\nfrom {{ var('pull_request_review') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.pull_request_review"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github_source", "tmp", "stg_github__pull_request_review_tmp"], "unique_id": "model.github_source.stg_github__pull_request_review_tmp", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "tmp/stg_github__pull_request_review_tmp.sql", "original_file_path": "models/tmp/stg_github__pull_request_review_tmp.sql", "name": "stg_github__pull_request_review_tmp", "alias": "stg_github__pull_request_review_tmp", "checksum": {"name": "sha256", "checksum": "3419833d93b14d370eb3c9cfb7fda9a373c47a2f9701620425d882b95fbaa55c"}, "tags": [], "refs": [], "sources": [["github", "pull_request_review"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__pull_request_review_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "github"}, "created_at": 1644611542.9780328, "compiled_sql": "select *\nfrom `bigquery-proj`.`github_new`.`pull_request_review`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery-proj`.`dbt_joe_github`.`stg_github__pull_request_review_tmp`"}, "model.github_source.stg_github__issue_label_tmp": {"raw_sql": "select *\nfrom {{ var('issue_label') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.issue_label"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github_source", "tmp", "stg_github__issue_label_tmp"], "unique_id": "model.github_source.stg_github__issue_label_tmp", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "tmp/stg_github__issue_label_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_label_tmp.sql", "name": "stg_github__issue_label_tmp", "alias": "stg_github__issue_label_tmp", "checksum": {"name": "sha256", "checksum": "3cd52e662c2bc67a66c9c3e6250e38739362a0b688287d41329d2989297fa201"}, "tags": [], "refs": [], "sources": [["github", "issue_label"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_label_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "github"}, "created_at": 1644611542.983967, "compiled_sql": "select *\nfrom `bigquery-proj`.`github_new`.`issue_label`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery-proj`.`dbt_joe_github`.`stg_github__issue_label_tmp`"}, "model.github_source.stg_github__team_tmp": {"raw_sql": "select * \nfrom {{ var('team') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.team"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github_source", "tmp", "stg_github__team_tmp"], "unique_id": "model.github_source.stg_github__team_tmp", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "tmp/stg_github__team_tmp.sql", "original_file_path": "models/tmp/stg_github__team_tmp.sql", "name": "stg_github__team_tmp", "alias": "stg_github__team_tmp", "checksum": {"name": "sha256", "checksum": "8c107692c9394962da82e0c2460045e6686d962c1eefe0cff564c618aed7a17d"}, "tags": [], "refs": [], "sources": [["github", "team"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__team_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "github"}, "created_at": 1644611542.98949, "compiled_sql": "select * \nfrom `bigquery-proj`.`github_new`.`team`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery-proj`.`dbt_joe_github`.`stg_github__team_tmp`"}, "model.github_source.stg_github__pull_request_tmp": {"raw_sql": "select *\nfrom {{ var('pull_request') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.pull_request"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github_source", "tmp", "stg_github__pull_request_tmp"], "unique_id": "model.github_source.stg_github__pull_request_tmp", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "tmp/stg_github__pull_request_tmp.sql", "original_file_path": "models/tmp/stg_github__pull_request_tmp.sql", "name": "stg_github__pull_request_tmp", "alias": "stg_github__pull_request_tmp", "checksum": {"name": "sha256", "checksum": "11df5e7fd7046db485c6654ea88c82c566b71140c4e233f3567bd63bbf1cca19"}, "tags": [], "refs": [], "sources": [["github", "pull_request"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__pull_request_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "github"}, "created_at": 1644611542.99505, "compiled_sql": "select *\nfrom `bigquery-proj`.`github_new`.`pull_request`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery-proj`.`dbt_joe_github`.`stg_github__pull_request_tmp`"}, "model.github_source.stg_github__issue_merged_tmp": {"raw_sql": "select *\nfrom {{ var('issue_merged') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.issue_merged"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github_source", "tmp", "stg_github__issue_merged_tmp"], "unique_id": "model.github_source.stg_github__issue_merged_tmp", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "tmp/stg_github__issue_merged_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_merged_tmp.sql", "name": "stg_github__issue_merged_tmp", "alias": "stg_github__issue_merged_tmp", "checksum": {"name": "sha256", "checksum": "e61fb5297937f494370067232958a443ec21c885a55cca0022f480b463ce90a9"}, "tags": [], "refs": [], "sources": [["github", "issue_merged"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_merged_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "github"}, "created_at": 1644611543.001098, "compiled_sql": "select *\nfrom `bigquery-proj`.`github_new`.`issue_merged`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery-proj`.`dbt_joe_github`.`stg_github__issue_merged_tmp`"}, "model.github_source.stg_github__user_tmp": {"raw_sql": "select *\nfrom {{ var('user') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.user"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github_source", "tmp", "stg_github__user_tmp"], "unique_id": "model.github_source.stg_github__user_tmp", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "tmp/stg_github__user_tmp.sql", "original_file_path": "models/tmp/stg_github__user_tmp.sql", "name": "stg_github__user_tmp", "alias": "stg_github__user_tmp", "checksum": {"name": "sha256", "checksum": "e71885bca06f3e1feaef9e729cfb58827c8999bc4d4b7cda538c392c5f56ffdf"}, "tags": [], "refs": [], "sources": [["github", "user"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__user_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "github"}, "created_at": 1644611543.006602, "compiled_sql": "select *\nfrom `bigquery-proj`.`github_new`.`user`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery-proj`.`dbt_joe_github`.`stg_github__user_tmp`"}, "model.github_source.stg_github__issue_closed_history_tmp": {"raw_sql": "select *\nfrom {{ var('issue_closed_history') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.issue_closed_history"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github_source", "tmp", "stg_github__issue_closed_history_tmp"], "unique_id": "model.github_source.stg_github__issue_closed_history_tmp", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "tmp/stg_github__issue_closed_history_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_closed_history_tmp.sql", "name": "stg_github__issue_closed_history_tmp", "alias": "stg_github__issue_closed_history_tmp", "checksum": {"name": "sha256", "checksum": "5ce3eed90261c385c0ddcb0dc9d914a0bf3d3e0f737e4e233af244d29bbf3ce4"}, "tags": [], "refs": [], "sources": [["github", "issue_closed_history"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_closed_history_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "github"}, "created_at": 1644611543.011942, "compiled_sql": "select *\nfrom `bigquery-proj`.`github_new`.`issue_closed_history`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery-proj`.`dbt_joe_github`.`stg_github__issue_closed_history_tmp`"}, "model.github_source.stg_github__issue_assignee_tmp": {"raw_sql": "select *\nfrom {{ var('issue_assignee') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.issue_assignee"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github_source", "tmp", "stg_github__issue_assignee_tmp"], "unique_id": "model.github_source.stg_github__issue_assignee_tmp", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "tmp/stg_github__issue_assignee_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_assignee_tmp.sql", "name": "stg_github__issue_assignee_tmp", "alias": "stg_github__issue_assignee_tmp", "checksum": {"name": "sha256", "checksum": "4cab39e652c5972bfa16de13454df8e5745610e91b69f3840305e49a9d613753"}, "tags": [], "refs": [], "sources": [["github", "issue_assignee"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_assignee_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "github"}, "created_at": 1644611543.017694, "compiled_sql": "select *\nfrom `bigquery-proj`.`github_new`.`issue_assignee`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery-proj`.`dbt_joe_github`.`stg_github__issue_assignee_tmp`"}, "model.github_source.stg_github__issue_tmp": {"raw_sql": "select *\nfrom {{ var('issue') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.issue"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github_source", "tmp", "stg_github__issue_tmp"], "unique_id": "model.github_source.stg_github__issue_tmp", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "tmp/stg_github__issue_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_tmp.sql", "name": "stg_github__issue_tmp", "alias": "stg_github__issue_tmp", "checksum": {"name": "sha256", "checksum": "4100b13686c42d580a5eeaab15449896ec2ce740b0e5f002775eb9f222ef7c32"}, "tags": [], "refs": [], "sources": [["github", "issue"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "github"}, "created_at": 1644611543.024064, "compiled_sql": "select *\nfrom `bigquery-proj`.`github_new`.`issue`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery-proj`.`dbt_joe_github`.`stg_github__issue_tmp`"}, "model.github_source.stg_github__repo_team_tmp": {"raw_sql": "{{ config(enabled=var('github__using_repo_team', True)) }}\n\nselect * \nfrom {{ var('repo_team') }}", "compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.repo_team"]}, "config": {"enabled": true, "alias": null, "schema": "github", "database": null, "tags": [], "meta": {}, "materialized": "view", "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "on_schema_change": "ignore", "post-hook": [], "pre-hook": []}, "database": "bigquery-proj", "schema": "dbt_joe_github", "fqn": ["github_source", "tmp", "stg_github__repo_team_tmp"], "unique_id": "model.github_source.stg_github__repo_team_tmp", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "tmp/stg_github__repo_team_tmp.sql", "original_file_path": "models/tmp/stg_github__repo_team_tmp.sql", "name": "stg_github__repo_team_tmp", "alias": "stg_github__repo_team_tmp", "checksum": {"name": "sha256", "checksum": "25a704d9235d40dc05601995f184779690eabcc6e3a64d3a0489e00c3e6d13ab"}, "tags": [], "refs": [], "sources": [["github", "repo_team"]], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__repo_team_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "enabled": true, "schema": "github"}, "created_at": 1644611543.0299451, "compiled_sql": "\n\nselect * \nfrom `bigquery-proj`.`github_new`.`repo_team`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`bigquery-proj`.`dbt_joe_github`.`stg_github__repo_team_tmp`"}, "test.github.unique_github__issues_issue_id.6723b9b1db": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('github__issues')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__issues"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bigquery-proj", "schema": "dbt_joe_dbt_test__audit", "fqn": ["github", "unique_github__issues_issue_id"], "unique_id": "test.github.unique_github__issues_issue_id.6723b9b1db", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github", "path": "unique_github__issues_issue_id.sql", "original_file_path": "models/github.yml", "name": "unique_github__issues_issue_id", "alias": "unique_github__issues_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__issues"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__issues_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1644611543.107388, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select issue_id as unique_field\n from `bigquery-proj`.`dbt_joe_github`.`github__issues`\n where issue_id is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.github__issues"}, "test.github.not_null_github__issues_issue_id.fed0631e25": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('github__issues')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__issues"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bigquery-proj", "schema": "dbt_joe_dbt_test__audit", "fqn": ["github", "not_null_github__issues_issue_id"], "unique_id": "test.github.not_null_github__issues_issue_id.fed0631e25", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github", "path": "not_null_github__issues_issue_id.sql", "original_file_path": "models/github.yml", "name": "not_null_github__issues_issue_id", "alias": "not_null_github__issues_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__issues"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__issues_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1644611543.1094668, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery-proj`.`dbt_joe_github`.`github__issues`\nwhere issue_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.github__issues"}, "test.github.unique_github__pull_requests_issue_id.ce23997907": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('github__pull_requests')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__pull_requests"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bigquery-proj", "schema": "dbt_joe_dbt_test__audit", "fqn": ["github", "unique_github__pull_requests_issue_id"], "unique_id": "test.github.unique_github__pull_requests_issue_id.ce23997907", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github", "path": "unique_github__pull_requests_issue_id.sql", "original_file_path": "models/github.yml", "name": "unique_github__pull_requests_issue_id", "alias": "unique_github__pull_requests_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__pull_requests"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__pull_requests_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1644611543.111369, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select issue_id as unique_field\n from `bigquery-proj`.`dbt_joe_github`.`github__pull_requests`\n where issue_id is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.github__pull_requests"}, "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('github__pull_requests')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__pull_requests"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bigquery-proj", "schema": "dbt_joe_dbt_test__audit", "fqn": ["github", "not_null_github__pull_requests_issue_id"], "unique_id": "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github", "path": "not_null_github__pull_requests_issue_id.sql", "original_file_path": "models/github.yml", "name": "not_null_github__pull_requests_issue_id", "alias": "not_null_github__pull_requests_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__pull_requests"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__pull_requests_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1644611543.113369, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery-proj`.`dbt_joe_github`.`github__pull_requests`\nwhere issue_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.github__pull_requests"}, "test.github.unique_github__daily_metrics_day.f98cab9456": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "day", "model": "{{ get_where_subquery(ref('github__daily_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bigquery-proj", "schema": "dbt_joe_dbt_test__audit", "fqn": ["github", "unique_github__daily_metrics_day"], "unique_id": "test.github.unique_github__daily_metrics_day.f98cab9456", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github", "path": "unique_github__daily_metrics_day.sql", "original_file_path": "models/github.yml", "name": "unique_github__daily_metrics_day", "alias": "unique_github__daily_metrics_day", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__daily_metrics"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__daily_metrics_day.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1644611543.115577, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select day as unique_field\n from `bigquery-proj`.`dbt_joe_github`.`github__daily_metrics`\n where day is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "day", "file_key_name": "models.github__daily_metrics"}, "test.github.not_null_github__daily_metrics_day.647e494434": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "day", "model": "{{ get_where_subquery(ref('github__daily_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bigquery-proj", "schema": "dbt_joe_dbt_test__audit", "fqn": ["github", "not_null_github__daily_metrics_day"], "unique_id": "test.github.not_null_github__daily_metrics_day.647e494434", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github", "path": "not_null_github__daily_metrics_day.sql", "original_file_path": "models/github.yml", "name": "not_null_github__daily_metrics_day", "alias": "not_null_github__daily_metrics_day", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__daily_metrics"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__daily_metrics_day.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1644611543.117449, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery-proj`.`dbt_joe_github`.`github__daily_metrics`\nwhere day is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "day", "file_key_name": "models.github__daily_metrics"}, "test.github.unique_github__weekly_metrics_week.6794858a8e": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "week", "model": "{{ get_where_subquery(ref('github__weekly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__weekly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bigquery-proj", "schema": "dbt_joe_dbt_test__audit", "fqn": ["github", "unique_github__weekly_metrics_week"], "unique_id": "test.github.unique_github__weekly_metrics_week.6794858a8e", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github", "path": "unique_github__weekly_metrics_week.sql", "original_file_path": "models/github.yml", "name": "unique_github__weekly_metrics_week", "alias": "unique_github__weekly_metrics_week", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__weekly_metrics"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__weekly_metrics_week.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1644611543.119225, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select week as unique_field\n from `bigquery-proj`.`dbt_joe_github`.`github__weekly_metrics`\n where week is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "week", "file_key_name": "models.github__weekly_metrics"}, "test.github.not_null_github__weekly_metrics_week.4b0b928243": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "week", "model": "{{ get_where_subquery(ref('github__weekly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__weekly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bigquery-proj", "schema": "dbt_joe_dbt_test__audit", "fqn": ["github", "not_null_github__weekly_metrics_week"], "unique_id": "test.github.not_null_github__weekly_metrics_week.4b0b928243", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github", "path": "not_null_github__weekly_metrics_week.sql", "original_file_path": "models/github.yml", "name": "not_null_github__weekly_metrics_week", "alias": "not_null_github__weekly_metrics_week", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__weekly_metrics"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__weekly_metrics_week.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1644611543.1211488, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery-proj`.`dbt_joe_github`.`github__weekly_metrics`\nwhere week is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "week", "file_key_name": "models.github__weekly_metrics"}, "test.github.unique_github__monthly_metrics_month.3076284fbb": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "month", "model": "{{ get_where_subquery(ref('github__monthly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__monthly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bigquery-proj", "schema": "dbt_joe_dbt_test__audit", "fqn": ["github", "unique_github__monthly_metrics_month"], "unique_id": "test.github.unique_github__monthly_metrics_month.3076284fbb", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github", "path": "unique_github__monthly_metrics_month.sql", "original_file_path": "models/github.yml", "name": "unique_github__monthly_metrics_month", "alias": "unique_github__monthly_metrics_month", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__monthly_metrics"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__monthly_metrics_month.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1644611543.122881, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select month as unique_field\n from `bigquery-proj`.`dbt_joe_github`.`github__monthly_metrics`\n where month is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "month", "file_key_name": "models.github__monthly_metrics"}, "test.github.not_null_github__monthly_metrics_month.9e4fba84df": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "month", "model": "{{ get_where_subquery(ref('github__monthly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__monthly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bigquery-proj", "schema": "dbt_joe_dbt_test__audit", "fqn": ["github", "not_null_github__monthly_metrics_month"], "unique_id": "test.github.not_null_github__monthly_metrics_month.9e4fba84df", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github", "path": "not_null_github__monthly_metrics_month.sql", "original_file_path": "models/github.yml", "name": "not_null_github__monthly_metrics_month", "alias": "not_null_github__monthly_metrics_month", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__monthly_metrics"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__monthly_metrics_month.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1644611543.12472, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery-proj`.`dbt_joe_github`.`github__monthly_metrics`\nwhere month is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "month", "file_key_name": "models.github__monthly_metrics"}, "test.github.unique_github__quarterly_metrics_quarter.9165a921c1": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "quarter", "model": "{{ get_where_subquery(ref('github__quarterly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__quarterly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bigquery-proj", "schema": "dbt_joe_dbt_test__audit", "fqn": ["github", "unique_github__quarterly_metrics_quarter"], "unique_id": "test.github.unique_github__quarterly_metrics_quarter.9165a921c1", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github", "path": "unique_github__quarterly_metrics_quarter.sql", "original_file_path": "models/github.yml", "name": "unique_github__quarterly_metrics_quarter", "alias": "unique_github__quarterly_metrics_quarter", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__quarterly_metrics"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__quarterly_metrics_quarter.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1644611543.126593, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select quarter as unique_field\n from `bigquery-proj`.`dbt_joe_github`.`github__quarterly_metrics`\n where quarter is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "quarter", "file_key_name": "models.github__quarterly_metrics"}, "test.github.not_null_github__quarterly_metrics_quarter.92394d46dc": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "quarter", "model": "{{ get_where_subquery(ref('github__quarterly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__quarterly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bigquery-proj", "schema": "dbt_joe_dbt_test__audit", "fqn": ["github", "not_null_github__quarterly_metrics_quarter"], "unique_id": "test.github.not_null_github__quarterly_metrics_quarter.92394d46dc", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github", "path": "not_null_github__quarterly_metrics_quarter.sql", "original_file_path": "models/github.yml", "name": "not_null_github__quarterly_metrics_quarter", "alias": "not_null_github__quarterly_metrics_quarter", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__quarterly_metrics"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__quarterly_metrics_quarter.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1644611543.128302, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery-proj`.`dbt_joe_github`.`github__quarterly_metrics`\nwhere quarter is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "quarter", "file_key_name": "models.github__quarterly_metrics"}, "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["issue_id", "user_id"], "model": "{{ get_where_subquery(ref('stg_github__issue_assignee')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue_assignee"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bigquery-proj", "schema": "dbt_joe_dbt_test__audit", "fqn": ["github_source", "dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id"], "unique_id": "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388.sql", "original_file_path": "models/stg_github.yml", "name": "dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id", "alias": "dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue_assignee"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388"}, "created_at": 1644611543.2118459, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n issue_id, user_id\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_assignee`\n group by issue_id, user_id\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_github__issue_assignee"}, "test.github_source.not_null_stg_github__label_label_id.9f07379974": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "label_id", "model": "{{ get_where_subquery(ref('stg_github__label')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__label"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bigquery-proj", "schema": "dbt_joe_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__label_label_id"], "unique_id": "test.github_source.not_null_stg_github__label_label_id.9f07379974", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "not_null_stg_github__label_label_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__label_label_id", "alias": "not_null_stg_github__label_label_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__label"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__label_label_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1644611543.2269871, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery-proj`.`dbt_joe_github`.`stg_github__label`\nwhere label_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "label_id", "file_key_name": "models.stg_github__label"}, "test.github_source.unique_stg_github__label_label_id.74d3c21466": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "label_id", "model": "{{ get_where_subquery(ref('stg_github__label')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__label"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bigquery-proj", "schema": "dbt_joe_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__label_label_id"], "unique_id": "test.github_source.unique_stg_github__label_label_id.74d3c21466", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "unique_stg_github__label_label_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__label_label_id", "alias": "unique_stg_github__label_label_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__label"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__label_label_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1644611543.228792, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select label_id as unique_field\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__label`\n where label_id is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "label_id", "file_key_name": "models.stg_github__label"}, "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d": {"raw_sql": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f\") }}", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["issue_id", "updated_at"], "model": "{{ get_where_subquery(ref('stg_github__issue_closed_history')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue_closed_history"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bigquery-proj", "schema": "dbt_joe_dbt_test__audit", "fqn": ["github_source", "dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at"], "unique_id": "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f.sql", "original_file_path": "models/stg_github.yml", "name": "dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at", "alias": "dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue_closed_history"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f"}, "created_at": 1644611543.230434, "compiled_sql": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n issue_id, updated_at\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_closed_history`\n group by issue_id, updated_at\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_github__issue_closed_history"}, "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "issue_comment_id", "model": "{{ get_where_subquery(ref('stg_github__issue_comment')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue_comment"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bigquery-proj", "schema": "dbt_joe_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__issue_comment_issue_comment_id"], "unique_id": "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "unique_stg_github__issue_comment_issue_comment_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__issue_comment_issue_comment_id", "alias": "unique_stg_github__issue_comment_issue_comment_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue_comment"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__issue_comment_issue_comment_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1644611543.235661, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select issue_comment_id as unique_field\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_comment`\n where issue_comment_id is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_comment_id", "file_key_name": "models.stg_github__issue_comment"}, "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "issue_comment_id", "model": "{{ get_where_subquery(ref('stg_github__issue_comment')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue_comment"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bigquery-proj", "schema": "dbt_joe_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__issue_comment_issue_comment_id"], "unique_id": "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "not_null_stg_github__issue_comment_issue_comment_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__issue_comment_issue_comment_id", "alias": "not_null_stg_github__issue_comment_issue_comment_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue_comment"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__issue_comment_issue_comment_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1644611543.237785, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery-proj`.`dbt_joe_github`.`stg_github__issue_comment`\nwhere issue_comment_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_comment_id", "file_key_name": "models.stg_github__issue_comment"}, "test.github_source.unique_stg_github__issue_issue_id.84891aeece": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('stg_github__issue')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bigquery-proj", "schema": "dbt_joe_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__issue_issue_id"], "unique_id": "test.github_source.unique_stg_github__issue_issue_id.84891aeece", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "unique_stg_github__issue_issue_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__issue_issue_id", "alias": "unique_stg_github__issue_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__issue_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1644611543.240138, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select issue_id as unique_field\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__issue`\n where issue_id is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.stg_github__issue"}, "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('stg_github__issue')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bigquery-proj", "schema": "dbt_joe_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__issue_issue_id"], "unique_id": "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "not_null_stg_github__issue_issue_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__issue_issue_id", "alias": "not_null_stg_github__issue_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__issue_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1644611543.2418509, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery-proj`.`dbt_joe_github`.`stg_github__issue`\nwhere issue_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.stg_github__issue"}, "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "pull_request_review_id", "model": "{{ get_where_subquery(ref('stg_github__pull_request_review')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__pull_request_review"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bigquery-proj", "schema": "dbt_joe_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__pull_request_review_pull_request_review_id"], "unique_id": "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "unique_stg_github__pull_request_review_pull_request_review_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__pull_request_review_pull_request_review_id", "alias": "unique_stg_github__pull_request_review_pull_request_review_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__pull_request_review"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__pull_request_review_pull_request_review_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1644611543.24348, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select pull_request_review_id as unique_field\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__pull_request_review`\n where pull_request_review_id is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "pull_request_review_id", "file_key_name": "models.stg_github__pull_request_review"}, "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "pull_request_review_id", "model": "{{ get_where_subquery(ref('stg_github__pull_request_review')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__pull_request_review"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bigquery-proj", "schema": "dbt_joe_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__pull_request_review_pull_request_review_id"], "unique_id": "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "not_null_stg_github__pull_request_review_pull_request_review_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__pull_request_review_pull_request_review_id", "alias": "not_null_stg_github__pull_request_review_pull_request_review_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__pull_request_review"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__pull_request_review_pull_request_review_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1644611543.2453911, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery-proj`.`dbt_joe_github`.`stg_github__pull_request_review`\nwhere pull_request_review_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "pull_request_review_id", "file_key_name": "models.stg_github__pull_request_review"}, "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "pull_request_id", "model": "{{ get_where_subquery(ref('stg_github__pull_request')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__pull_request"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bigquery-proj", "schema": "dbt_joe_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__pull_request_pull_request_id"], "unique_id": "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "unique_stg_github__pull_request_pull_request_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__pull_request_pull_request_id", "alias": "unique_stg_github__pull_request_pull_request_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__pull_request"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__pull_request_pull_request_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1644611543.247301, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select pull_request_id as unique_field\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__pull_request`\n where pull_request_id is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "pull_request_id", "file_key_name": "models.stg_github__pull_request"}, "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "pull_request_id", "model": "{{ get_where_subquery(ref('stg_github__pull_request')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__pull_request"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bigquery-proj", "schema": "dbt_joe_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__pull_request_pull_request_id"], "unique_id": "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "not_null_stg_github__pull_request_pull_request_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__pull_request_pull_request_id", "alias": "not_null_stg_github__pull_request_pull_request_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__pull_request"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__pull_request_pull_request_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1644611543.248928, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery-proj`.`dbt_joe_github`.`stg_github__pull_request`\nwhere pull_request_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "pull_request_id", "file_key_name": "models.stg_github__pull_request"}, "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "repository_id", "model": "{{ get_where_subquery(ref('stg_github__repo_team')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__repo_team"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bigquery-proj", "schema": "dbt_joe_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__repo_team_repository_id"], "unique_id": "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "not_null_stg_github__repo_team_repository_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__repo_team_repository_id", "alias": "not_null_stg_github__repo_team_repository_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__repo_team"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__repo_team_repository_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1644611543.2505732, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery-proj`.`dbt_joe_github`.`stg_github__repo_team`\nwhere repository_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "repository_id", "file_key_name": "models.stg_github__repo_team"}, "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "team_id", "model": "{{ get_where_subquery(ref('stg_github__repo_team')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__repo_team"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bigquery-proj", "schema": "dbt_joe_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__repo_team_team_id"], "unique_id": "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "not_null_stg_github__repo_team_team_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__repo_team_team_id", "alias": "not_null_stg_github__repo_team_team_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__repo_team"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__repo_team_team_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1644611543.252297, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery-proj`.`dbt_joe_github`.`stg_github__repo_team`\nwhere team_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "team_id", "file_key_name": "models.stg_github__repo_team"}, "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "repository_id", "model": "{{ get_where_subquery(ref('stg_github__repository')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__repository"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bigquery-proj", "schema": "dbt_joe_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__repository_repository_id"], "unique_id": "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "unique_stg_github__repository_repository_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__repository_repository_id", "alias": "unique_stg_github__repository_repository_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__repository"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__repository_repository_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1644611543.254095, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select repository_id as unique_field\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__repository`\n where repository_id is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "repository_id", "file_key_name": "models.stg_github__repository"}, "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "repository_id", "model": "{{ get_where_subquery(ref('stg_github__repository')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__repository"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bigquery-proj", "schema": "dbt_joe_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__repository_repository_id"], "unique_id": "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "not_null_stg_github__repository_repository_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__repository_repository_id", "alias": "not_null_stg_github__repository_repository_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__repository"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__repository_repository_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1644611543.2561028, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery-proj`.`dbt_joe_github`.`stg_github__repository`\nwhere repository_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "repository_id", "file_key_name": "models.stg_github__repository"}, "test.github_source.unique_stg_github__team_team_id.94e9716ab4": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "team_id", "model": "{{ get_where_subquery(ref('stg_github__team')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__team"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bigquery-proj", "schema": "dbt_joe_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__team_team_id"], "unique_id": "test.github_source.unique_stg_github__team_team_id.94e9716ab4", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "unique_stg_github__team_team_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__team_team_id", "alias": "unique_stg_github__team_team_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__team"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__team_team_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1644611543.257714, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select team_id as unique_field\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__team`\n where team_id is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "team_id", "file_key_name": "models.stg_github__team"}, "test.github_source.not_null_stg_github__team_team_id.440aefe7a7": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "team_id", "model": "{{ get_where_subquery(ref('stg_github__team')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__team"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bigquery-proj", "schema": "dbt_joe_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__team_team_id"], "unique_id": "test.github_source.not_null_stg_github__team_team_id.440aefe7a7", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "not_null_stg_github__team_team_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__team_team_id", "alias": "not_null_stg_github__team_team_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__team"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__team_team_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1644611543.259667, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery-proj`.`dbt_joe_github`.`stg_github__team`\nwhere team_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "team_id", "file_key_name": "models.stg_github__team"}, "test.github_source.unique_stg_github__user_user_id.5c1a00cd90": {"raw_sql": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "unique", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(ref('stg_github__user')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__user"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bigquery-proj", "schema": "dbt_joe_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__user_user_id"], "unique_id": "test.github_source.unique_stg_github__user_user_id.5c1a00cd90", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "unique_stg_github__user_user_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__user_user_id", "alias": "unique_stg_github__user_user_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__user"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__user_user_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1644611543.2615979, "compiled_sql": "\n \n \n\nwith dbt_test__target as (\n \n select user_id as unique_field\n from `bigquery-proj`.`dbt_joe_github`.`stg_github__user`\n where user_id is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "user_id", "file_key_name": "models.stg_github__user"}, "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b": {"raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(ref('stg_github__user')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__user"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "bigquery-proj", "schema": "dbt_joe_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__user_user_id"], "unique_id": "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "not_null_stg_github__user_user_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__user_user_id", "alias": "not_null_stg_github__user_user_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__user"]], "sources": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__user_user_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1644611543.263679, "compiled_sql": "\n \n \n\nselect *\nfrom `bigquery-proj`.`dbt_joe_github`.`stg_github__user`\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "user_id", "file_key_name": "models.stg_github__user"}}, "sources": {"source.github_source.github.issue_assignee": {"fqn": ["github_source", "github", "issue_assignee"], "database": "bigquery-proj", "schema": "github_new", "unique_id": "source.github_source.github.issue_assignee", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue_assignee", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "issue_assignee", "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": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table with the current user(s) assigned to an issue", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bigquery-proj`.`github_new`.`issue_assignee`", "created_at": 1644611543.264708}, "source.github_source.github.label": {"fqn": ["github_source", "github", "label"], "database": "bigquery-proj", "schema": "github_new", "unique_id": "source.github_source.github.label", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "label", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "label", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Table that contains labels that are used across your Github account within individual repositories.", "columns": {"id": {"name": "id", "description": "Unique identifier of the Github label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of the record being synced by Fivetran", "meta": {}, "data_type": null, "quote": null, "tags": []}, "color": {"name": "color", "description": "The color of the label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "The description of the label indicating the purpose", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_default": {"name": "is_default", "description": "Boolean flagging if the label is default on creation", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "Name of the label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url": {"name": "url", "description": "Url where the label was used", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bigquery-proj`.`github_new`.`label`", "created_at": 1644611543.2648902}, "source.github_source.github.issue_closed_history": {"fqn": ["github_source", "github", "issue_closed_history"], "database": "bigquery-proj", "schema": "github_new", "unique_id": "source.github_source.github.issue_closed_history", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue_closed_history", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "issue_closed_history", "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": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table to track when an issue is closed or re-opened", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the action took place", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed": {"name": "closed", "description": "Boolean variable for if the issue was closed (true) or re-opened (false)", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bigquery-proj`.`github_new`.`issue_closed_history`", "created_at": 1644611543.265049}, "source.github_source.github.issue_label": {"fqn": ["github_source", "github", "issue_label"], "database": "bigquery-proj", "schema": "github_new", "unique_id": "source.github_source.github.issue_label", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue_label", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "issue_label", "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": 168, "period": "hour"}, "filter": null}, "external": null, "description": "The current labels attached to an issue", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "label_id": {"name": "label_id", "description": "Unique identifier of the used label", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bigquery-proj`.`github_new`.`issue_label`", "created_at": 1644611543.265204}, "source.github_source.github.issue_comment": {"fqn": ["github_source", "github", "issue_comment"], "database": "bigquery-proj", "schema": "github_new", "unique_id": "source.github_source.github.issue_comment", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue_comment", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "issue_comment", "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": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table that contains comments made on issues", "columns": {"id": {"name": "id", "description": "System generated unique id for the issue comment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bigquery-proj`.`github_new`.`issue_comment`", "created_at": 1644611543.2653592}, "source.github_source.github.issue_merged": {"fqn": ["github_source", "github", "issue_merged"], "database": "bigquery-proj", "schema": "github_new", "unique_id": "source.github_source.github.issue_merged", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue_merged", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "issue_merged", "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": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table that tracks when an issue (always a pull request) is merged", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table. This table will only reference issues that are pull requests", "meta": {}, "data_type": null, "quote": null, "tags": []}, "merged_at": {"name": "merged_at", "description": "Timestamp of when the code merge took place", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bigquery-proj`.`github_new`.`issue_merged`", "created_at": 1644611543.2655098}, "source.github_source.github.issue": {"fqn": ["github_source", "github", "issue"], "database": "bigquery-proj", "schema": "github_new", "unique_id": "source.github_source.github.issue", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "issue", "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": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table that contains 1 entry for every issue created. Pull Requests also create an entry in this table, and there is a boolean field to determine if an entry is a pull request.", "columns": {"id": {"name": "id", "description": "System generated unique id for the issue. This is not the number that appears in the URL.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "body": {"name": "body", "description": "The text of the main description of the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "locked": {"name": "locked", "description": "Boolean indicating whether the issue is locked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed_at": {"name": "closed_at", "description": "Timestamp of when the issue was closed, NULL for issues that are open.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the issue was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "milestone_id": {"name": "milestone_id", "description": "Foreign key that references the milestone table representing the current milestone the issue is in.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number": {"name": "number", "description": "The issue number within a repository. Is unique by repository, but not across repositories.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pull_request": {"name": "pull_request", "description": "Boolean for is the issue is a pull request (true) ot regular issue (false)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_id": {"name": "repository_id", "description": "Foreign key that references the repository table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the issue is open or closed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "Title of the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the last update was made to the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table, representing the user that created the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bigquery-proj`.`github_new`.`issue`", "created_at": 1644611543.2656791}, "source.github_source.github.pull_request_review": {"fqn": ["github_source", "github", "pull_request_review"], "database": "bigquery-proj", "schema": "github_new", "unique_id": "source.github_source.github.pull_request_review", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "pull_request_review", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "pull_request_review", "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": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table containing reviews made to pull requests", "columns": {"id": {"name": "id", "description": "System generated unique id for the pull request review.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pull_request_id": {"name": "pull_request_id", "description": "Foreign key that references the pull request table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "submitted_at": {"name": "submitted_at", "description": "Timestamp of when the request for review was submitted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the review was an approval, request for change, comment, dismissal.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table, representing the user that reviewed the pull request.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bigquery-proj`.`github_new`.`pull_request_review`", "created_at": 1644611543.265834}, "source.github_source.github.pull_request": {"fqn": ["github_source", "github", "pull_request"], "database": "bigquery-proj", "schema": "github_new", "unique_id": "source.github_source.github.pull_request", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "pull_request", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "pull_request", "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": 168, "period": "hour"}, "filter": null}, "external": null, "description": "A special type of issue that is created when a user wants to merge one branch of code into another", "columns": {"id": {"name": "id", "description": "System generated unique id for the pull request.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "head_repo_id": {"name": "head_repo_id", "description": "Foreign key that references the repository table, referencing the current branch.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "head_user_id": {"name": "head_user_id", "description": "Foreign key that references the user table, referencing who created the current branch.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bigquery-proj`.`github_new`.`pull_request`", "created_at": 1644611543.265986}, "source.github_source.github.repo_team": {"fqn": ["github_source", "github", "repo_team"], "database": "bigquery-proj", "schema": "github_new", "unique_id": "source.github_source.github.repo_team", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "repo_team", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "repo_team", "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": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table representing the mapping relationships between repositories and teams", "columns": {"repository_id": {"name": "repository_id", "description": "Reference to the respective repository for the record.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "team_id": {"name": "team_id", "description": "Reference to the respective team for the record.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {"is_enabled": true}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bigquery-proj`.`github_new`.`repo_team`", "created_at": 1644611543.2661362}, "source.github_source.github.repository": {"fqn": ["github_source", "github", "repository"], "database": "bigquery-proj", "schema": "github_new", "unique_id": "source.github_source.github.repository", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "repository", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "repository", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Table representing the file structure of a directory under git control", "columns": {"id": {"name": "id", "description": "System generated unique id for the repository.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the repository was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "full_name": {"name": "full_name", "description": "The name of the git repository.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "private": {"name": "private", "description": "Boolean field indicating whether the repository is private (true) or public (false).", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bigquery-proj`.`github_new`.`repository`", "created_at": 1644611543.26628}, "source.github_source.github.requested_reviewer_history": {"fqn": ["github_source", "github", "requested_reviewer_history"], "database": "bigquery-proj", "schema": "github_new", "unique_id": "source.github_source.github.requested_reviewer_history", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "requested_reviewer_history", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "requested_reviewer_history", "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": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table containing when a user requests another user to review a pull request", "columns": {"pull_request_id": {"name": "pull_request_id", "description": "Foreign key that references the pull request table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the review was submitted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "requested_id": {"name": "requested_id", "description": "Foreign key that references the user table, representing the user that was requested to review a PR.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "removed": {"name": "removed", "description": "Boolean variable indicating if the requester was removed from the PR (true) or added to the PR (false).", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bigquery-proj`.`github_new`.`requested_reviewer_history`", "created_at": 1644611543.266429}, "source.github_source.github.team": {"fqn": ["github_source", "github", "team"], "database": "bigquery-proj", "schema": "github_new", "unique_id": "source.github_source.github.team", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "team", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "team", "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": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table containing teams and team details", "columns": {"id": {"name": "id", "description": "System generated unique id for the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "User created description of the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "User created name of the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "Reference to the parent team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "privacy": {"name": "privacy", "description": "Type of privacy permissions associated with the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "slug": {"name": "slug", "description": "Url friendly version of the team name.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bigquery-proj`.`github_new`.`team`", "created_at": 1644611543.2665842}, "source.github_source.github.user": {"fqn": ["github_source", "github", "user"], "database": "bigquery-proj", "schema": "github_new", "unique_id": "source.github_source.github.user", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "user", "source_name": "github", "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 representing contributors to a git project", "columns": {"id": {"name": "id", "description": "System generated unique id for the user.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "login": {"name": "login", "description": "The alias the user uses to login to github.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the user", "meta": {}, "data_type": null, "quote": null, "tags": []}, "company": {"name": "company", "description": "The company of the user.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`bigquery-proj`.`github_new`.`user`", "created_at": 1644611543.266727}}, "macros": {"macro.development.collect_freshness": {"unique_id": "macro.development.collect_freshness", "package_name": "development", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "name": "collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %} \n {{ return(adapter_macro('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": [], "created_at": 1644611541.281557}, "macro.development.default__collect_freshness": {"unique_id": "macro.development.default__collect_freshness", "package_name": "development", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "name": "default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %} \n {% if var('hubspot_email_event_enabled') == true %}\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 {% else %}\n null\n {% endif %}\n {% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.2831192}, "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": [], "created_at": 1644611541.284085}, "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": [], "created_at": 1644611541.2846851}, "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": [], "created_at": 1644611541.285447}, "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": ["macro.dbt_utils.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.2917829}, "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": [], "created_at": 1644611541.301004}, "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", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.30205}, "macro.dbt_bigquery.bigquery_options": {"unique_id": "macro.dbt_bigquery.bigquery_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_options", "macro_sql": "{% macro bigquery_options(opts) %}\n {% set options -%}\n OPTIONS({% for opt_key, opt_val in opts.items() %}\n {{ opt_key }}={{ opt_val }}{{ \",\" if not loop.last }}\n {% endfor %})\n {%- endset %}\n {%- do return(options) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.302955}, "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 {%- do return(bigquery_options(opts)) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_options"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.303613}, "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": ["macro.dbt_bigquery.partition_by", "macro.dbt_bigquery.cluster_by", "macro.dbt_bigquery.bigquery_table_options"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.3058062}, "macro.dbt_bigquery.bigquery_view_options": {"unique_id": "macro.dbt_bigquery.bigquery_view_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_view_options", "macro_sql": "{% macro bigquery_view_options(config, node) %}\n {% set opts = adapter.get_view_options(config, node) %}\n {%- do return(bigquery_options(opts)) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_options"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.306423}, "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_view_options(config, model) }}\n as {{ sql }};\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_view_options"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.30724}, "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": [], "created_at": 1644611541.307574}, "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": [], "created_at": 1644611541.307907}, "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": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.308403}, "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": [], "created_at": 1644611541.308795}, "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": [], "created_at": 1644611541.30928}, "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": [], "created_at": 1644611541.309483}, "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": [], "created_at": 1644611541.309943}, "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": [], "created_at": 1644611541.310326}, "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": [], "created_at": 1644611541.310803}, "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": ["macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.311622}, "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": [], "created_at": 1644611541.312042}, "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": [], "created_at": 1644611541.312737}, "macro.dbt_bigquery.bigquery__alter_relation_add_columns": {"unique_id": "macro.dbt_bigquery.bigquery__alter_relation_add_columns", "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_relation_add_columns", "macro_sql": "{% macro bigquery__alter_relation_add_columns(relation, add_columns) %}\n \n {% set sql -%}\n \n alter {{ relation.type }} {{ relation }}\n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}\n \n {%- endset -%}\n\n {{ return(run_query(sql)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.3138509}, "macro.dbt_bigquery.bigquery__alter_relation_drop_columns": {"unique_id": "macro.dbt_bigquery.bigquery__alter_relation_drop_columns", "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_relation_drop_columns", "macro_sql": "{% macro bigquery__alter_relation_drop_columns(relation, drop_columns) %}\n \n {% set sql -%}\n \n alter {{ relation.type }} {{ relation }}\n\n {% for column in drop_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n \n {%- endset -%}\n \n {{ return(run_query(sql)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.3148181}, "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 {#-- Changing a column's data type using a query requires you to scan the entire table.\n The query charges can be significant if the table is very large.\n\n https://cloud.google.com/bigquery/docs/manually-changing-schemas#changing_a_columns_data_type\n #}\n {% set relation_columns = get_columns_in_relation(relation) %}\n\n {% set sql %}\n select\n {%- for col in relation_columns -%}\n {% if col.column == column_name %}\n CAST({{ col.quoted }} AS {{ new_column_type }}) AS {{ col.quoted }}\n {%- else %}\n {{ col.quoted }}\n {%- endif %}\n {%- if not loop.last %},{% endif -%}\n {%- endfor %}\n from {{ relation }}\n {% endset %}\n\n {% call statement('alter_column_type') %}\n {{ create_table_as(False, relation, sql)}}\n {%- endcall %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_columns_in_relation", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.316493}, "macro.dbt_bigquery.bigquery__test_unique": {"unique_id": "macro.dbt_bigquery.bigquery__test_unique", "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__test_unique", "macro_sql": "{% macro bigquery__test_unique(model, column_name) %}\n\nwith dbt_test__target as (\n \n select {{ column_name }} as unique_field\n from {{ model }}\n where {{ column_name }} is not null\n \n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.3169138}, "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": [], "created_at": 1644611541.317751}, "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": [], "created_at": 1644611541.318159}, "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": [], "created_at": 1644611541.31971}, "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": [], "created_at": 1644611541.321022}, "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() %}\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": ["macro.dbt.create_or_replace_view", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.323265}, "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\n {{ run_hooks(pre_hooks) }}\n\n {#\n We only need to drop this thing if it is not a table.\n If it _is_ already a table, then we can overwrite it without downtime\n Unlike table -> view, no need for `--full-refresh`: dropping a view is no big deal\n #}\n {%- if exists_not_as_table -%}\n {{ adapter.drop_relation(old_relation) }}\n {%- endif -%}\n\n -- build model\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set partition_by = adapter.parse_partition_by(raw_partition_by) -%}\n {%- set cluster_by = config.get('cluster_by', none) -%}\n {% if not adapter.is_replaceable(old_relation, partition_by, cluster_by) %}\n {% do log(\"Hard refreshing \" ~ old_relation ~ \" because it is not replaceable\") %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n {% call statement('main') -%}\n {{ create_table_as(False, target_relation, sql) }}\n {% endcall -%}\n\n {{ run_hooks(post_hooks) }}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.328373}, "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 {% set destination = this.incorporate(type='table') %}\n\n {# there can be several ref() or source() according to BQ copy API docs #}\n {# cycle over ref() and source() to create source tables array #}\n {% set source_array = [] %}\n {% for ref_table in model.refs %}\n {{ source_array.append(ref(*ref_table)) }}\n {% endfor %}\n\n {% for src_table in model.sources %}\n {{ source_array.append(source(*src_table)) }}\n {% endfor %}\n\n {# Call adapter's copy_table function #}\n {%- set result_str = adapter.copy_table(\n source_array,\n destination,\n config.get('copy_materialization', default = 'table')) -%}\n\n {{ store_result('main', response=result_str) }}\n\n {# Clean up #}\n {{ run_hooks(post_hooks) }}\n {{ adapter.commit() }}\n\n {{ return({'relations': [destination]}) }}\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.3313}, "macro.dbt_bigquery.declare_dbt_max_partition": {"unique_id": "macro.dbt_bigquery.declare_dbt_max_partition", "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": "declare_dbt_max_partition", "macro_sql": "{% macro declare_dbt_max_partition(relation, partition_by, sql) %}\n\n {% if '_dbt_max_partition' in sql %}\n\n declare _dbt_max_partition {{ partition_by.data_type }} default (\n select max({{ partition_by.field }}) from {{ this }}\n where {{ partition_by.field }} is not null\n );\n \n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.3347478}, "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": [], "created_at": 1644611541.3358872}, "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(\n tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n) %}\n\n {% if partitions is not none and partitions != [] %} {# static #}\n\n {% set predicate -%}\n {{ partition_by.render(alias='DBT_INTERNAL_DEST') }} in (\n {{ partitions | join (', ') }}\n )\n {%- endset %}\n\n {%- set source_sql -%}\n (\n {{sql}}\n )\n {%- endset -%}\n\n {{ get_insert_overwrite_merge_sql(target_relation, source_sql, dest_columns, [predicate], include_sql_header=true) }}\n\n {% else %} {# dynamic #}\n\n {% set predicate -%}\n {{ partition_by.render(alias='DBT_INTERNAL_DEST') }} in unnest(dbt_partitions_for_replacement)\n {%- endset %}\n\n {%- set source_sql -%}\n (\n select * from {{ tmp_relation }}\n )\n {%- endset -%}\n\n -- generated script to merge partitions into {{ target_relation }}\n declare dbt_partitions_for_replacement array<{{ partition_by.data_type }}>;\n\n {# have we already created the temp table to check for schema changes? #}\n {% if not tmp_relation_exists %}\n {{ declare_dbt_max_partition(this, partition_by, sql) }}\n \n -- 1. create a temp table\n {{ create_table_as(True, tmp_relation, sql) }}\n {% else %}\n -- 1. temp table already exists, we used it to check for schema changes\n {% endif %}\n\n -- 2. define partitions to update\n set (dbt_partitions_for_replacement) = (\n select as struct\n array_agg(distinct {{ partition_by.render() }})\n from {{ tmp_relation }}\n );\n\n {#\n TODO: include_sql_header is a hack; consider a better approach that includes\n the sql_header at the materialization-level instead\n #}\n -- 3. run the merge statement\n {{ get_insert_overwrite_merge_sql(target_relation, source_sql, dest_columns, [predicate], include_sql_header=false) }};\n\n -- 4. clean up the temp table\n drop table if exists {{ tmp_relation }}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql", "macro.dbt_bigquery.declare_dbt_max_partition", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.34039}, "macro.dbt_bigquery.bq_generate_incremental_build_sql": {"unique_id": "macro.dbt_bigquery.bq_generate_incremental_build_sql", "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_generate_incremental_build_sql", "macro_sql": "{% macro bq_generate_incremental_build_sql(\n strategy, tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n) %}\n {#-- if partitioned, use BQ scripting to get the range of partition values to be updated --#}\n {% if strategy == 'insert_overwrite' %}\n\n {% set missing_partition_msg -%}\n The 'insert_overwrite' strategy requires the `partition_by` config.\n {%- endset %}\n {% if partition_by is none %}\n {% do exceptions.raise_compiler_error(missing_partition_msg) %}\n {% endif %}\n\n {% set build_sql = bq_insert_overwrite(\n tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, on_schema_change\n ) %}\n\n {% else %} {# strategy == 'merge' #}\n {%- set source_sql -%}\n {%- if tmp_relation_exists -%}\n (\n select * from {{ tmp_relation }}\n )\n {%- else -%} {#-- wrap sql in parens to make it a subquery --#}\n (\n {{sql}}\n )\n {%- endif -%}\n {%- endset -%}\n\n {% set build_sql = get_merge_sql(target_relation, source_sql, unique_key, dest_columns) %}\n\n {% endif %}\n\n {{ return(build_sql) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bq_insert_overwrite", "macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.342567}, "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 {% set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') %}\n\n {{ run_hooks(pre_hooks) }}\n\n {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n \n {% elif existing_relation.is_view %}\n {#-- There's no way to atomically replace a view with a table on BQ --#}\n {{ adapter.drop_relation(existing_relation) }}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n \n {% elif full_refresh_mode %}\n {#-- If the partition/cluster config has changed, then we must drop and recreate --#}\n {% if not adapter.is_replaceable(existing_relation, partition_by, cluster_by) %}\n {% do log(\"Hard refreshing \" ~ existing_relation ~ \" because it is not replaceable\") %}\n {{ adapter.drop_relation(existing_relation) }}\n {% endif %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n \n {% else %}\n {% set tmp_relation_exists = false %}\n {% if on_schema_change != 'ignore' %} {# Check first, since otherwise we may not build a temp table #}\n {% do run_query(\n declare_dbt_max_partition(this, partition_by, sql) + create_table_as(True, tmp_relation, sql)\n ) %}\n {% set tmp_relation_exists = true %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, tmp_relation, existing_relation) %}\n {% endif %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n {% set build_sql = bq_generate_incremental_build_sql(\n strategy, tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n ) %}\n\n {% endif %}\n\n {%- call statement('main') -%}\n {{ build_sql }}\n {% endcall %}\n\n {{ run_hooks(post_hooks) }}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.load_relation", "macro.dbt.make_temp_relation", "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.run_hooks", "macro.dbt.create_table_as", "macro.dbt.run_query", "macro.dbt_bigquery.declare_dbt_max_partition", "macro.dbt.process_schema_changes", "macro.dbt_bigquery.bq_generate_incremental_build_sql", "macro.dbt.statement", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.349196}, "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": [], "created_at": 1644611541.350293}, "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": [], "created_at": 1644611541.350688}, "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": ["macro.dbt.drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.351027}, "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/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.3542368}, "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/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.355495}, "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/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.356182}, "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/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.356559}, "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/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.3569322}, "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/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.3579452}, "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/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.358735}, "macro.dbt.should_store_failures": {"unique_id": "macro.dbt.should_store_failures", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.359531}, "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/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "name": "snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.360594}, "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/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "name": "default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.dbt_scd_id = DBT_INTERNAL_DEST.dbt_scd_id\n\n when matched\n and DBT_INTERNAL_DEST.dbt_valid_to is null\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.36128}, "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/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "strategy_dispatch", "macro_sql": "{% macro strategy_dispatch(name) -%}\n{% set original_name = name %}\n {% if '.' in name %}\n {% set package_name, name = name.split(\".\", 1) %}\n {% else %}\n {% set package_name = none %}\n {% endif %}\n\n {% if package_name is none %}\n {% set package_context = context %}\n {% elif package_name in context %}\n {% set package_context = context[package_name] %}\n {% else %}\n {% set error_msg %}\n Could not find package '{{package_name}}', called with '{{original_name}}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n\n {%- set search_name = 'snapshot_' ~ name ~ '_strategy' -%}\n\n {% if search_name not in package_context %}\n {% set error_msg %}\n The specified strategy macro '{{name}}' was not found in package '{{ package_name }}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n {{ return(package_context[search_name]) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.3683898}, "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/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments', 'dbt')(args) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.3688262}, "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/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "default__snapshot_hash_arguments", "macro_sql": "{% macro default__snapshot_hash_arguments(args) -%}\n md5({%- for arg in args -%}\n coalesce(cast({{ arg }} as varchar ), '')\n {% if not loop.last %} || '|' || {% endif %}\n {%- endfor -%})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.369428}, "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/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_get_time", "macro_sql": "{% macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.3698728}, "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/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() -%}\n {{ current_timestamp() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.3703349}, "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/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_timestamp_strategy", "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set primary_key = config['unique_key'] %}\n {% set updated_at = config['updated_at'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/dbt-labs/dbt-core/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.dbt_valid_from < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.3729742}, "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/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time', 'dbt')(timestamp) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.3734038}, "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/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "default__snapshot_string_as_time", "macro_sql": "{% macro default__snapshot_string_as_time(timestamp) %}\n {% do exceptions.raise_not_implemented(\n 'snapshot_string_as_time macro not implemented for adapter '+adapter.type()\n ) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.373861}, "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/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists) -%}\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": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.377116}, "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/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set check_cols_config = config['check_cols'] %}\n {% set primary_key = config['unique_key'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n \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 = config.get('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": ["macro.dbt.snapshot_get_time", "macro.dbt.run_query", "macro.dbt.snapshot_string_as_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.385139}, "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/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns', 'dbt')(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.391226}, "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/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation }} add column \"{{ column.name }}\" {{ column.data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.39209}, "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/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.392756}, "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/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.393038}, "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/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "snapshot_staging_table", "macro_sql": "{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {{ adapter.dispatch('snapshot_staging_table', 'dbt')(strategy, source_sql, target_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_staging_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.393653}, "macro.dbt.default__snapshot_staging_table": {"unique_id": "macro.dbt.default__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/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__snapshot_staging_table", "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *,\n {{ strategy.unique_key }} as dbt_unique_key\n\n from {{ target_relation }}\n where dbt_valid_to is null\n\n ),\n\n insertions_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to,\n {{ strategy.scd_id }} as dbt_scd_id\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n {{ strategy.updated_at }} as dbt_valid_to\n\n from snapshot_query\n ),\n\n {%- if strategy.invalidate_hard_deletes %}\n\n deletes_source_data as (\n\n select \n *,\n {{ strategy.unique_key }} as dbt_unique_key\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from insertions_source_data as source_data\n left outer join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_unique_key is null\n or (\n snapshotted_data.dbt_unique_key is not null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.dbt_scd_id\n\n from updates_source_data as source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where (\n {{ strategy.row_changed }}\n )\n )\n\n {%- if strategy.invalidate_hard_deletes -%}\n ,\n\n deletes as (\n \n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as dbt_valid_from,\n {{ snapshot_get_time() }} as dbt_updated_at,\n {{ snapshot_get_time() }} as dbt_valid_to,\n snapshotted_data.dbt_scd_id\n \n from snapshotted_data\n left join deletes_source_data as source_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where source_data.dbt_unique_key is null\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.invalidate_hard_deletes %}\n union all\n select * from deletes\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.3961668}, "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/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) -%}\n {{ adapter.dispatch('build_snapshot_table', 'dbt')(strategy, sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__build_snapshot_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.396728}, "macro.dbt.default__build_snapshot_table": {"unique_id": "macro.dbt.default__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/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__build_snapshot_table", "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.397481}, "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/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set 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": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.398756}, "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/snapshots/snapshot.sql", "original_file_path": "macros/materializations/snapshots/snapshot.sql", "name": "materialization_snapshot_default", "macro_sql": "{% materialization snapshot, default %}\n {%- set config = model['config'] -%}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n\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 {% if not target_relation_exists %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if staging_table is defined %}\n {% do post_snapshot(staging_table) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_schema", "macro.dbt.get_or_create_relation", "macro.dbt.run_hooks", "macro.dbt.strategy_dispatch", "macro.dbt.build_snapshot_table", "macro.dbt.create_table_as", "macro.dbt.build_snapshot_staging_table", "macro.dbt.create_columns", "macro.dbt.snapshot_merge_sql", "macro.dbt.statement", "macro.dbt.persist_docs", "macro.dbt.create_indexes", "macro.dbt.post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.413045}, "macro.dbt.materialization_test_default": {"unique_id": "macro.dbt.materialization_test_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/tests/test.sql", "original_file_path": "macros/materializations/tests/test.sql", "name": "materialization_test_default", "macro_sql": "{%- materialization test, default -%}\n\n {% set relations = [] %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type='table') -%} %}\n \n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n \n {% call statement(auto_begin=True) %}\n {{ create_table_as(False, target_relation, sql) }}\n {% endcall %}\n \n {% do relations.append(target_relation) %}\n \n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n \n {{ adapter.commit() }}\n \n {% else %}\n\n {% set main_sql = sql %}\n \n {% endif %}\n\n {% set limit = config.get('limit') %}\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit)}}\n\n {%- endcall %}\n \n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.417961}, "macro.dbt.get_test_sql": {"unique_id": "macro.dbt.get_test_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/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "name": "get_test_sql", "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql', 'dbt')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.4191449}, "macro.dbt.default__get_test_sql": {"unique_id": "macro.dbt.default__get_test_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/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "name": "default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.420243}, "macro.dbt.get_where_subquery": {"unique_id": "macro.dbt.get_where_subquery", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "name": "get_where_subquery", "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_where_subquery"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.4214919}, "macro.dbt.default__get_where_subquery": {"unique_id": "macro.dbt.default__get_where_subquery", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "name": "default__get_where_subquery", "macro_sql": "{% macro default__get_where_subquery(relation) -%}\n {% set where = config.get('where', '') %}\n {% if where %}\n {%- set filtered -%}\n (select * from {{ relation }} where {{ where }}) dbt_subquery\n {%- endset -%}\n {% do return(filtered) %}\n {%- else -%}\n {% do return(relation) %}\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.422636}, "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/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\n \n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.424581}, "macro.dbt.diff_columns": {"unique_id": "macro.dbt.diff_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/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "diff_columns", "macro_sql": "{% macro diff_columns(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% set source_names = source_columns | map(attribute = 'column') | list %}\n {% set target_names = target_columns | map(attribute = 'column') | list %}\n \n {# --check whether the name attribute exists in the target - this does not perform a data type check #}\n {% for sc in source_columns %}\n {% if sc.name not in target_names %}\n {{ result.append(sc) }}\n {% endif %}\n {% endfor %}\n \n {{ return(result) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.426014}, "macro.dbt.diff_column_data_types": {"unique_id": "macro.dbt.diff_column_data_types", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "diff_column_data_types", "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n \n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.data_type != tc.data_type %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.data_type } ) }} \n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.427649}, "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/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, predicates=none) -%}\n {{ adapter.dispatch('get_merge_sql', 'dbt')(target, source, unique_key, dest_columns, predicates) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.432354}, "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/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, predicates) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set update_columns = config.get('merge_update_columns', default = dest_columns | map(attribute=\"quoted\") | list) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% 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_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.435924}, "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/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql', 'dbt')(target, source, unique_key, dest_columns) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.4365172}, "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/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key 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": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.438313}, "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/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql', 'dbt')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.439253}, "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/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.4409559}, "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/materializations/models/incremental/is_incremental.sql", "original_file_path": "macros/materializations/models/incremental/is_incremental.sql", "name": "is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.442655}, "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/models/incremental/incremental.sql", "original_file_path": "macros/materializations/models/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(target_relation) %}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {% set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') %}\n\n {% set tmp_identifier = model['name'] + '__dbt_tmp' %}\n {% set backup_identifier = model['name'] + \"__dbt_backup\" %}\n\n -- the intermediate_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {% set preexisting_intermediate_relation = adapter.get_relation(identifier=tmp_identifier, \n schema=schema,\n database=database) %} \n {% set preexisting_backup_relation = adapter.get_relation(identifier=backup_identifier,\n schema=schema,\n database=database) %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {# -- first check whether we want to full refresh for source view or config reasons #}\n {% set trigger_full_refresh = (full_refresh_mode or existing_relation.is_view) %}\n\n {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n{% elif trigger_full_refresh %}\n {#-- Make sure the backup doesn't exist so we don't encounter issues with the rename below #}\n {% set tmp_identifier = model['name'] + '__dbt_tmp' %}\n {% set backup_identifier = model['name'] + '__dbt_backup' %}\n {% set intermediate_relation = existing_relation.incorporate(path={\"identifier\": tmp_identifier}) %}\n {% set backup_relation = existing_relation.incorporate(path={\"identifier\": backup_identifier}) %}\n\n {% set build_sql = create_table_as(False, intermediate_relation, sql) %}\n {% set need_swap = true %}\n {% do to_drop.append(backup_relation) %}\n {% else %}\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 {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, tmp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n {% set build_sql = get_delete_insert_merge_sql(target_relation, tmp_relation, unique_key, dest_columns) %}\n \n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if need_swap %} \n {% do adapter.rename_relation(target_relation, backup_relation) %} \n {% do adapter.rename_relation(intermediate_relation, target_relation) %} \n {% endif %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_relation", "macro.dbt.make_temp_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.create_table_as", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.get_delete_insert_merge_sql", "macro.dbt.statement", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.454293}, "macro.dbt.incremental_validate_on_schema_change": {"unique_id": "macro.dbt.incremental_validate_on_schema_change", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "incremental_validate_on_schema_change", "macro_sql": "{% macro incremental_validate_on_schema_change(on_schema_change, default='ignore') %}\n \n {% if on_schema_change not in ['sync_all_columns', 'append_new_columns', 'fail', 'ignore'] %}\n \n {% set log_message = 'Invalid value for on_schema_change (%s) specified. Setting default value of %s.' % (on_schema_change, default) %}\n {% do log(log_message) %}\n \n {{ return(default) }}\n\n {% else %}\n\n {{ return(on_schema_change) }}\n \n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.463076}, "macro.dbt.check_for_schema_changes": {"unique_id": "macro.dbt.check_for_schema_changes", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "check_for_schema_changes", "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n \n {% set schema_changed = False %}\n \n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n \n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n \n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.diff_columns", "macro.dbt.diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.4662101}, "macro.dbt.sync_column_schemas": {"unique_id": "macro.dbt.sync_column_schemas", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "sync_column_schemas", "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n \n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n \n {% elif on_schema_change == 'sync_all_columns' %}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n \n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %} \n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n \n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n \n {% do log(schema_change_message) %}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.alter_relation_add_remove_columns", "macro.dbt.alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.469273}, "macro.dbt.process_schema_changes": {"unique_id": "macro.dbt.process_schema_changes", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "process_schema_changes", "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n \n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n \n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n \n {% if schema_changes_dict['schema_changed'] %}\n \n {% if on_schema_change == 'fail' %}\n \n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways: \n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n {% endset %}\n \n {% do exceptions.raise_compiler_error(fail_msg) %}\n \n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n \n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n \n {% endif %}\n \n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n \n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.47194}, "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/models/table/table.sql", "original_file_path": "macros/materializations/models/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 -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = adapter.get_relation(identifier=tmp_identifier, \n schema=schema,\n database=database) -%}\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 -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = adapter.get_relation(identifier=backup_identifier,\n schema=schema,\n database=database) -%}\n\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if old_relation is not none %}\n {{ adapter.rename_relation(old_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do create_indexes(target_relation) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.get_create_table_as_sql", "macro.dbt.create_indexes", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.4808}, "macro.dbt.get_create_table_as_sql": {"unique_id": "macro.dbt.get_create_table_as_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/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "get_create_table_as_sql", "macro_sql": "{% macro get_create_table_as_sql(temporary, relation, sql) -%}\n {{ adapter.dispatch('get_create_table_as_sql', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_table_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.481921}, "macro.dbt.default__get_create_table_as_sql": {"unique_id": "macro.dbt.default__get_create_table_as_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/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "default__get_create_table_as_sql", "macro_sql": "{% macro default__get_create_table_as_sql(temporary, relation, sql) -%}\n {{ return(create_table_as(temporary, relation, sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.48239}, "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/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.48295}, "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/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n \n {{ sql_header if sql_header is not none }}\n \n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.483986}, "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/models/view/view.sql", "original_file_path": "macros/materializations/models/view/view.sql", "name": "materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set 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 -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = adapter.get_relation(identifier=tmp_identifier, \n schema=schema,\n database=database) -%}\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 -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = adapter.get_relation(identifier=backup_identifier,\n schema=schema,\n database=database) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ 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(old_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": ["macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.create_view_as", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.4926322}, "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/models/view/helpers.sql", "original_file_path": "macros/materializations/models/view/helpers.sql", "name": "handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.493546}, "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/models/view/helpers.sql", "original_file_path": "macros/materializations/models/view/helpers.sql", "name": "default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.494113}, "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/models/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/models/view/create_or_replace_view.sql", "name": "create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\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 {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.496982}, "macro.dbt.get_create_view_as_sql": {"unique_id": "macro.dbt.get_create_view_as_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/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "get_create_view_as_sql", "macro_sql": "{% macro get_create_view_as_sql(relation, sql) -%}\n {{ adapter.dispatch('get_create_view_as_sql', 'dbt')(relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.498048}, "macro.dbt.default__get_create_view_as_sql": {"unique_id": "macro.dbt.default__get_create_view_as_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/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "default__get_create_view_as_sql", "macro_sql": "{% macro default__get_create_view_as_sql(relation, sql) -%}\n {{ return(create_view_as(relation, sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.4984791}, "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/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.498999}, "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/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation }} as (\n {{ sql }}\n );\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.499711}, "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/seeds/seed.sql", "original_file_path": "macros/materializations/seeds/seed.sql", "name": "materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set 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 {% if full_refresh_mode or not exists_as_table %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.run_hooks", "macro.dbt.reset_csv_table", "macro.dbt.create_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.noop_statement", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.5069141}, "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/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.5136719}, "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/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.515968}, "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/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table', 'dbt')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.516551}, "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/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.517788}, "macro.dbt.get_binding_char": {"unique_id": "macro.dbt.get_binding_char", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_binding_char", "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.5181508}, "macro.dbt.default__get_binding_char": {"unique_id": "macro.dbt.default__get_binding_char", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_binding_char", "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.518448}, "macro.dbt.get_batch_size": {"unique_id": "macro.dbt.get_batch_size", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_batch_size", "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_batch_size"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.518851}, "macro.dbt.default__get_batch_size": {"unique_id": "macro.dbt.default__get_batch_size", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_batch_size", "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.519146}, "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/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.5206258}, "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/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.521133}, "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/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n\n {% set batch_size = get_batch_size() %}\n\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.524639}, "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/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "name": "generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_alias_name', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_alias_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.525988}, "macro.dbt.default__generate_alias_name": {"unique_id": "macro.dbt.default__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/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "name": "default__generate_alias_name", "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name is none -%}\n\n {{ node.name }}\n\n {%- else -%}\n\n {{ custom_alias_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.526649}, "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/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name=none, node=none) -%}\n {{ return(adapter.dispatch('generate_schema_name', 'dbt')(custom_schema_name, node)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.5278878}, "macro.dbt.default__generate_schema_name": {"unique_id": "macro.dbt.default__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/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.528565}, "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/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.5293021}, "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/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "name": "generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name', 'dbt')(custom_database_name, node)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.5303302}, "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/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "name": "default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.5309818}, "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/generic_test_sql/relationships.sql", "original_file_path": "macros/generic_test_sql/relationships.sql", "name": "default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.531918}, "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/generic_test_sql/not_null.sql", "original_file_path": "macros/generic_test_sql/not_null.sql", "name": "default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\nselect *\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": [], "created_at": 1644611541.5325089}, "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/generic_test_sql/unique.sql", "original_file_path": "macros/generic_test_sql/unique.sql", "name": "default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.5332658}, "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/generic_test_sql/accepted_values.sql", "original_file_path": "macros/generic_test_sql/accepted_values.sql", "name": "default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by {{ column_name }}\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.5348558}, "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/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "statement", "macro_sql": "{% macro statement(name=None, fetch_result=False, auto_begin=True) -%}\n {%- if execute: -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- set res, table = adapter.execute(sql, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.538155}, "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/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.540192}, "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/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.540949}, "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": [], "created_at": 1644611541.544221}, "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": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.5472798}, "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": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.549184}, "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": [], "created_at": 1644611541.549782}, "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/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema', 'dbt')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.550745}, "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/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.551342}, "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/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.5517812}, "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/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.552263}, "macro.dbt.get_create_index_sql": {"unique_id": "macro.dbt.get_create_index_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.553382}, "macro.dbt.default__get_create_index_sql": {"unique_id": "macro.dbt.default__get_create_index_sql", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.553739}, "macro.dbt.create_indexes": {"unique_id": "macro.dbt.create_indexes", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes', 'dbt')(relation) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.554378}, "macro.dbt.default__create_indexes": {"unique_id": "macro.dbt.default__create_indexes", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.555757}, "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/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.558856}, "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/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set 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": [], "created_at": 1644611541.559644}, "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/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.56012}, "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/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__drop_relation", "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.560672}, "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/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.561143}, "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/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.561562}, "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/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.562217}, "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/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.563025}, "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/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) -%}\n {{ return(adapter.dispatch('get_or_create_relation', 'dbt')(database, schema, identifier, type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_or_create_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.563663}, "macro.dbt.default__get_or_create_relation": {"unique_id": "macro.dbt.default__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/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__get_or_create_relation", "macro_sql": "{% macro default__get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.565071}, "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/adapters/relation.sql", "original_file_path": "macros/adapters/relation.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": [], "created_at": 1644611541.565655}, "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/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.5663989}, "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/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "current_timestamp", "macro_sql": "{% macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.56754}, "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/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.5679228}, "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/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness', 'dbt')(source, loaded_at_field, filter))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.development.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.568511}, "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/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.5695832}, "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/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment', 'dbt')(relation, column_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.571521}, "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/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.5719528}, "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/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment', 'dbt')(relation, relation_comment)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.572484}, "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/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.572913}, "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/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs', 'dbt')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.5735989}, "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/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do run_query(alter_column_comment(relation, model.columns)) %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.574843}, "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/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.5774238}, "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/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.578218}, "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/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.579013}, "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/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.5797172}, "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/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.580569}, "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/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.581852}, "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/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists', 'dbt')(information_schema, schema)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.5826821}, "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/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.584007}, "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/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.5844932}, "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/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.584917}, "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/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.5888488}, "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/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.5892632}, "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/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.590084}, "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/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.590559}, "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/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.591527}, "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/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type', 'dbt')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.592125}, "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/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.594021}, "macro.dbt.alter_relation_add_remove_columns": {"unique_id": "macro.dbt.alter_relation_add_remove_columns", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "alter_relation_add_remove_columns", "macro_sql": "{% macro alter_relation_add_remove_columns(relation, add_columns = none, remove_columns = none) -%}\n {{ return(adapter.dispatch('alter_relation_add_remove_columns', 'dbt')(relation, add_columns, remove_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__alter_relation_add_remove_columns"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.5950289}, "macro.dbt.default__alter_relation_add_remove_columns": {"unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "package_name": "dbt", "root_path": "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__alter_relation_add_remove_columns", "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n \n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n \n {% set sql -%}\n \n alter {{ relation.type }} {{ relation }}\n \n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n \n {% for column in remove_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n \n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.597215}, "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": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.598529}, "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": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.599137}, "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": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values', 'dbt') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.599883}, "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": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships', 'dbt') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.6006021}, "macro.dbt_utils.except": {"unique_id": "macro.dbt_utils.except", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/except.sql", "original_file_path": "macros/cross_db_utils/except.sql", "name": "except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt_utils')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__except"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.601373}, "macro.dbt_utils.default__except": {"unique_id": "macro.dbt_utils.default__except", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/except.sql", "original_file_path": "macros/cross_db_utils/except.sql", "name": "default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.601571}, "macro.dbt_utils.bigquery__except": {"unique_id": "macro.dbt_utils.bigquery__except", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/except.sql", "original_file_path": "macros/cross_db_utils/except.sql", "name": "bigquery__except", "macro_sql": "{% macro bigquery__except() %}\n\n except distinct\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.6017668}, "macro.dbt_utils.replace": {"unique_id": "macro.dbt_utils.replace", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/replace.sql", "original_file_path": "macros/cross_db_utils/replace.sql", "name": "replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt_utils') (field, old_chars, new_chars)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.60271}, "macro.dbt_utils.default__replace": {"unique_id": "macro.dbt_utils.default__replace", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/replace.sql", "original_file_path": "macros/cross_db_utils/replace.sql", "name": "default__replace", "macro_sql": "{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n \n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.603229}, "macro.dbt_utils.concat": {"unique_id": "macro.dbt_utils.concat", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/concat.sql", "original_file_path": "macros/cross_db_utils/concat.sql", "name": "concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt_utils')(fields)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.604343}, "macro.dbt_utils.default__concat": {"unique_id": "macro.dbt_utils.default__concat", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/concat.sql", "original_file_path": "macros/cross_db_utils/concat.sql", "name": "default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n {{ fields|join(' || ') }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.605042}, "macro.dbt_utils.type_string": {"unique_id": "macro.dbt_utils.type_string", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.607271}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_string", "macro_sql": "{% macro default__type_string() %}\n string\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.607609}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "redshift__type_string", "macro_sql": "\n\n{%- macro redshift__type_string() -%}\n varchar\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.607799}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "postgres__type_string", "macro_sql": "{% macro postgres__type_string() %}\n varchar\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.6079822}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "snowflake__type_string", "macro_sql": "{% macro snowflake__type_string() %}\n varchar\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.608171}, "macro.dbt_utils.type_timestamp": {"unique_id": "macro.dbt_utils.type_timestamp", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.6085749}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n timestamp\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.608764}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "snowflake__type_timestamp", "macro_sql": "{% macro snowflake__type_timestamp() %}\n timestamp_ntz\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.608948}, "macro.dbt_utils.type_float": {"unique_id": "macro.dbt_utils.type_float", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__type_float"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.6093519}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_float", "macro_sql": "{% macro default__type_float() %}\n float\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.609545}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "bigquery__type_float", "macro_sql": "{% macro bigquery__type_float() %}\n float64\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.60973}, "macro.dbt_utils.type_numeric": {"unique_id": "macro.dbt_utils.type_numeric", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.610324}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n numeric(28, 6)\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.610519}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "bigquery__type_numeric", "macro_sql": "{% macro bigquery__type_numeric() %}\n numeric\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.610707}, "macro.dbt_utils.type_bigint": {"unique_id": "macro.dbt_utils.type_bigint", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.6111171}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n bigint\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.611308}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "bigquery__type_bigint", "macro_sql": "{% macro bigquery__type_bigint() %}\n int64\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.611495}, "macro.dbt_utils.type_int": {"unique_id": "macro.dbt_utils.type_int", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.611902}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "default__type_int", "macro_sql": "{% macro default__type_int() %}\n int\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.612096}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datatypes.sql", "original_file_path": "macros/cross_db_utils/datatypes.sql", "name": "bigquery__type_int", "macro_sql": "{% macro bigquery__type_int() %}\n int64\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.6122801}, "macro.dbt_utils._is_relation": {"unique_id": "macro.dbt_utils._is_relation", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/_is_relation.sql", "original_file_path": "macros/cross_db_utils/_is_relation.sql", "name": "_is_relation", "macro_sql": "{% macro _is_relation(obj, macro) %}\n {%- if not (obj is mapping and obj.get('metadata', {}).get('type', '').endswith('Relation')) -%}\n {%- do exceptions.raise_compiler_error(\"Macro \" ~ macro ~ \" expected a Relation but received the value: \" ~ obj) -%}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.6135402}, "macro.dbt_utils.length": {"unique_id": "macro.dbt_utils.length", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/length.sql", "original_file_path": "macros/cross_db_utils/length.sql", "name": "length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt_utils') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__length"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.614366}, "macro.dbt_utils.default__length": {"unique_id": "macro.dbt_utils.default__length", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/length.sql", "original_file_path": "macros/cross_db_utils/length.sql", "name": "default__length", "macro_sql": "{% macro default__length(expression) %}\n \n length(\n {{ expression }}\n )\n \n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.614646}, "macro.dbt_utils.redshift__length": {"unique_id": "macro.dbt_utils.redshift__length", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/length.sql", "original_file_path": "macros/cross_db_utils/length.sql", "name": "redshift__length", "macro_sql": "{% macro redshift__length(expression) %}\n\n len(\n {{ expression }}\n )\n \n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.614913}, "macro.dbt_utils.dateadd": {"unique_id": "macro.dbt_utils.dateadd", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt_utils')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.61618}, "macro.dbt_utils.default__dateadd": {"unique_id": "macro.dbt_utils.default__dateadd", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "default__dateadd", "macro_sql": "{% macro default__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_date_or_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.616727}, "macro.dbt_utils.bigquery__dateadd": {"unique_id": "macro.dbt_utils.bigquery__dateadd", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "bigquery__dateadd", "macro_sql": "{% macro bigquery__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n datetime_add(\n cast( {{ from_date_or_timestamp }} as datetime),\n interval {{ interval }} {{ datepart }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.617151}, "macro.dbt_utils.postgres__dateadd": {"unique_id": "macro.dbt_utils.postgres__dateadd", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "postgres__dateadd", "macro_sql": "{% macro postgres__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ from_date_or_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.617565}, "macro.dbt_utils.redshift__dateadd": {"unique_id": "macro.dbt_utils.redshift__dateadd", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/dateadd.sql", "original_file_path": "macros/cross_db_utils/dateadd.sql", "name": "redshift__dateadd", "macro_sql": "{% macro redshift__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ return(dbt_utils.default__dateadd(datepart, interval, from_date_or_timestamp)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.618171}, "macro.dbt_utils.intersect": {"unique_id": "macro.dbt_utils.intersect", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/intersect.sql", "original_file_path": "macros/cross_db_utils/intersect.sql", "name": "intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt_utils')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__intersect"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.618915}, "macro.dbt_utils.default__intersect": {"unique_id": "macro.dbt_utils.default__intersect", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/intersect.sql", "original_file_path": "macros/cross_db_utils/intersect.sql", "name": "default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.6191099}, "macro.dbt_utils.bigquery__intersect": {"unique_id": "macro.dbt_utils.bigquery__intersect", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/intersect.sql", "original_file_path": "macros/cross_db_utils/intersect.sql", "name": "bigquery__intersect", "macro_sql": "{% macro bigquery__intersect() %}\n\n intersect distinct\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.619297}, "macro.dbt_utils.right": {"unique_id": "macro.dbt_utils.right", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "name": "right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt_utils') (string_text, length_expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__right"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.6205812}, "macro.dbt_utils.default__right": {"unique_id": "macro.dbt_utils.default__right", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "name": "default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n \n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.620969}, "macro.dbt_utils.bigquery__right": {"unique_id": "macro.dbt_utils.bigquery__right", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "name": "bigquery__right", "macro_sql": "{% macro bigquery__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0 \n then ''\n else \n substr(\n {{ string_text }},\n -1 * ({{ length_expression }})\n )\n end\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.621409}, "macro.dbt_utils.snowflake__right": {"unique_id": "macro.dbt_utils.snowflake__right", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/right.sql", "original_file_path": "macros/cross_db_utils/right.sql", "name": "snowflake__right", "macro_sql": "{% macro snowflake__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0 \n then ''\n else \n right(\n {{ string_text }},\n {{ length_expression }}\n )\n end\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.621807}, "macro.dbt_utils.datediff": {"unique_id": "macro.dbt_utils.datediff", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt_utils')(first_date, second_date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.626221}, "macro.dbt_utils.default__datediff": {"unique_id": "macro.dbt_utils.default__datediff", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "default__datediff", "macro_sql": "{% macro default__datediff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.626693}, "macro.dbt_utils.bigquery__datediff": {"unique_id": "macro.dbt_utils.bigquery__datediff", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "bigquery__datediff", "macro_sql": "{% macro bigquery__datediff(first_date, second_date, datepart) %}\n\n datetime_diff(\n cast({{second_date}} as datetime),\n cast({{first_date}} as datetime),\n {{datepart}}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.627477}, "macro.dbt_utils.postgres__datediff": {"unique_id": "macro.dbt_utils.postgres__datediff", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "postgres__datediff", "macro_sql": "{% macro postgres__datediff(first_date, second_date, datepart) %}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.632333}, "macro.dbt_utils.redshift__datediff": {"unique_id": "macro.dbt_utils.redshift__datediff", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/datediff.sql", "original_file_path": "macros/cross_db_utils/datediff.sql", "name": "redshift__datediff", "macro_sql": "{% macro redshift__datediff(first_date, second_date, datepart) %}\n\n {{ return(dbt_utils.default__datediff(first_date, second_date, datepart)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.633137}, "macro.dbt_utils.safe_cast": {"unique_id": "macro.dbt_utils.safe_cast", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "name": "safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt_utils') (field, type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.634284}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "name": "default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.634645}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "name": "snowflake__safe_cast", "macro_sql": "{% macro snowflake__safe_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.634977}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/safe_cast.sql", "original_file_path": "macros/cross_db_utils/safe_cast.sql", "name": "bigquery__safe_cast", "macro_sql": "{% macro bigquery__safe_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.635308}, "macro.dbt_utils.hash": {"unique_id": "macro.dbt_utils.hash", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/hash.sql", "original_file_path": "macros/cross_db_utils/hash.sql", "name": "hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt_utils') (field)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__hash"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.636191}, "macro.dbt_utils.default__hash": {"unique_id": "macro.dbt_utils.default__hash", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/hash.sql", "original_file_path": "macros/cross_db_utils/hash.sql", "name": "default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{field}} as {{dbt_utils.type_string()}}))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.637059}, "macro.dbt_utils.bigquery__hash": {"unique_id": "macro.dbt_utils.bigquery__hash", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/hash.sql", "original_file_path": "macros/cross_db_utils/hash.sql", "name": "bigquery__hash", "macro_sql": "{% macro bigquery__hash(field) -%}\n to_hex({{dbt_utils.default__hash(field)}})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.637745}, "macro.dbt_utils.cast_bool_to_text": {"unique_id": "macro.dbt_utils.cast_bool_to_text", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/cast_bool_to_text.sql", "original_file_path": "macros/cross_db_utils/cast_bool_to_text.sql", "name": "cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', 'dbt_utils') (field) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.639275}, "macro.dbt_utils.default__cast_bool_to_text": {"unique_id": "macro.dbt_utils.default__cast_bool_to_text", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/cast_bool_to_text.sql", "original_file_path": "macros/cross_db_utils/cast_bool_to_text.sql", "name": "default__cast_bool_to_text", "macro_sql": "{% macro default__cast_bool_to_text(field) %}\n cast({{ field }} as {{ dbt_utils.type_string() }})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.6397178}, "macro.dbt_utils.redshift__cast_bool_to_text": {"unique_id": "macro.dbt_utils.redshift__cast_bool_to_text", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/cast_bool_to_text.sql", "original_file_path": "macros/cross_db_utils/cast_bool_to_text.sql", "name": "redshift__cast_bool_to_text", "macro_sql": "{% macro redshift__cast_bool_to_text(field) %}\n case\n when {{ field }} is true then 'true'\n when {{ field }} is false then 'false'\n end::text\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.640042}, "macro.dbt_utils.identifier": {"unique_id": "macro.dbt_utils.identifier", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/identifier.sql", "original_file_path": "macros/cross_db_utils/identifier.sql", "name": "identifier", "macro_sql": "{% macro identifier(value) %}\t\n {%- set error_message = '\n Warning: the `identifier` macro is no longer supported and will be deprecated in a future release of dbt-utils. \\\n Use `adapter.quote` instead. The {}.{} model triggered this warning. \\\n '.format(model.package_name, model.name) -%}\n {%- do exceptions.warn(error_message) -%}\n {{ return(adapter.dispatch('identifier', 'dbt_utils') (value)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__identifier"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.641294}, "macro.dbt_utils.default__identifier": {"unique_id": "macro.dbt_utils.default__identifier", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/identifier.sql", "original_file_path": "macros/cross_db_utils/identifier.sql", "name": "default__identifier", "macro_sql": "{% macro default__identifier(value) -%}\t\n \"{{ value }}\"\t\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.641567}, "macro.dbt_utils.bigquery__identifier": {"unique_id": "macro.dbt_utils.bigquery__identifier", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/identifier.sql", "original_file_path": "macros/cross_db_utils/identifier.sql", "name": "bigquery__identifier", "macro_sql": "{% macro bigquery__identifier(value) -%}\t\n `{{ value }}`\t\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.641827}, "macro.dbt_utils.position": {"unique_id": "macro.dbt_utils.position", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/position.sql", "original_file_path": "macros/cross_db_utils/position.sql", "name": "position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt_utils') (substring_text, string_text)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__position"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.642775}, "macro.dbt_utils.default__position": {"unique_id": "macro.dbt_utils.default__position", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/position.sql", "original_file_path": "macros/cross_db_utils/position.sql", "name": "default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n \n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.643229}, "macro.dbt_utils.bigquery__position": {"unique_id": "macro.dbt_utils.bigquery__position", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/position.sql", "original_file_path": "macros/cross_db_utils/position.sql", "name": "bigquery__position", "macro_sql": "{% macro bigquery__position(substring_text, string_text) %}\n\n strpos(\n {{ string_text }},\n {{ substring_text }}\n \n )\n \n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.643574}, "macro.dbt_utils.string_literal": {"unique_id": "macro.dbt_utils.string_literal", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/literal.sql", "original_file_path": "macros/cross_db_utils/literal.sql", "name": "string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt_utils') (value)) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.644326}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/literal.sql", "original_file_path": "macros/cross_db_utils/literal.sql", "name": "default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.6446772}, "macro.dbt_utils.current_timestamp": {"unique_id": "macro.dbt_utils.current_timestamp", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "current_timestamp", "macro_sql": "{% macro current_timestamp() -%}\n {{ return(adapter.dispatch('current_timestamp', 'dbt_utils')()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.6461709}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() %}\n current_timestamp::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.646472}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "redshift__current_timestamp", "macro_sql": "{% macro redshift__current_timestamp() %}\n getdate()\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.646709}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "bigquery__current_timestamp", "macro_sql": "{% macro bigquery__current_timestamp() %}\n current_timestamp\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.646899}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "current_timestamp_in_utc", "macro_sql": "{% macro current_timestamp_in_utc() -%}\n {{ return(adapter.dispatch('current_timestamp_in_utc', 'dbt_utils')()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__current_timestamp_in_utc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.647433}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "default__current_timestamp_in_utc", "macro_sql": "{% macro default__current_timestamp_in_utc() %}\n {{dbt_utils.current_timestamp()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.6478012}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "snowflake__current_timestamp_in_utc", "macro_sql": "{% macro snowflake__current_timestamp_in_utc() %}\n convert_timezone('UTC', {{dbt_utils.current_timestamp()}})::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.current_timestamp", "macro.dbt_utils.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.648206}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "postgres__current_timestamp_in_utc", "macro_sql": "{% macro postgres__current_timestamp_in_utc() %}\n (current_timestamp at time zone 'utc')::{{dbt_utils.type_timestamp()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.6484978}, "macro.dbt_utils.redshift__current_timestamp_in_utc": {"unique_id": "macro.dbt_utils.redshift__current_timestamp_in_utc", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/cross_db_utils/current_timestamp.sql", "name": "redshift__current_timestamp_in_utc", "macro_sql": "{% macro redshift__current_timestamp_in_utc() %}\n {{ return(dbt_utils.default__current_timestamp_in_utc()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__current_timestamp_in_utc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.648844}, "macro.dbt_utils.width_bucket": {"unique_id": "macro.dbt_utils.width_bucket", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "name": "width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ return(adapter.dispatch('width_bucket', 'dbt_utils') (expr, min_value, max_value, num_buckets)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__width_bucket"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.6513689}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "name": "default__width_bucket", "macro_sql": "{% macro default__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is eaxtly at the bucket egde\n case\n when\n mod(\n {{ dbt_utils.safe_cast(expr, dbt_utils.type_numeric() ) }},\n {{ dbt_utils.safe_cast(bin_size, dbt_utils.type_numeric() ) }}\n ) = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.safe_cast", "macro.dbt_utils.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.65255}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "name": "redshift__width_bucket", "macro_sql": "{% macro redshift__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is exactly at the bucket edge\n case\n when\n {{ dbt_utils.safe_cast(expr, dbt_utils.type_numeric() ) }} %\n {{ dbt_utils.safe_cast(bin_size, dbt_utils.type_numeric() ) }}\n = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.safe_cast", "macro.dbt_utils.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.653777}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/width_bucket.sql", "original_file_path": "macros/cross_db_utils/width_bucket.sql", "name": "snowflake__width_bucket", "macro_sql": "{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.65448}, "macro.dbt_utils.last_day": {"unique_id": "macro.dbt_utils.last_day", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt_utils') (date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.655943}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "default_last_day", "macro_sql": "\n\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt_utils.dateadd('day', '-1',\n dbt_utils.dateadd(datepart, '1', dbt_utils.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.dateadd", "macro.dbt_utils.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.656617}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.656991}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "postgres__last_day", "macro_sql": "{% macro postgres__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n -- postgres dateadd does not support quarter interval.\n cast(\n {{dbt_utils.dateadd('day', '-1',\n dbt_utils.dateadd('month', '3', dbt_utils.date_trunc(datepart, date))\n )}}\n as date)\n {%- else -%}\n {{dbt_utils.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.dateadd", "macro.dbt_utils.date_trunc", "macro.dbt_utils.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.658085}, "macro.dbt_utils.redshift__last_day": {"unique_id": "macro.dbt_utils.redshift__last_day", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/last_day.sql", "original_file_path": "macros/cross_db_utils/last_day.sql", "name": "redshift__last_day", "macro_sql": "{% macro redshift__last_day(date, datepart) %}\n\n {{ return(dbt_utils.default__last_day(date, datepart)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__last_day"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.658549}, "macro.dbt_utils.split_part": {"unique_id": "macro.dbt_utils.split_part", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "name": "split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ return(adapter.dispatch('split_part', 'dbt_utils') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__split_part"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.660023}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "name": "default__split_part", "macro_sql": "{% macro default__split_part(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n {{ part_number }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.660449}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/split_part.sql", "original_file_path": "macros/cross_db_utils/split_part.sql", "name": "bigquery__split_part", "macro_sql": "{% macro bigquery__split_part(string_text, delimiter_text, part_number) %}\n\n 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": [], "created_at": 1644611541.660905}, "macro.dbt_utils.date_trunc": {"unique_id": "macro.dbt_utils.date_trunc", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/date_trunc.sql", "original_file_path": "macros/cross_db_utils/date_trunc.sql", "name": "date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt_utils') (datepart, date)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.661869}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/date_trunc.sql", "original_file_path": "macros/cross_db_utils/date_trunc.sql", "name": "default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) %}\n date_trunc('{{datepart}}', {{date}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.6622138}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/date_trunc.sql", "original_file_path": "macros/cross_db_utils/date_trunc.sql", "name": "bigquery__date_trunc", "macro_sql": "{% macro bigquery__date_trunc(datepart, date) %}\n timestamp_trunc(\n cast({{date}} as timestamp),\n {{datepart}}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.662554}, "macro.dbt_utils._is_ephemeral": {"unique_id": "macro.dbt_utils._is_ephemeral", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/_is_ephemeral.sql", "original_file_path": "macros/cross_db_utils/_is_ephemeral.sql", "name": "_is_ephemeral", "macro_sql": "{% macro _is_ephemeral(obj, macro) %}\n {%- if obj.is_cte -%}\n {% set ephemeral_prefix = api.Relation.add_ephemeral_prefix('') %}\n {% if obj.name.startswith(ephemeral_prefix) %}\n {% set model_name = obj.name[(ephemeral_prefix|length):] %}\n {% else %}\n {% set model_name = obj.name %}\n {%- endif -%}\n {% set error_message %}\nThe `{{ macro }}` macro cannot be used with ephemeral models, as it relies on the information schema.\n\n`{{ model_name }}` is an ephemeral model. Consider making it a view or table instead.\n {% endset %}\n {%- do exceptions.raise_compiler_error(error_message) -%}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.6645918}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "get_period_boundaries", "macro_sql": "{% macro get_period_boundaries(target_schema, target_table, timestamp_field, start_date, stop_date, period) -%}\n {{ return(adapter.dispatch('get_period_boundaries', 'dbt_utils')(target_schema, target_table, timestamp_field, start_date, stop_date, period)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_period_boundaries"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.6746519}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "default__get_period_boundaries", "macro_sql": "{% macro default__get_period_boundaries(target_schema, target_table, timestamp_field, start_date, stop_date, period) -%}\n\n {% call statement('period_boundaries', fetch_result=True) -%}\n with data as (\n select\n coalesce(max(\"{{timestamp_field}}\"), '{{start_date}}')::timestamp as start_timestamp,\n coalesce(\n {{dbt_utils.dateadd('millisecond',\n -1,\n \"nullif('\" ~ stop_date ~ \"','')::timestamp\")}},\n {{dbt_utils.current_timestamp()}}\n ) as stop_timestamp\n from \"{{target_schema}}\".\"{{target_table}}\"\n )\n\n select\n start_timestamp,\n stop_timestamp,\n {{dbt_utils.datediff('start_timestamp',\n 'stop_timestamp',\n period)}} + 1 as num_periods\n from data\n {%- endcall %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.dateadd", "macro.dbt_utils.current_timestamp", "macro.dbt_utils.datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.6761081}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "get_period_sql", "macro_sql": "{% macro get_period_sql(target_cols_csv, sql, timestamp_field, period, start_timestamp, stop_timestamp, offset) -%}\n {{ return(adapter.dispatch('get_period_sql', 'dbt_utils')(target_cols_csv, sql, timestamp_field, period, start_timestamp, stop_timestamp, offset)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_period_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.676936}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "default__get_period_sql", "macro_sql": "{% macro default__get_period_sql(target_cols_csv, sql, timestamp_field, period, start_timestamp, stop_timestamp, offset) -%}\n\n {%- set period_filter -%}\n (\"{{timestamp_field}}\" > '{{start_timestamp}}'::timestamp + interval '{{offset}} {{period}}' and\n \"{{timestamp_field}}\" <= '{{start_timestamp}}'::timestamp + interval '{{offset}} {{period}}' + interval '1 {{period}}' and\n \"{{timestamp_field}}\" < '{{stop_timestamp}}'::timestamp)\n {%- endset -%}\n\n {%- set filtered_sql = sql | replace(\"__PERIOD_FILTER__\", period_filter) -%}\n\n select\n {{target_cols_csv}}\n from (\n {{filtered_sql}}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.678219}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/materializations/insert_by_period_materialization.sql", "original_file_path": "macros/materializations/insert_by_period_materialization.sql", "name": "materialization_insert_by_period_default", "macro_sql": "{% materialization insert_by_period, default -%}\n {%- set timestamp_field = config.require('timestamp_field') -%}\n {%- set start_date = config.require('start_date') -%}\n {%- set stop_date = config.get('stop_date') or '' -%}}\n {%- set period = config.get('period') or 'week' -%}\n\n {%- if sql.find('__PERIOD_FILTER__') == -1 -%}\n {%- set error_message -%}\n Model '{{ model.unique_id }}' does not include the required string '__PERIOD_FILTER__' in its sql\n {%- endset -%}\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n\n {%- set identifier = model['name'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier, schema=schema, type='table') -%}\n\n {%- set non_destructive_mode = (flags.NON_DESTRUCTIVE == True) -%}\n {%- set full_refresh_mode = (flags.FULL_REFRESH == True) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_not_as_table = (old_relation is not none and not old_relation.is_table) -%}\n\n {%- set should_truncate = (non_destructive_mode and full_refresh_mode and exists_as_table) -%}\n {%- set should_drop = (not should_truncate and (full_refresh_mode or exists_not_as_table)) -%}\n {%- set force_create = (flags.FULL_REFRESH and not flags.NON_DESTRUCTIVE) -%}\n\n -- setup\n {% if old_relation is none -%}\n -- noop\n {%- elif should_truncate -%}\n {{adapter.truncate_relation(old_relation)}}\n {%- elif should_drop -%}\n {{adapter.drop_relation(old_relation)}}\n {%- set old_relation = none -%}\n {%- endif %}\n\n {{run_hooks(pre_hooks, inside_transaction=False)}}\n\n -- `begin` happens here, so `commit` after it to finish the transaction\n {{run_hooks(pre_hooks, inside_transaction=True)}}\n {% call statement() -%}\n begin; -- make extra sure we've closed out the transaction\n commit;\n {%- endcall %}\n\n -- build model\n {% if force_create or old_relation is none -%}\n {# Create an empty target table -#}\n {% call statement('main') -%}\n {%- set empty_sql = sql | replace(\"__PERIOD_FILTER__\", 'false') -%}\n {{create_table_as(False, target_relation, empty_sql)}}\n {%- endcall %}\n {%- endif %}\n\n {% set _ = dbt_utils.get_period_boundaries(schema,\n identifier,\n timestamp_field,\n start_date,\n stop_date,\n period) %}\n {%- set start_timestamp = load_result('period_boundaries')['data'][0][0] | string -%}\n {%- set stop_timestamp = load_result('period_boundaries')['data'][0][1] | string -%}\n {%- set num_periods = load_result('period_boundaries')['data'][0][2] | int -%}\n\n {% set target_columns = adapter.get_columns_in_relation(target_relation) %}\n {%- set target_cols_csv = target_columns | map(attribute='quoted') | join(', ') -%}\n {%- set loop_vars = {'sum_rows_inserted': 0} -%}\n\n -- commit each period as a separate transaction\n {% for i in range(num_periods) -%}\n {%- set msg = \"Running for \" ~ period ~ \" \" ~ (i + 1) ~ \" of \" ~ (num_periods) -%}\n {{ dbt_utils.log_info(msg) }}\n\n {%- set tmp_identifier = model['name'] ~ '__dbt_incremental_period' ~ i ~ '_tmp' -%}\n {%- set tmp_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema, type='table') -%}\n {% call statement() -%}\n {% set tmp_table_sql = dbt_utils.get_period_sql(target_cols_csv,\n sql,\n timestamp_field,\n period,\n start_timestamp,\n stop_timestamp,\n i) %}\n {{dbt.create_table_as(True, tmp_relation, tmp_table_sql)}}\n {%- endcall %}\n\n {{adapter.expand_target_column_types(from_relation=tmp_relation,\n to_relation=target_relation)}}\n {%- set name = 'main-' ~ i -%}\n {% call statement(name, fetch_result=True) -%}\n insert into {{target_relation}} ({{target_cols_csv}})\n (\n select\n {{target_cols_csv}}\n from {{tmp_relation.include(schema=False)}}\n );\n {%- endcall %}\n {% set result = load_result('main-' ~ i) %}\n {% if 'response' in result.keys() %} {# added in v0.19.0 #}\n {% set rows_inserted = result['response']['rows_affected'] %}\n {% else %} {# older versions #}\n {% set rows_inserted = result['status'].split(\" \")[2] | int %}\n {% endif %}\n \n {%- set sum_rows_inserted = loop_vars['sum_rows_inserted'] + rows_inserted -%}\n {%- if loop_vars.update({'sum_rows_inserted': sum_rows_inserted}) %} {% endif -%}\n\n {%- set msg = \"Ran for \" ~ period ~ \" \" ~ (i + 1) ~ \" of \" ~ (num_periods) ~ \"; \" ~ rows_inserted ~ \" records inserted\" -%}\n {{ dbt_utils.log_info(msg) }}\n\n {%- endfor %}\n\n {% call statement() -%}\n begin;\n {%- endcall %}\n\n {{run_hooks(post_hooks, inside_transaction=True)}}\n\n {% call statement() -%}\n commit;\n {%- endcall %}\n\n {{run_hooks(post_hooks, inside_transaction=False)}}\n\n {%- set status_string = \"INSERT \" ~ loop_vars['sum_rows_inserted'] -%}\n\n {% call noop_statement('main', status_string) -%}\n -- no-op\n {%- endcall %}\n\n -- Return the relations created in this materialization\n {{ return({'relations': [target_relation]}) }} \n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt_utils.get_period_boundaries", "macro.dbt_utils.log_info", "macro.dbt_utils.get_period_sql", "macro.dbt.noop_statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.692394}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "name": "get_url_host", "macro_sql": "{% macro get_url_host(field) -%}\n {{ return(adapter.dispatch('get_url_host', 'dbt_utils')(field)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_host"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.693446}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "name": "default__get_url_host", "macro_sql": "{% macro default__get_url_host(field) -%}\n\n{%- set parsed =\n dbt_utils.split_part(\n dbt_utils.split_part(\n dbt_utils.replace(\n dbt_utils.replace(\n dbt_utils.replace(field, \"'android-app://'\", \"''\"\n ), \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n\n-%}\n\n\n {{ dbt_utils.safe_cast(\n parsed,\n dbt_utils.type_string()\n )}}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.split_part", "macro.dbt_utils.replace", "macro.dbt_utils.safe_cast", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.694742}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "name": "get_url_path", "macro_sql": "{% macro get_url_path(field) -%}\n {{ return(adapter.dispatch('get_url_path', 'dbt_utils')(field)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_path"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.6958551}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "name": "default__get_url_path", "macro_sql": "{% macro default__get_url_path(field) -%}\n\n {%- set stripped_url = \n dbt_utils.replace(\n dbt_utils.replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{dbt_utils.position(\"'/'\", stripped_url)}}, 0),\n {{dbt_utils.position(\"'?'\", stripped_url)}} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n dbt_utils.split_part(\n dbt_utils.right(\n stripped_url, \n dbt_utils.length(stripped_url) ~ \"-\" ~ first_slash_pos\n ), \n \"'?'\", 1\n )\n -%}\n\n {{ dbt_utils.safe_cast(\n parsed_path,\n dbt_utils.type_string()\n )}}\n \n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.replace", "macro.dbt_utils.position", "macro.dbt_utils.split_part", "macro.dbt_utils.right", "macro.dbt_utils.length", "macro.dbt_utils.safe_cast", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.697563}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "name": "get_url_parameter", "macro_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n {{ return(adapter.dispatch('get_url_parameter', 'dbt_utils')(field, url_parameter)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.698574}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "name": "default__get_url_parameter", "macro_sql": "{% macro default__get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = dbt_utils.split_part(dbt_utils.split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.split_part"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.699787}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "name": "pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n {{ return(adapter.dispatch('pretty_log_format', 'dbt_utils')(message)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.700595}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "name": "default__pretty_log_format", "macro_sql": "{% macro default__pretty_log_format(message) %}\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.7010229}, "macro.dbt_utils.pretty_time": {"unique_id": "macro.dbt_utils.pretty_time", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "name": "pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n {{ return(adapter.dispatch('pretty_time', 'dbt_utils')(format)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.7020202}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "name": "default__pretty_time", "macro_sql": "{% macro default__pretty_time(format='%H:%M:%S') %}\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.702528}, "macro.dbt_utils.log_info": {"unique_id": "macro.dbt_utils.log_info", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "name": "log_info", "macro_sql": "{% macro log_info(message) %}\n {{ return(adapter.dispatch('log_info', 'dbt_utils')(message)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__log_info"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.703491}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "name": "default__log_info", "macro_sql": "{% macro default__log_info(message) %}\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.704063}, "macro.dbt_utils.slugify": {"unique_id": "macro.dbt_utils.slugify", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/slugify.sql", "original_file_path": "macros/jinja_helpers/slugify.sql", "name": "slugify", "macro_sql": "{% macro slugify(string) %}\n\n{#- Lower case the string -#}\n{% set string = string | lower %}\n{#- Replace spaces and dashes with underscores -#}\n{% set string = modules.re.sub('[ -]+', '_', string) %}\n{#- Only take letters, numbers, and underscores -#}\n{% set string = modules.re.sub('[^a-z0-9_]+', '', string) %}\n\n{{ return(string) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.705528}, "macro.dbt_utils.test_fewer_rows_than": {"unique_id": "macro.dbt_utils.test_fewer_rows_than", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/fewer_rows_than.sql", "original_file_path": "macros/schema_tests/fewer_rows_than.sql", "name": "test_fewer_rows_than", "macro_sql": "{% test fewer_rows_than(model, compare_model) %}\n {{ return(adapter.dispatch('test_fewer_rows_than', 'dbt_utils')(model, compare_model)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_fewer_rows_than"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.706707}, "macro.dbt_utils.default__test_fewer_rows_than": {"unique_id": "macro.dbt_utils.default__test_fewer_rows_than", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/fewer_rows_than.sql", "original_file_path": "macros/schema_tests/fewer_rows_than.sql", "name": "default__test_fewer_rows_than", "macro_sql": "{% macro default__test_fewer_rows_than(model, compare_model) %}\n\n{{ config(fail_calc = 'coalesce(row_count_delta, 0)') }}\n\nwith a as (\n\n select count(*) as count_our_model from {{ model }}\n\n),\nb as (\n\n select count(*) as count_comparison_model from {{ compare_model }}\n\n),\ncounts as (\n\n select\n count_our_model,\n count_comparison_model\n from a\n cross join b\n\n),\nfinal as (\n\n select *,\n case\n -- fail the test if we have more rows than the reference model and return the row count delta\n when count_our_model > count_comparison_model then (count_our_model - count_comparison_model)\n -- fail the test if they are the same number\n when count_our_model = count_comparison_model then 1\n -- pass the test if the delta is positive (i.e. return the number 0)\n else 0\n end as row_count_delta\n from counts\n\n)\n\nselect * from final\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.707253}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/equal_rowcount.sql", "original_file_path": "macros/schema_tests/equal_rowcount.sql", "name": "test_equal_rowcount", "macro_sql": "{% test equal_rowcount(model, compare_model) %}\n {{ return(adapter.dispatch('test_equal_rowcount', 'dbt_utils')(model, compare_model)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_equal_rowcount"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.708252}, "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/Github/development/dbt_packages/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, compare_model) %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = 'coalesce(diff_count, 0)') }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\nwith a as (\n\n select count(*) as count_a from {{ model }}\n\n),\nb as (\n\n select count(*) as count_b from {{ compare_model }}\n\n),\nfinal as (\n\n select\n count_a,\n count_b,\n abs(count_a - count_b) as diff_count\n from a\n cross join b\n\n)\n\nselect * from final\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.708998}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/relationships_where.sql", "original_file_path": "macros/schema_tests/relationships_where.sql", "name": "test_relationships_where", "macro_sql": "{% test relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n {{ return(adapter.dispatch('test_relationships_where', 'dbt_utils')(model, column_name, to, field, from_condition, to_condition)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_relationships_where"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.710454}, "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/Github/development/dbt_packages/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, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n\nwith left_table as (\n\n select\n {{column_name}} as id\n\n from {{model}}\n\n where {{column_name}} is not null\n and {{from_condition}}\n\n),\n\nright_table as (\n\n select\n {{field}} as id\n\n from {{to}}\n\n where {{field}} is not null\n and {{to_condition}}\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.71145}, "macro.dbt_utils.test_recency": {"unique_id": "macro.dbt_utils.test_recency", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/recency.sql", "original_file_path": "macros/schema_tests/recency.sql", "name": "test_recency", "macro_sql": "{% test recency(model, field, datepart, interval) %}\n {{ return(adapter.dispatch('test_recency', 'dbt_utils')(model, field, datepart, interval)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_recency"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.712824}, "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/Github/development/dbt_packages/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, field, datepart, interval) %}\n\n{% set threshold = dbt_utils.dateadd(datepart, interval * -1, dbt_utils.current_timestamp()) %}\n\nwith recency as (\n\n select max({{field}}) as most_recent\n from {{ model }}\n\n)\n\nselect\n\n most_recent,\n {{ threshold }} as threshold\n\nfrom recency\nwhere most_recent < {{ threshold }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.dateadd", "macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.714102}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/not_constant.sql", "original_file_path": "macros/schema_tests/not_constant.sql", "name": "test_not_constant", "macro_sql": "{% test not_constant(model, column_name) %}\n {{ return(adapter.dispatch('test_not_constant', 'dbt_utils')(model, column_name)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_constant"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.7150002}, "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/Github/development/dbt_packages/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, column_name) %}\n\n\nselect\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n count(distinct {{ column_name }}) as filler_column\n\nfrom {{ model }}\n\nhaving count(distinct {{ column_name }}) = 1\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.715447}, "macro.dbt_utils.test_accepted_range": {"unique_id": "macro.dbt_utils.test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/accepted_range.sql", "original_file_path": "macros/schema_tests/accepted_range.sql", "name": "test_accepted_range", "macro_sql": "{% test accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n {{ return(adapter.dispatch('test_accepted_range', 'dbt_utils')(model, column_name, min_value, max_value, inclusive)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_accepted_range"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.716854}, "macro.dbt_utils.default__test_accepted_range": {"unique_id": "macro.dbt_utils.default__test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/accepted_range.sql", "original_file_path": "macros/schema_tests/accepted_range.sql", "name": "default__test_accepted_range", "macro_sql": "{% macro default__test_accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n\nwith meet_condition as(\n select *\n from {{ model }}\n),\n\nvalidation_errors as (\n select *\n from meet_condition\n where\n -- never true, defaults to an empty result set. Exists to ensure any combo of the `or` clauses below succeeds\n 1 = 2\n\n {%- if min_value is not none %}\n -- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} > {{- \"=\" if inclusive }} {{ min_value }}\n {%- endif %}\n\n {%- if max_value is not none %}\n -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} < {{- \"=\" if inclusive }} {{ max_value }}\n {%- endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.7180648}, "macro.dbt_utils.test_not_accepted_values": {"unique_id": "macro.dbt_utils.test_not_accepted_values", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/not_accepted_values.sql", "original_file_path": "macros/schema_tests/not_accepted_values.sql", "name": "test_not_accepted_values", "macro_sql": "{% test not_accepted_values(model, column_name, values, quote=True) %}\n {{ return(adapter.dispatch('test_not_accepted_values', 'dbt_utils')(model, column_name, values, quote)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.719341}, "macro.dbt_utils.default__test_not_accepted_values": {"unique_id": "macro.dbt_utils.default__test_not_accepted_values", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/not_accepted_values.sql", "original_file_path": "macros/schema_tests/not_accepted_values.sql", "name": "default__test_not_accepted_values", "macro_sql": "{% macro default__test_not_accepted_values(model, column_name, values, quote=True) %}\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.720326}, "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/Github/development/dbt_packages/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": "{% test unique_where(model, column_name) %}\r\n {%- set deprecation_warning = '\r\n Warning: `dbt_utils.unique_where` is no longer supported.\r\n Starting in dbt v0.20.0, the built-in `unique` test supports a `where` config.\r\n ' -%}\r\n {%- do exceptions.warn(deprecation_warning) -%}\r\n {{ return(adapter.dispatch('test_unique_where', 'dbt_utils')(model, column_name)) }}\r\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_where"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.7218041}, "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/Github/development/dbt_packages/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, column_name) %}\r\n {{ return(test_unique(model, column_name)) }}\r\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.test_unique"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.7224472}, "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/Github/development/dbt_packages/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": "{% test at_least_one(model, column_name) %}\n {{ return(adapter.dispatch('test_at_least_one', 'dbt_utils')(model, column_name)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_at_least_one"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.723427}, "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/Github/development/dbt_packages/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, column_name) %}\n\nselect *\nfrom (\n select\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n count({{ column_name }}) as filler_column\n\n from {{ model }}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.723883}, "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/Github/development/dbt_packages/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": "{% test unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n {{ return(adapter.dispatch('test_unique_combination_of_columns', 'dbt_utils')(model, combination_of_columns, quote_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_combination_of_columns"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.725315}, "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/Github/development/dbt_packages/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, combination_of_columns, quote_columns=false) %}\n\n{% if not quote_columns %}\n {%- set column_list=combination_of_columns %}\n{% elif quote_columns %}\n {%- set column_list=[] %}\n {% for column in combination_of_columns -%}\n {% set column_list = column_list.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set columns_csv=column_list | join(', ') %}\n\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.7272582}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/cardinality_equality.sql", "original_file_path": "macros/schema_tests/cardinality_equality.sql", "name": "test_cardinality_equality", "macro_sql": "{% test cardinality_equality(model, column_name, to, field) %}\n {{ return(adapter.dispatch('test_cardinality_equality', 'dbt_utils')(model, column_name, to, field)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_cardinality_equality"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.7285151}, "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/Github/development/dbt_packages/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, column_name, to, field) %}\n\n{# T-SQL does not let you use numbers as aliases for columns #}\n{# Thus, no \"GROUP BY 1\" #}\n\nwith table_a as (\nselect\n {{ column_name }},\n count(*) as num_rows\nfrom {{ model }}\ngroup by {{ column_name }}\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by {{ field }}\n),\n\nexcept_a as (\n select *\n from table_a\n {{ dbt_utils.except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ dbt_utils.except() }}\n select *\n from table_a\n),\n\nunioned as (\n select *\n from except_a\n union all\n select *\n from except_b\n)\n\nselect *\nfrom unioned\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.except"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.729391}, "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/Github/development/dbt_packages/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": "{% test expression_is_true(model, expression, column_name=None, condition='1=1') %}\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n {{ return(adapter.dispatch('test_expression_is_true', 'dbt_utils')(model, expression, column_name, condition)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.730592}, "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/Github/development/dbt_packages/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, expression, column_name, condition) %}\n\nwith meet_condition as (\n select * from {{ model }} where {{ condition }}\n)\n\nselect\n *\nfrom meet_condition\n{% if column_name is none %}\nwhere not({{ expression }})\n{%- else %}\nwhere not({{ column_name }} {{ expression }})\n{%- endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.731345}, "macro.dbt_utils.test_not_null_proportion": {"unique_id": "macro.dbt_utils.test_not_null_proportion", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/not_null_proportion.sql", "original_file_path": "macros/schema_tests/not_null_proportion.sql", "name": "test_not_null_proportion", "macro_sql": "{% macro test_not_null_proportion(model) %}\n {{ return(adapter.dispatch('test_not_null_proportion', 'dbt_utils')(model, **kwargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_proportion"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.732384}, "macro.dbt_utils.default__test_not_null_proportion": {"unique_id": "macro.dbt_utils.default__test_not_null_proportion", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/not_null_proportion.sql", "original_file_path": "macros/schema_tests/not_null_proportion.sql", "name": "default__test_not_null_proportion", "macro_sql": "{% macro default__test_not_null_proportion(model) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n{% set at_least = kwargs.get('at_least', kwargs.get('arg')) %}\n{% set at_most = kwargs.get('at_most', kwargs.get('arg', 1)) %}\n\nwith validation as (\n select\n sum(case when {{ column_name }} is null then 0 else 1 end) / cast(count(*) as numeric) as not_null_proportion\n from {{ model }}\n),\nvalidation_errors as (\n select\n not_null_proportion\n from validation\n where not_null_proportion < {{ at_least }} or not_null_proportion > {{ at_most }}\n)\nselect\n *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.7337852}, "macro.dbt_utils.test_sequential_values": {"unique_id": "macro.dbt_utils.test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/sequential_values.sql", "original_file_path": "macros/schema_tests/sequential_values.sql", "name": "test_sequential_values", "macro_sql": "{% test sequential_values(model, column_name, interval=1, datepart=None) %}\n\n {{ return(adapter.dispatch('test_sequential_values', 'dbt_utils')(model, column_name, interval, datepart)) }}\n\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_sequential_values"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.735261}, "macro.dbt_utils.default__test_sequential_values": {"unique_id": "macro.dbt_utils.default__test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/sequential_values.sql", "original_file_path": "macros/schema_tests/sequential_values.sql", "name": "default__test_sequential_values", "macro_sql": "{% macro default__test_sequential_values(model, column_name, interval=1, datepart=None) %}\n\nwith windowed as (\n\n select\n {{ column_name }},\n lag({{ column_name }}) over (\n order by {{ column_name }}\n ) as previous_{{ column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ dbt_utils.type_timestamp() }})= cast({{ dbt_utils.dateadd(datepart, interval, 'previous_' + column_name) }} as {{ dbt_utils.type_timestamp() }}))\n {% else %}\n where not({{ column_name }} = previous_{{ column_name }} + {{ interval }})\n {% endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.736877}, "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/Github/development/dbt_packages/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": "{% test not_null_where(model, column_name) %}\r\n {%- set deprecation_warning = '\r\n Warning: `dbt_utils.not_null_where` is no longer supported.\r\n Starting in dbt v0.20.0, the built-in `not_null` test supports a `where` config.\r\n ' -%}\r\n {%- do exceptions.warn(deprecation_warning) -%}\r\n {{ return(adapter.dispatch('test_not_null_where', 'dbt_utils')(model, column_name)) }}\r\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_where"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.7392461}, "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/Github/development/dbt_packages/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, column_name) %}\r\n {{ return(test_not_null(model, column_name)) }}\r\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.739786}, "macro.dbt_utils.test_equality": {"unique_id": "macro.dbt_utils.test_equality", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/schema_tests/equality.sql", "original_file_path": "macros/schema_tests/equality.sql", "name": "test_equality", "macro_sql": "{% test equality(model, compare_model, compare_columns=None) %}\n {{ return(adapter.dispatch('test_equality', 'dbt_utils')(model, compare_model, compare_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_equality"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.741355}, "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/Github/development/dbt_packages/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, compare_model, compare_columns=None) %}\n\n{% set set_diff %}\n count(*) + coalesce(abs(\n sum(case when which_diff = 'a_minus_b' then 1 else 0 end) -\n sum(case when which_diff = 'b_minus_a' then 1 else 0 end)\n ), 0)\n{% endset %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = set_diff) }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n-- setup\n{%- do dbt_utils._is_relation(model, 'test_equality') -%}\n\n{#-\nIf the compare_cols arg is provided, we can run this test without querying the\ninformation schema\u00a0\u2014 this allows the model to be an ephemeral model\n-#}\n\n{%- if not compare_columns -%}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set compare_columns = adapter.get_columns_in_relation(model) | map(attribute='quoted') -%}\n{%- endif -%}\n\n{% set compare_cols_csv = compare_columns | join(', ') %}\n\nwith a as (\n\n select * from {{ model }}\n\n),\n\nb as (\n\n select * from {{ compare_model }}\n\n),\n\na_minus_b as (\n\n select {{compare_cols_csv}} from a\n {{ dbt_utils.except() }}\n select {{compare_cols_csv}} from b\n\n),\n\nb_minus_a as (\n\n select {{compare_cols_csv}} from b\n {{ dbt_utils.except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select 'a_minus_b' as which_diff, a_minus_b.* from a_minus_b\n union all\n select 'b_minus_a' as which_diff, b_minus_a.* from b_minus_a\n\n)\n\nselect * from unioned\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.except"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.743687}, "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/Github/development/dbt_packages/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": "{% test mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', 'dbt_utils')(model, lower_bound_column, upper_bound_column, partition_by, gaps, zero_length_range_allowed)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_mutually_exclusive_ranges"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.748779}, "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/Github/development/dbt_packages/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', zero_length_range_allowed=False) %}\n{% if gaps == 'not_allowed' %}\n {% set allow_gaps_operator='=' %}\n {% set allow_gaps_operator_in_words='equal_to' %}\n{% elif gaps == 'allowed' %}\n {% set allow_gaps_operator='<=' %}\n {% set allow_gaps_operator_in_words='less_than_or_equal_to' %}\n{% elif gaps == 'required' %}\n {% set allow_gaps_operator='<' %}\n {% set allow_gaps_operator_in_words='less_than' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '\" ~ gaps ~\"'.'\"\n ) }}\n{% endif %}\n{% if not zero_length_range_allowed %}\n {% set allow_zero_length_operator='<' %}\n {% set allow_zero_length_operator_in_words='less_than' %}\n{% elif zero_length_range_allowed %}\n {% set allow_zero_length_operator='<=' %}\n {% set allow_zero_length_operator_in_words='less_than_or_equal_to' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`zero_length_range_allowed` argument for mutually_exclusive_ranges test must be one of [true, false] Got: '\" ~ zero_length_range_allowed ~\"'.'\"\n ) }}\n{% endif %}\n\n{% set partition_clause=\"partition by \" ~ partition_by if partition_by else '' %}\n\nwith window_functions as (\n\n select\n {% if partition_by %}\n {{ partition_by }} as partition_by_col,\n {% endif %}\n {{ lower_bound_column }} as lower_bound,\n {{ upper_bound_column }} as upper_bound,\n\n lead({{ lower_bound_column }}) over (\n {{ partition_clause }}\n order by {{ lower_bound_column }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_bound_column }} desc\n ) = 1 as is_last_record\n\n from {{ model }}\n\n),\n\ncalc as (\n -- We want to return records where one of our assumptions fails, so we'll use\n -- the `not` function with `and` statements so we can write our assumptions nore cleanly\n select\n *,\n\n -- For each record: lower_bound should be < upper_bound.\n -- Coalesce it to return an error on the null case (implicit assumption\n -- these columns are not_null)\n coalesce(\n lower_bound {{ allow_zero_length_operator }} upper_bound,\n false\n ) as lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect * from validation_errors\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.752703}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_utils')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.754851}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{dbt_utils.datediff(start_date, end_date, datepart)}}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.757396}, "macro.dbt_utils.date_spine": {"unique_id": "macro.dbt_utils.date_spine", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_utils')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.758188}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n/*\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": ["macro.dbt_utils.generate_series", "macro.dbt_utils.get_intervals_between", "macro.dbt_utils.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.7591}, "macro.dbt_utils.nullcheck_table": {"unique_id": "macro.dbt_utils.nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "name": "nullcheck_table", "macro_sql": "{% macro nullcheck_table(relation) %}\n {{ return(adapter.dispatch('nullcheck_table', 'dbt_utils')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck_table"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.760021}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "name": "default__nullcheck_table", "macro_sql": "{% macro default__nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(relation, 'nullcheck_table') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'nullcheck_table') -%}\n {% set cols = adapter.get_columns_in_relation(relation) %}\n\n select {{ dbt_utils.nullcheck(cols) }}\n from {{relation}}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.760905}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "name": "get_relations_by_pattern", "macro_sql": "{% macro get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_pattern', 'dbt_utils')(schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.7624938}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "name": "default__get_relations_by_pattern", "macro_sql": "{% macro default__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.764847}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.766988}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.768089}, "macro.dbt_utils.generate_series": {"unique_id": "macro.dbt_utils.generate_series", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.768569}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_utils.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.770018}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "name": "get_relations_by_prefix", "macro_sql": "{% macro get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_prefix', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.772264}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "name": "default__get_relations_by_prefix", "macro_sql": "{% macro default__get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_prefix_sql(schema, prefix, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.774571}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "name": "get_tables_by_prefix_sql", "macro_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_prefix_sql', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.77568}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "name": "default__get_tables_by_prefix_sql", "macro_sql": "{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(\n schema_pattern = schema,\n table_pattern = prefix ~ '%',\n exclude = exclude,\n database = database\n ) }}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.776403}, "macro.dbt_utils.star": {"unique_id": "macro.dbt_utils.star", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "name": "star", "macro_sql": "{% macro star(from, relation_alias=False, except=[], prefix='', suffix='') -%}\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, prefix, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.778103}, "macro.dbt_utils.default__star": {"unique_id": "macro.dbt_utils.default__star", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "name": "default__star", "macro_sql": "{% macro default__star(from, relation_alias=False, except=[], prefix='', suffix='') -%}\n {%- do dbt_utils._is_relation(from, 'star') -%}\n {%- do dbt_utils._is_ephemeral(from, 'star') -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return('') }}\n {% endif %}\n\n {%- set include_cols = [] %}\n {%- set cols = adapter.get_columns_in_relation(from) -%}\n {%- set except = except | map(\"lower\") | list %}\n {%- for col in cols -%}\n\n {%- if col.column|lower 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 }} as {{ adapter.quote(prefix ~ col ~ suffix)|trim }}\n {%- if not loop.last %},{{ '\\n ' }}{% endif %}\n\n {%- endfor -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.7812}, "macro.dbt_utils.unpivot": {"unique_id": "macro.dbt_utils.unpivot", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "name": "unpivot", "macro_sql": "{% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', table=none) -%}\n {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name, table)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.785264}, "macro.dbt_utils.default__unpivot": {"unique_id": "macro.dbt_utils.default__unpivot", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "name": "default__unpivot", "macro_sql": "{% macro default__unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', table=none) -%}\n\n {% if table %}\n {%- set error_message = '\n Warning: the `unpivot` macro no longer accepts a `table` parameter. \\\n This parameter will be deprecated in a future release of dbt-utils. Use the `relation` parameter instead. \\\n The {}.{} model triggered this warning. \\\n '.format(model.package_name, model.name) -%}\n {%- do exceptions.warn(error_message) -%}\n {% endif %}\n\n {% if relation and table %}\n {{ exceptions.raise_compiler_error(\"Error: both the `relation` and `table` parameters were provided to `unpivot` macro. Choose one only (we recommend `relation`).\") }}\n {% elif not relation and table %}\n {% set relation=table %}\n {% elif not relation and not table %}\n {{ exceptions.raise_compiler_error(\"Error: argument `relation` is required for `unpivot` macro.\") }}\n {% endif %}\n\n {%- set exclude = exclude if exclude is not none else [] %}\n {%- set remove = remove if remove is not none else [] %}\n\n {%- set include_cols = [] %}\n\n {%- set table_columns = {} %}\n\n {%- do table_columns.update({relation: []}) %}\n\n {%- do dbt_utils._is_relation(relation, 'unpivot') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'unpivot') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) %}\n\n {%- for col in cols -%}\n {%- if col.column.lower() not in remove|map('lower') and col.column.lower() not in exclude|map('lower') -%}\n {% do include_cols.append(col) %}\n {%- endif %}\n {%- endfor %}\n\n\n {%- for col in include_cols -%}\n select\n {%- for exclude_col in exclude %}\n {{ exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ dbt_utils.type_string() }}) as {{ field_name }},\n cast( {% if col.data_type == 'boolean' %}\n {{ dbt_utils.cast_bool_to_text(col.column) }}\n {% else %}\n {{ col.column }}\n {% endif %}\n as {{ cast_to }}) as {{ value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.type_string", "macro.dbt_utils.cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.790684}, "macro.dbt_utils.union_relations": {"unique_id": "macro.dbt_utils.union_relations", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "name": "union_relations", "macro_sql": "{%- macro union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation') -%}\n {{ return(adapter.dispatch('union_relations', 'dbt_utils')(relations, column_override, include, exclude, source_column_name)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__union_relations"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.793979}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "name": "default__union_relations", "macro_sql": "\n\n{%- macro default__union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation') -%}\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": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.string_literal", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.8006442}, "macro.dbt_utils.group_by": {"unique_id": "macro.dbt_utils.group_by", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "name": "group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_utils')(n)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.801523}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "name": "default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }} \n {%- endfor -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.802151}, "macro.dbt_utils.surrogate_key": {"unique_id": "macro.dbt_utils.surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "name": "surrogate_key", "macro_sql": "{%- macro surrogate_key(field_list) -%}\n {# needed for safe_add to allow for non-keyword arguments see SO post #}\n {# https://stackoverflow.com/questions/13944751/args-kwargs-in-jinja2-macros #}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('surrogate_key', 'dbt_utils')(field_list, *varargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.8037062}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "name": "default__surrogate_key", "macro_sql": "\n\n{%- macro default__surrogate_key(field_list) -%}\n\n{%- if varargs|length >= 1 or field_list is string %}\n\n{%- set error_message = '\nWarning: the `surrogate_key` macro now takes a single list argument instead of \\\nmultiple string arguments. Support for multiple string arguments will be \\\ndeprecated in a future release of dbt-utils. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.warn(error_message) -%}\n\n{# first argument is not included in varargs, so add first element to field_list_xf #}\n{%- set field_list_xf = [field_list] -%}\n\n{%- for field in varargs %}\n{%- set _ = field_list_xf.append(field) -%}\n{%- endfor -%}\n\n{%- else -%}\n\n{# if using list, just set field_list_xf as field_list #}\n{%- set field_list_xf = field_list -%}\n\n{%- endif -%}\n\n\n{%- set fields = [] -%}\n\n{%- for field in field_list_xf -%}\n\n {%- set _ = fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ dbt_utils.type_string() ~ \"), '')\"\n ) -%}\n\n {%- if not loop.last %}\n {%- set _ = fields.append(\"'-'\") -%}\n {%- endif -%}\n\n{%- endfor -%}\n\n{{dbt_utils.hash(dbt_utils.concat(fields))}}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string", "macro.dbt_utils.hash", "macro.dbt_utils.concat"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.806541}, "macro.dbt_utils.safe_add": {"unique_id": "macro.dbt_utils.safe_add", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "name": "safe_add", "macro_sql": "{%- macro safe_add() -%}\n {# needed for safe_add to allow for non-keyword arguments see SO post #}\n {# https://stackoverflow.com/questions/13944751/args-kwargs-in-jinja2-macros #}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('safe_add', 'dbt_utils')(*varargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__safe_add"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.807607}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "name": "default__safe_add", "macro_sql": "\n\n{%- macro default__safe_add() -%}\n\n{% set fields = [] %}\n\n{%- for field in varargs -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.808373}, "macro.dbt_utils.nullcheck": {"unique_id": "macro.dbt_utils.nullcheck", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "name": "nullcheck", "macro_sql": "{% macro nullcheck(cols) %}\n {{ return(adapter.dispatch('nullcheck', 'dbt_utils')(cols)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.8092868}, "macro.dbt_utils.default__nullcheck": {"unique_id": "macro.dbt_utils.default__nullcheck", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "name": "default__nullcheck", "macro_sql": "{% macro default__nullcheck(cols) %}\n{%- for col in cols %}\n\n {% if col.is_string() -%}\n\n nullif({{col.name}},'') as {{col.name}}\n\n {%- else -%}\n\n {{col.name}}\n\n {%- endif -%}\n\n{%- if not loop.last -%} , {%- endif -%}\n\n{%- endfor -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.810174}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "get_tables_by_pattern_sql", "macro_sql": "{% macro get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_pattern_sql', 'dbt_utils')\n (schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.8130538}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "default__get_tables_by_pattern_sql", "macro_sql": "{% macro default__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n select distinct\n table_schema as \"table_schema\",\n table_name as \"table_name\",\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as \"table_type\"\n 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": [], "created_at": 1644611541.813685}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "bigquery__get_tables_by_pattern_sql", "macro_sql": "{% macro bigquery__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% if '%' in schema_pattern %}\n {% set schemata=dbt_utils._bigquery__get_matching_schemata(schema_pattern, database) %}\n {% else %}\n {% set schemata=[schema_pattern] %}\n {% endif %}\n\n {% set sql %}\n {% for schema in schemata %}\n select distinct\n table_schema,\n table_name,\n 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": ["macro.dbt_utils._bigquery__get_matching_schemata"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.815799}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "_bigquery__get_matching_schemata", "macro_sql": "{% macro _bigquery__get_matching_schemata(schema_pattern, database) %}\n {% if execute %}\n\n {% set sql %}\n select schema_name from {{ adapter.quote(database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like lower('{{ schema_pattern }}')\n {% endset %}\n\n {% set results=run_query(sql) %}\n\n {% set schemata=results.columns['schema_name'].values() %}\n\n {{ return(schemata) }}\n\n {% else %}\n\n {{ return([]) }}\n\n {% endif %}\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.817122}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "name": "get_column_values", "macro_sql": "{% macro get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none) -%}\n {{ return(adapter.dispatch('get_column_values', 'dbt_utils')(table, column, order_by, max_records, default)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_column_values"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.8193479}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "name": "default__get_column_values", "macro_sql": "{% macro default__get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none) -%}\n{% if default is none %}\n {% set default = [] %}\n{% endif %}\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(default) }}\n {% endif %}\n\n {# Not all relations are tables. Renaming for internal clarity without breaking functionality for anyone using named arguments #}\n {# TODO: Change the method signature in a future 0.x.0 release #}\n {%- set target_relation = table -%}\n\n {# adapter.load_relation is a convenience wrapper to avoid building a Relation when we already have one #}\n {% set relation_exists = (load_relation(target_relation)) is not none %}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not relation_exists and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ target_relation ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not relation_exists and default is not none -%}\n\n {{ log(\"Relation \" ~ target_relation ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n group by {{ column }}\n order by {{ order_by }}\n\n {% if max_records is not none %}\n limit {{ max_records }}\n {% endif %}\n\n {% endif %}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_column_values') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values) }}\n {%- else -%}\n {{ return(default) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_relation", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.824961}, "macro.dbt_utils.pivot": {"unique_id": "macro.dbt_utils.pivot", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "name": "pivot", "macro_sql": "{% macro pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {{ return(adapter.dispatch('pivot', 'dbt_utils')(column, values, alias, agg, cmp, prefix, suffix, then_value, else_value, quote_identifiers, distinct)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pivot"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.827363}, "macro.dbt_utils.default__pivot": {"unique_id": "macro.dbt_utils.default__pivot", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "name": "default__pivot", "macro_sql": "{% macro default__pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {% for 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 {{ dbt_utils.slugify(prefix ~ v ~ suffix) }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.829673}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "name": "get_query_results_as_dict", "macro_sql": "{% macro get_query_results_as_dict(query) %}\n {{ return(adapter.dispatch('get_query_results_as_dict', 'dbt_utils')(query)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_query_results_as_dict"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.830676}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "name": "default__get_query_results_as_dict", "macro_sql": "{% macro default__get_query_results_as_dict(query) %}\n\n{# This macro returns a dictionary of the form {column_name: (tuple_of_results)} #}\n\n {%- call statement('get_query_results', fetch_result=True,auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {% set sql_results={} %}\n\n {%- if execute -%}\n {% set sql_results_table = load_result('get_query_results').table.columns %}\n {% for column_name, column in sql_results_table.items() %}\n {% do sql_results.update({column_name: column.values()}) %}\n {% endfor %}\n {%- endif -%}\n\n {{ return(sql_results) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.8324218}, "macro.dbt_utils.degrees_to_radians": {"unique_id": "macro.dbt_utils.degrees_to_radians", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "degrees_to_radians", "macro_sql": "{% macro degrees_to_radians(degrees) -%}\n acos(-1) * {{degrees}} / 180\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.834713}, "macro.dbt_utils.haversine_distance": {"unique_id": "macro.dbt_utils.haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "haversine_distance", "macro_sql": "{% macro haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n {{ return(adapter.dispatch('haversine_distance', 'dbt_utils')(lat1,lon1,lat2,lon2,unit)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.835585}, "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/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n\n 2 * 3961 * asin(sqrt(power((sin(radians(({{ lat2 }} - {{ lat1 }}) / 2))), 2) +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n power((sin(radians(({{ lon2 }} - {{ lon1 }}) / 2))), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.838157}, "macro.dbt_utils.bigquery__haversine_distance": {"unique_id": "macro.dbt_utils.bigquery__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "bigquery__haversine_distance", "macro_sql": "{% macro bigquery__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{% set radians_lat1 = dbt_utils.degrees_to_radians(lat1) %}\n{% set radians_lat2 = dbt_utils.degrees_to_radians(lat2) %}\n{% set radians_lon1 = dbt_utils.degrees_to_radians(lon1) %}\n{% set radians_lon2 = dbt_utils.degrees_to_radians(lon2) %}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n 2 * 3961 * asin(sqrt(power(sin(({{ radians_lat2 }} - {{ radians_lat1 }}) / 2), 2) +\n cos({{ radians_lat1 }}) * cos({{ radians_lat2 }}) *\n power(sin(({{ radians_lon2 }} - {{ radians_lon1 }}) / 2), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.degrees_to_radians"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.841558}, "macro.fivetran_utils.enabled_vars": {"unique_id": "macro.fivetran_utils.enabled_vars", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/enabled_vars.sql", "original_file_path": "macros/enabled_vars.sql", "name": "enabled_vars", "macro_sql": "{% macro enabled_vars(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, True) == False %}\n {{ return(False) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(True) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.842825}, "macro.fivetran_utils.percentile": {"unique_id": "macro.fivetran_utils.percentile", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "percentile", "macro_sql": "{% macro percentile(percentile_field, partition_field, percent) -%}\n\n{{ adapter.dispatch('percentile', 'fivetran_utils') (percentile_field, partition_field, percent) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__percentile"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.8447402}, "macro.fivetran_utils.default__percentile": {"unique_id": "macro.fivetran_utils.default__percentile", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "default__percentile", "macro_sql": "{% macro default__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.8452249}, "macro.fivetran_utils.redshift__percentile": {"unique_id": "macro.fivetran_utils.redshift__percentile", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "redshift__percentile", "macro_sql": "{% macro redshift__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.845655}, "macro.fivetran_utils.bigquery__percentile": {"unique_id": "macro.fivetran_utils.bigquery__percentile", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "bigquery__percentile", "macro_sql": "{% macro bigquery__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.84636}, "macro.fivetran_utils.postgres__percentile": {"unique_id": "macro.fivetran_utils.postgres__percentile", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "postgres__percentile", "macro_sql": "{% macro postgres__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n /* have to group by partition field */\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.847003}, "macro.fivetran_utils.spark__percentile": {"unique_id": "macro.fivetran_utils.spark__percentile", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "spark__percentile", "macro_sql": "{% macro spark__percentile(percentile_field, partition_field, percent) %}\n\n percentile( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.847439}, "macro.fivetran_utils.pivot_json_extract": {"unique_id": "macro.fivetran_utils.pivot_json_extract", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/pivot_json_extract.sql", "original_file_path": "macros/pivot_json_extract.sql", "name": "pivot_json_extract", "macro_sql": "{% macro pivot_json_extract(string, list_of_properties) %}\n\n{%- for property in list_of_properties -%}\n\nreplace( {{ fivetran_utils.json_extract(string, property) }}, '\"', '') as {{ property | replace(' ', '_') | lower }}\n\n{%- if not loop.last -%},{%- endif %}\n{% endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.json_extract"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.848625}, "macro.fivetran_utils.persist_pass_through_columns": {"unique_id": "macro.fivetran_utils.persist_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/persist_pass_through_columns.sql", "original_file_path": "macros/persist_pass_through_columns.sql", "name": "persist_pass_through_columns", "macro_sql": "{% macro persist_pass_through_columns(pass_through_variable) %}\n\n{% if var(pass_through_variable, none) %}\n {% for field in var(pass_through_variable) %}\n , {{ field.alias if field.alias else field.name }}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.849771}, "macro.fivetran_utils.json_parse": {"unique_id": "macro.fivetran_utils.json_parse", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "json_parse", "macro_sql": "{% macro json_parse(string, string_path) -%}\n\n{{ adapter.dispatch('json_parse', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__json_parse"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.851796}, "macro.fivetran_utils.default__json_parse": {"unique_id": "macro.fivetran_utils.default__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "default__json_parse", "macro_sql": "{% macro default__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.852441}, "macro.fivetran_utils.redshift__json_parse": {"unique_id": "macro.fivetran_utils.redshift__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "redshift__json_parse", "macro_sql": "{% macro redshift__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.85326}, "macro.fivetran_utils.bigquery__json_parse": {"unique_id": "macro.fivetran_utils.bigquery__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "bigquery__json_parse", "macro_sql": "{% macro bigquery__json_parse(string, string_path) %}\n\n \n json_extract_scalar({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.8541381}, "macro.fivetran_utils.postgres__json_parse": {"unique_id": "macro.fivetran_utils.postgres__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "postgres__json_parse", "macro_sql": "{% macro postgres__json_parse(string, string_path) %}\n\n {{string}}::json #>> '{ {%- for s in string_path -%}{{ s }}{%- if not loop.last -%},{%- endif -%}{%- endfor -%} }'\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.855019}, "macro.fivetran_utils.snowflake__json_parse": {"unique_id": "macro.fivetran_utils.snowflake__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "snowflake__json_parse", "macro_sql": "{% macro snowflake__json_parse(string, string_path) %}\n\n parse_json( {{string}} ) {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.8557062}, "macro.fivetran_utils.spark__json_parse": {"unique_id": "macro.fivetran_utils.spark__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "spark__json_parse", "macro_sql": "{% macro spark__json_parse(string, string_path) %}\n\n {{string}} : {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.85639}, "macro.fivetran_utils.max_bool": {"unique_id": "macro.fivetran_utils.max_bool", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "max_bool", "macro_sql": "{% macro max_bool(boolean_field) -%}\n\n{{ adapter.dispatch('max_bool', 'fivetran_utils') (boolean_field) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__max_bool"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.857416}, "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/Github/development/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "default__max_bool", "macro_sql": "{% macro default__max_bool(boolean_field) %}\n\n bool_or( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.8577878}, "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/Github/development/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "snowflake__max_bool", "macro_sql": "{% macro snowflake__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.8580952}, "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/Github/development/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "bigquery__max_bool", "macro_sql": "{% macro bigquery__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.858353}, "macro.fivetran_utils.calculated_fields": {"unique_id": "macro.fivetran_utils.calculated_fields", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/calculated_fields.sql", "original_file_path": "macros/calculated_fields.sql", "name": "calculated_fields", "macro_sql": "{% macro calculated_fields(variable) -%}\n\n{% if var(variable, none) %}\n {% for field in var(variable) %}\n , {{ field.transform_sql }} as {{ field.name }} \n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.859615}, "macro.fivetran_utils.seed_data_helper": {"unique_id": "macro.fivetran_utils.seed_data_helper", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/seed_data_helper.sql", "original_file_path": "macros/seed_data_helper.sql", "name": "seed_data_helper", "macro_sql": "{% macro seed_data_helper(seed_name, warehouses) %}\n\n{% if target.type in warehouses %}\n {% for w in warehouses %}\n {% if target.type == w %}\n {{ return(ref(seed_name ~ \"_\" ~ w ~ \"\")) }}\n {% endif %}\n {% endfor %}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.861293}, "macro.fivetran_utils.fill_pass_through_columns": {"unique_id": "macro.fivetran_utils.fill_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/fill_pass_through_columns.sql", "original_file_path": "macros/fill_pass_through_columns.sql", "name": "fill_pass_through_columns", "macro_sql": "{% macro fill_pass_through_columns(pass_through_variable) %}\n\n{% if var(pass_through_variable) %}\n {% for field in var(pass_through_variable) %}\n {% if field.transform_sql %}\n , {{ field.transform_sql }} as {{ field.alias if field.alias else field.name }}\n {% else %}\n , {{ field.alias if field.alias else field.name }}\n {% endif %}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.863117}, "macro.fivetran_utils.string_agg": {"unique_id": "macro.fivetran_utils.string_agg", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "string_agg", "macro_sql": "{% macro string_agg(field_to_agg, delimiter) -%}\n\n{{ adapter.dispatch('string_agg', 'fivetran_utils') (field_to_agg, delimiter) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__string_agg"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.864347}, "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/Github/development/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "default__string_agg", "macro_sql": "{% macro default__string_agg(field_to_agg, delimiter) %}\n string_agg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.8646982}, "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/Github/development/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "snowflake__string_agg", "macro_sql": "{% macro snowflake__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.8650408}, "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/Github/development/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "redshift__string_agg", "macro_sql": "{% macro redshift__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.865387}, "macro.fivetran_utils.spark__string_agg": {"unique_id": "macro.fivetran_utils.spark__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "spark__string_agg", "macro_sql": "{% macro spark__string_agg(field_to_agg, delimiter) %}\n -- collect set will remove duplicates\n replace(replace(replace(cast( collect_set({{ field_to_agg }}) as string), '[', ''), ']', ''), ', ', {{ delimiter }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.865741}, "macro.fivetran_utils.timestamp_diff": {"unique_id": "macro.fivetran_utils.timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "timestamp_diff", "macro_sql": "{% macro timestamp_diff(first_date, second_date, datepart) %}\n {{ adapter.dispatch('timestamp_diff', 'fivetran_utils')(first_date, second_date, datepart) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__timestamp_diff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.870344}, "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/Github/development/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "default__timestamp_diff", "macro_sql": "{% macro default__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.8707972}, "macro.fivetran_utils.redshift__timestamp_diff": {"unique_id": "macro.fivetran_utils.redshift__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "redshift__timestamp_diff", "macro_sql": "{% macro redshift__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.8719501}, "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/Github/development/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "bigquery__timestamp_diff", "macro_sql": "{% macro bigquery__timestamp_diff(first_date, second_date, datepart) %}\n\n timestamp_diff(\n {{second_date}},\n {{first_date}},\n {{datepart}}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.872694}, "macro.fivetran_utils.postgres__timestamp_diff": {"unique_id": "macro.fivetran_utils.postgres__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "postgres__timestamp_diff", "macro_sql": "{% macro postgres__timestamp_diff(first_date, second_date, datepart) %}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ dbt_utils.datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.datediff"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.877735}, "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/Github/development/dbt_packages/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": ["macro.fivetran_utils.get_columns_for_macro"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.88162}, "macro.fivetran_utils.source_relation": {"unique_id": "macro.fivetran_utils.source_relation", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "name": "source_relation", "macro_sql": "{% macro source_relation(union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('source_relation', 'fivetran_utils') (union_schema_variable, union_database_variable) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__source_relation"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.882951}, "macro.fivetran_utils.default__source_relation": {"unique_id": "macro.fivetran_utils.default__source_relation", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "name": "default__source_relation", "macro_sql": "{% macro default__source_relation(union_schema_variable, union_database_variable) %}\n\n{% if var(union_schema_variable, none) %}\n, case\n {% for schema in var(union_schema_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%.{{ schema|lower }}.%' then '{{ schema|lower }}'\n {% endfor %}\n end as source_relation\n{% elif var(union_database_variable, none) %}\n, case\n {% for database in var(union_database_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%{{ database|lower }}.%' then '{{ database|lower }}'\n {% endfor %}\n end as source_relation\n{% else %}\n, cast('' as {{ dbt_utils.type_string() }}) as source_relation\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.884437}, "macro.fivetran_utils.first_value": {"unique_id": "macro.fivetran_utils.first_value", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "first_value", "macro_sql": "{% macro first_value(first_value_field, partition_field, order_by_field, order=\"asc\") -%}\n\n{{ adapter.dispatch('first_value', 'fivetran_utils') (first_value_field, partition_field, order_by_field, order) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__first_value"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.885633}, "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/Github/development/dbt_packages/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "default__first_value", "macro_sql": "{% macro default__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.886689}, "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/Github/development/dbt_packages/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "redshift__first_value", "macro_sql": "{% macro redshift__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} , {{ partition_field }} rows unbounded preceding )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.8879292}, "macro.fivetran_utils.add_dbt_source_relation": {"unique_id": "macro.fivetran_utils.add_dbt_source_relation", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/add_dbt_source_relation.sql", "original_file_path": "macros/add_dbt_source_relation.sql", "name": "add_dbt_source_relation", "macro_sql": "{% macro add_dbt_source_relation() %}\n\n{% if var('union_schemas', none) or var('union_databases', none) %}\n, _dbt_source_relation\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.8899179}, "macro.fivetran_utils.add_pass_through_columns": {"unique_id": "macro.fivetran_utils.add_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/add_pass_through_columns.sql", "original_file_path": "macros/add_pass_through_columns.sql", "name": "add_pass_through_columns", "macro_sql": "{% macro add_pass_through_columns(base_columns, pass_through_var) %}\n\n {% if pass_through_var %}\n\n {% for column in pass_through_var %}\n\n {% if column.alias %}\n\n {% do base_columns.append({ \"name\": column.name, \"alias\": column.alias, \"datatype\": column.datatype if column.datatype else dbt_utils.type_string()}) %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column.name, \"datatype\": column.datatype if column.datatype else dbt_utils.type_string()}) %}\n \n {% endif %}\n\n {% endfor %}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.892826}, "macro.fivetran_utils.staging_models_automation": {"unique_id": "macro.fivetran_utils.staging_models_automation", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/staging_models_automation.sql", "original_file_path": "macros/staging_models_automation.sql", "name": "staging_models_automation", "macro_sql": "{% macro staging_models_automation(package, source_schema, source_database, tables) %}\n\n{% set package = \"\"~ package ~\"\" %}\n{% set source_schema = \"\"~ source_schema ~\"\" %}\n{% set source_database = \"\"~ source_database ~\"\" %}\n\n{% set zsh_command_columns = \"source dbt_packages/fivetran_utils/generate_columns.sh '../dbt_\"\"\"~ package ~\"\"\"_source' stg_\"\"\"~ package ~\"\"\" \"\"\"~ source_database ~\"\"\" \"\"\"~ source_schema ~\"\"\" \" %}\n{% set zsh_command_models = \"source dbt_packages/fivetran_utils/generate_models.sh '../dbt_\"\"\"~ package ~\"\"\"_source' stg_\"\"\"~ package ~\"\"\" \"\"\"~ source_database ~\"\"\" \"\"\"~ source_schema ~\"\"\" \" %}\n\n{%- set columns_array = [] -%}\n{%- set models_array = [] -%}\n\n{% for t in tables %}\n {% set help_command = zsh_command_columns + t %}\n {{ columns_array.append(help_command) }}\n\n {% set help_command = zsh_command_models + t %}\n {{ models_array.append(help_command) }}\n\n{% endfor %}\n\n{{ log(columns_array|join(' && \\n') + ' && \\n' + models_array|join(' && \\n'), info=True) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.8968909}, "macro.fivetran_utils.union_relations": {"unique_id": "macro.fivetran_utils.union_relations", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "name": "union_relations", "macro_sql": "{%- macro union_relations(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n {%- set source_column_name = source_column_name if source_column_name is not none else '_dbt_source_relation' -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt_utils.string_literal(relation) }} as {{ dbt_utils.type_string() }}) as {{ source_column_name }},\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ aliases[loop.index0] if aliases else relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils.string_literal", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.907565}, "macro.fivetran_utils.union_tables": {"unique_id": "macro.fivetran_utils.union_tables", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "name": "union_tables", "macro_sql": "{%- macro union_tables(tables, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_table') -%}\n\n {%- do exceptions.warn(\"Warning: the `union_tables` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use the `union_relations` macro instead\") -%}\n\n {{ return(dbt_utils.union_relations(tables, column_override, include, exclude, source_column_name)) }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.9084768}, "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/Github/development/dbt_packages/fivetran_utils", "path": "macros/snowflake_seed_data.sql", "original_file_path": "macros/snowflake_seed_data.sql", "name": "snowflake_seed_data", "macro_sql": "{% macro snowflake_seed_data(seed_name) %}\n\n{% if target.type == 'snowflake' %}\n{{ return(ref(seed_name ~ '_snowflake')) }}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.9096582}, "macro.fivetran_utils.default__get_columns_for_macro": {"unique_id": "macro.fivetran_utils.default__get_columns_for_macro", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/get_columns_for_macro.sql", "original_file_path": "macros/get_columns_for_macro.sql", "name": "default__get_columns_for_macro", "macro_sql": "{% macro default__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) like '%num%' 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": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.9128802}, "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/Github/development/dbt_packages/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) like '%num%' 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": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.914583}, "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/Github/development/dbt_packages/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": ["macro.fivetran_utils.bigquery__get_columns_for_macro"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.9151978}, "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/Github/development/dbt_packages/fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "name": "fill_staging_columns", "macro_sql": "{% macro fill_staging_columns(source_columns, staging_columns) -%}\n\n{%- set source_column_names = source_columns|map(attribute='name')|map('lower')|list -%}\n\n{%- for column in staging_columns %}\n {% if column.name|lower in source_column_names -%}\n {{ fivetran_utils.quote_column(column) }} as \n {%- if 'alias' in column %} {{ column.alias }} {% else %} {{ fivetran_utils.quote_column(column) }} {%- endif -%}\n {%- else -%}\n cast(null as {{ column.datatype }})\n {%- if 'alias' in column %} as {{ column.alias }} {% else %} as {{ fivetran_utils.quote_column(column) }} {% endif -%}\n {%- endif -%}\n {%- if not loop.last -%} , {% endif -%}\n{% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.quote_column"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.919146}, "macro.fivetran_utils.quote_column": {"unique_id": "macro.fivetran_utils.quote_column", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "name": "quote_column", "macro_sql": "{% macro quote_column(column) %}\n {% if 'quote' in column %}\n {% if column.quote %}\n {% if target.type in ('bigquery', 'spark') %}\n `{{ column.name }}`\n {% elif target.type == 'snowflake' %}\n \"{{ column.name | upper }}\"\n {% else %}\n \"{{ column.name }}\"\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.920873}, "macro.fivetran_utils.json_extract": {"unique_id": "macro.fivetran_utils.json_extract", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "json_extract", "macro_sql": "{% macro json_extract(string, string_path) -%}\n\n{{ adapter.dispatch('json_extract', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__json_extract"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.9225228}, "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/Github/development/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "default__json_extract", "macro_sql": "{% macro default__json_extract(string, string_path) %}\n\n json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} )\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.923062}, "macro.fivetran_utils.snowflake__json_extract": {"unique_id": "macro.fivetran_utils.snowflake__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "snowflake__json_extract", "macro_sql": "{% macro snowflake__json_extract(string, string_path) %}\n\n json_extract_path_text(try_parse_json( {{string}} ), {{ \"'\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.923554}, "macro.fivetran_utils.redshift__json_extract": {"unique_id": "macro.fivetran_utils.redshift__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "redshift__json_extract", "macro_sql": "{% macro redshift__json_extract(string, string_path) %}\n\n case when is_valid_json( {{string}} ) then json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} ) else null end\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.924078}, "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/Github/development/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "bigquery__json_extract", "macro_sql": "{% macro bigquery__json_extract(string, string_path) %}\n\n json_extract_scalar({{string}}, {{ \"'$.\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.924542}, "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/Github/development/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "postgres__json_extract", "macro_sql": "{% macro postgres__json_extract(string, string_path) %}\n\n {{string}}::json->>{{\"'\" ~ string_path ~ \"'\" }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.925021}, "macro.fivetran_utils.collect_freshness": {"unique_id": "macro.fivetran_utils.collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "name": "collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness')(source, loaded_at_field, filter))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.development.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.92684}, "macro.fivetran_utils.default__collect_freshness": {"unique_id": "macro.fivetran_utils.default__collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "name": "default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n\n {%- set enabled_array = [] -%}\n {% for node in graph.sources.values() %}\n {% if node.identifier == source.identifier %}\n {% if (node.meta['is_enabled'] | default(true)) %}\n {%- do enabled_array.append(1) -%}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% set is_enabled = (enabled_array != []) %}\n\n select\n {% if is_enabled %}\n max({{ loaded_at_field }})\n {% else %} \n {{ current_timestamp() }} {% endif %} as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n\n {% if is_enabled %}\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endif %}\n\n {% endcall %}\n {{ return(load_result('collect_freshness').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.929805}, "macro.fivetran_utils.timestamp_add": {"unique_id": "macro.fivetran_utils.timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "timestamp_add", "macro_sql": "{% macro timestamp_add(datepart, interval, from_timestamp) -%}\n\n{{ adapter.dispatch('timestamp_add', 'fivetran_utils') (datepart, interval, from_timestamp) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__timestamp_add"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.931514}, "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/Github/development/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "default__timestamp_add", "macro_sql": "{% macro default__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestampadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.932014}, "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/Github/development/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "bigquery__timestamp_add", "macro_sql": "{% macro bigquery__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestamp_add({{ from_timestamp }}, interval {{ interval }} {{ datepart }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.9324968}, "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/Github/development/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "redshift__timestamp_add", "macro_sql": "{% macro redshift__timestamp_add(datepart, interval, from_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.932984}, "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/Github/development/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "postgres__timestamp_add", "macro_sql": "{% macro postgres__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ from_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.933464}, "macro.fivetran_utils.spark__timestamp_add": {"unique_id": "macro.fivetran_utils.spark__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "spark__timestamp_add", "macro_sql": "{% macro spark__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ dbt_utils.dateadd(datepart, interval, from_timestamp) }}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.9339972}, "macro.fivetran_utils.ceiling": {"unique_id": "macro.fivetran_utils.ceiling", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "ceiling", "macro_sql": "{% macro ceiling(num) -%}\n\n{{ adapter.dispatch('ceiling', 'fivetran_utils') (num) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__ceiling"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.93487}, "macro.fivetran_utils.default__ceiling": {"unique_id": "macro.fivetran_utils.default__ceiling", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "default__ceiling", "macro_sql": "{% macro default__ceiling(num) %}\n ceiling({{ num }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.93518}, "macro.fivetran_utils.snowflake__ceiling": {"unique_id": "macro.fivetran_utils.snowflake__ceiling", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "snowflake__ceiling", "macro_sql": "{% macro snowflake__ceiling(num) %}\n ceil({{ num }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.935649}, "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/Github/development/dbt_packages/fivetran_utils", "path": "macros/remove_prefix_from_columns.sql", "original_file_path": "macros/remove_prefix_from_columns.sql", "name": "remove_prefix_from_columns", "macro_sql": "{% macro remove_prefix_from_columns(columns, prefix='', exclude=[]) %}\n\n {%- for col in columns if col.name not in exclude -%}\n {%- if col.name[:prefix|length]|lower == prefix -%}\n {{ col.name }} as {{ col.name[prefix|length:] }}\n {%- else -%}\n {{ col.name }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {% endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.9377239}, "macro.fivetran_utils.union_data": {"unique_id": "macro.fivetran_utils.union_data", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "name": "union_data", "macro_sql": "{% macro union_data(table_identifier, database_variable, schema_variable, default_database, default_schema, default_variable, union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('union_data', 'fivetran_utils') (\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__union_data"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.94057}, "macro.fivetran_utils.default__union_data": {"unique_id": "macro.fivetran_utils.default__union_data", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "name": "default__union_data", "macro_sql": "{% macro default__union_data(\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) %}\n\n{% if var(union_schema_variable, none) %}\n\n {% set relations = [] %}\n \n {% if var(union_schema_variable) is string %}\n {% set trimmed = var(union_schema_variable)|trim('[')|trim(']') %}\n {% set schemas = trimmed.split(',')|map('trim',\" \")|map('trim','\"')|map('trim',\"'\") %}\n {% else %}\n {% set schemas = var(union_schema_variable) %}\n {% endif %}\n\n {% for schema in var(union_schema_variable) %}\n\n {% set relation=adapter.get_relation(\n database=var(database_variable, default_database),\n schema=schema,\n identifier=table_identifier\n ) -%}\n \n {% set relation_exists=relation is not none %}\n\n {% if relation_exists %}\n\n {% do relations.append(relation) %}\n \n {% endif %}\n\n {% endfor %}\n\n {{ dbt_utils.union_relations(relations) }}\n\n{% elif var(union_database_variable, none) %}\n\n {% set relations = [] %}\n\n {% for database in var(union_database_variable) %}\n\n {% set relation=adapter.get_relation(\n database=database,\n schema=var(schema_variable, default_schema),\n identifier=table_identifier\n ) -%}\n\n {% set relation_exists=relation is not none %}\n\n {% if relation_exists %}\n\n {% do relations.append(relation) %}\n \n {% endif %}\n\n {% endfor %}\n\n {{ dbt_utils.union_relations(relations) }}\n\n{% else %}\n\n select * \n from {{ var(default_variable) }}\n\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.945896}, "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/Github/development/dbt_packages/fivetran_utils", "path": "macros/dummy_coalesce_value.sql", "original_file_path": "macros/dummy_coalesce_value.sql", "name": "dummy_coalesce_value", "macro_sql": "{% macro dummy_coalesce_value(column) %}\n\n{% set coalesce_value = {\n 'STRING': \"'DUMMY_STRING'\",\n 'BOOLEAN': 'null',\n 'INT': 999999999,\n 'FLOAT': 999999999.99,\n 'TIMESTAMP': 'cast(\"2099-12-31\" as timestamp)',\n 'DATE': 'cast(\"2099-12-31\" as date)',\n} %}\n\n{% if column.is_float() %}\n{{ return(coalesce_value['FLOAT']) }}\n\n{% elif column.is_numeric() %}\n{{ return(coalesce_value['INT']) }}\n\n{% elif column.is_string() %}\n{{ return(coalesce_value['STRING']) }}\n\n{% elif column.data_type|lower == 'boolean' %}\n{{ return(coalesce_value['BOOLEAN']) }}\n\n{% elif 'timestamp' in column.data_type|lower %}\n{{ return(coalesce_value['TIMESTAMP']) }}\n\n{% elif 'date' in column.data_type|lower %}\n{{ return(coalesce_value['DATE']) }}\n\n{% elif 'int' in column.data_type|lower %}\n{{ return(coalesce_value['INT']) }}\n\n{% endif %}\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.950135}, "macro.fivetran_utils.array_agg": {"unique_id": "macro.fivetran_utils.array_agg", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "array_agg", "macro_sql": "{% macro array_agg(field_to_agg) -%}\n\n{{ adapter.dispatch('array_agg', 'fivetran_utils') (field_to_agg) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__array_agg"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.9510121}, "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/Github/development/dbt_packages/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "default__array_agg", "macro_sql": "{% macro default__array_agg(field_to_agg) %}\n array_agg({{ field_to_agg }})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.951319}, "macro.fivetran_utils.redshift__array_agg": {"unique_id": "macro.fivetran_utils.redshift__array_agg", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "redshift__array_agg", "macro_sql": "{% macro redshift__array_agg(field_to_agg) %}\n listagg({{ field_to_agg }}, ',')\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.95162}, "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/Github/development/dbt_packages/fivetran_utils", "path": "macros/empty_variable_warning.sql", "original_file_path": "macros/empty_variable_warning.sql", "name": "empty_variable_warning", "macro_sql": "{% macro empty_variable_warning(variable, downstream_model) %}\n\n{% if not var(variable) %}\n{{ log(\n \"\"\"\n Warning: You have passed an empty list to the \"\"\" ~ variable ~ \"\"\".\n As a result, you won't see the history of any columns in the \"\"\" ~ downstream_model ~ \"\"\" model.\n \"\"\",\n info=True\n) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.952806}, "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/Github/development/dbt_packages/fivetran_utils", "path": "macros/enabled_vars_one_true.sql", "original_file_path": "macros/enabled_vars_one_true.sql", "name": "enabled_vars_one_true", "macro_sql": "{% macro enabled_vars_one_true(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, False) == True %}\n {{ return(True) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(False) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.95437}, "macro.github_source.get_issue_columns": {"unique_id": "macro.github_source.get_issue_columns", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "macros/get_issue_columns.sql", "original_file_path": "macros/get_issue_columns.sql", "name": "get_issue_columns", "macro_sql": "{% macro get_issue_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"body\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"closed_at\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"locked\", \"datatype\": \"boolean\"},\n {\"name\": \"milestone_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"number\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"pull_request\", \"datatype\": \"boolean\"},\n {\"name\": \"repository_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"state\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"title\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"user_id\", \"datatype\": dbt_utils.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.959317}, "macro.github_source.get_issue_comment_columns": {"unique_id": "macro.github_source.get_issue_comment_columns", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "macros/get_issue_comment_columns.sql", "original_file_path": "macros/get_issue_comment_columns.sql", "name": "get_issue_comment_columns", "macro_sql": "{% macro get_issue_comment_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"body\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"created_at\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"issue_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"updated_at\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"user_id\", \"datatype\": dbt_utils.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.961767}, "macro.github_source.get_repository_columns": {"unique_id": "macro.github_source.get_repository_columns", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "macros/get_repository_columns.sql", "original_file_path": "macros/get_repository_columns.sql", "name": "get_repository_columns", "macro_sql": "{% macro get_repository_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"archived\", \"datatype\": \"boolean\"},\n {\"name\": \"created_at\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"default_branch\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"description\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"fork\", \"datatype\": \"boolean\"},\n {\"name\": \"full_name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"homepage\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"language\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"owner_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"private\", \"datatype\": \"boolean\"}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.965651}, "macro.github_source.get_issue_merged_columns": {"unique_id": "macro.github_source.get_issue_merged_columns", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "macros/get_issue_merged_columns.sql", "original_file_path": "macros/get_issue_merged_columns.sql", "name": "get_issue_merged_columns", "macro_sql": "{% macro get_issue_merged_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"actor_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"commit_sha\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"issue_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"merged_at\", \"datatype\": dbt_utils.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_int", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.9678679}, "macro.github_source.get_pull_request_review_columns": {"unique_id": "macro.github_source.get_pull_request_review_columns", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "macros/get_pull_request_review_columns.sql", "original_file_path": "macros/get_pull_request_review_columns.sql", "name": "get_pull_request_review_columns", "macro_sql": "{% macro get_pull_request_review_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"body\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"commit_sha\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"pull_request_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"state\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"submitted_at\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"user_id\", \"datatype\": dbt_utils.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.970551}, "macro.github_source.get_team_columns": {"unique_id": "macro.github_source.get_team_columns", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_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_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"description\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"org_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"parent_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"privacy\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"slug\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.9736488}, "macro.github_source.get_issue_assignee_columns": {"unique_id": "macro.github_source.get_issue_assignee_columns", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "macros/get_issue_assignee_columns.sql", "original_file_path": "macros/get_issue_assignee_columns.sql", "name": "get_issue_assignee_columns", "macro_sql": "{% macro get_issue_assignee_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"issue_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"user_id\", \"datatype\": dbt_utils.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.975107}, "macro.github_source.get_user_columns": {"unique_id": "macro.github_source.get_user_columns", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_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\": \"company\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"login\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_string", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.976779}, "macro.github_source.get_label_columns": {"unique_id": "macro.github_source.get_label_columns", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "macros/get_label_columns.sql", "original_file_path": "macros/get_label_columns.sql", "name": "get_label_columns", "macro_sql": "{% macro get_label_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"color\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"description\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"is_default\", \"datatype\": \"boolean\"},\n {\"name\": \"name\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"url\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.979637}, "macro.github_source.get_pull_request_columns": {"unique_id": "macro.github_source.get_pull_request_columns", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "macros/get_pull_request_columns.sql", "original_file_path": "macros/get_pull_request_columns.sql", "name": "get_pull_request_columns", "macro_sql": "{% macro get_pull_request_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"base_label\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"base_ref\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"base_repo_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"base_sha\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"base_user_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"head_label\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"head_ref\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"head_repo_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"head_sha\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"head_user_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"issue_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"merge_commit_sha\", \"datatype\": dbt_utils.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.984023}, "macro.github_source.get_requested_reviewer_history_columns": {"unique_id": "macro.github_source.get_requested_reviewer_history_columns", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "macros/get_requested_reviewer_history_columns.sql", "original_file_path": "macros/get_requested_reviewer_history_columns.sql", "name": "get_requested_reviewer_history_columns", "macro_sql": "{% macro get_requested_reviewer_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"actor_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"created_at\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"pull_request_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"removed\", \"datatype\": \"boolean\"},\n {\"name\": \"requested_id\", \"datatype\": dbt_utils.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.986225}, "macro.github_source.get_issue_closed_history_columns": {"unique_id": "macro.github_source.get_issue_closed_history_columns", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "macros/get_issue_closed_history_columns.sql", "original_file_path": "macros/get_issue_closed_history_columns.sql", "name": "get_issue_closed_history_columns", "macro_sql": "{% macro get_issue_closed_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"actor_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"closed\", \"datatype\": \"boolean\"},\n {\"name\": \"commit_sha\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"issue_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"updated_at\", \"datatype\": dbt_utils.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_int", "macro.dbt_utils.type_string"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.9887831}, "macro.github_source.get_repo_team_columns": {"unique_id": "macro.github_source.get_repo_team_columns", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "macros/get_repo_team_columns.sql", "original_file_path": "macros/get_repo_team_columns.sql", "name": "get_repo_team_columns", "macro_sql": "{% macro get_repo_team_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"permission\", \"datatype\": dbt_utils.type_string()},\n {\"name\": \"repository_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"team_id\", \"datatype\": dbt_utils.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_string", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.9904718}, "macro.github_source.get_issue_label_columns": {"unique_id": "macro.github_source.get_issue_label_columns", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/Github/development/dbt_packages/github_source", "path": "macros/get_issue_label_columns.sql", "original_file_path": "macros/get_issue_label_columns.sql", "name": "get_issue_label_columns", "macro_sql": "{% macro get_issue_label_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt_utils.type_timestamp()},\n {\"name\": \"label_id\", \"datatype\": dbt_utils.type_int()},\n {\"name\": \"issue_id\", \"datatype\": dbt_utils.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.type_timestamp", "macro.dbt_utils.type_int"]}, "description": "", "meta": {}, "docs": {"show": true}, "patch_path": null, "arguments": [], "created_at": 1644611541.99196}}, "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 `--select` and `--exclude` model selection syntax to filter the\nmodels in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax).\n\nNote that you can also right-click on models to interactively filter and explore the graph.\n\n---\n\n### More information\n\n- [What is dbt](https://docs.getdbt.com/docs/introduction)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [dbt Community](https://www.getdbt.com/community/) for questions and discussion"}}, "exposures": {}, "metrics": {}, "selectors": {}, "disabled": {}, "parent_map": {"model.github.github__weekly_metrics": ["model.github.github__daily_metrics"], "model.github.github__monthly_metrics": ["model.github.github__daily_metrics"], "model.github.github__quarterly_metrics": ["model.github.github__daily_metrics"], "model.github.github__pull_requests": ["model.github.int_github__issue_joined"], "model.github.github__daily_metrics": ["model.github.github__issues", "model.github.github__pull_requests"], "model.github.github__issues": ["model.github.int_github__issue_joined"], "model.github.int_github__pull_request_times": ["model.github_source.stg_github__issue", "model.github_source.stg_github__issue_merged", "model.github_source.stg_github__pull_request", "model.github_source.stg_github__pull_request_review", "model.github_source.stg_github__requested_reviewer_history"], "model.github.int_github__pull_request_reviewers": ["model.github_source.stg_github__pull_request_review", "model.github_source.stg_github__user"], "model.github.int_github__issue_label_joined": ["model.github_source.stg_github__issue_label", "model.github_source.stg_github__label"], "model.github.int_github__issue_joined": ["model.github.int_github__issue_assignees", "model.github.int_github__issue_comments", "model.github.int_github__issue_labels", "model.github.int_github__issue_open_length", "model.github.int_github__pull_request_reviewers", "model.github.int_github__pull_request_times", "model.github.int_github__repository_teams", "model.github_source.stg_github__issue", "model.github_source.stg_github__pull_request", "model.github_source.stg_github__user"], "model.github.int_github__issue_labels": ["model.github.int_github__issue_label_joined"], "model.github.int_github__issue_assignees": ["model.github_source.stg_github__issue_assignee", "model.github_source.stg_github__user"], "model.github.int_github__issue_comments": ["model.github_source.stg_github__issue_comment"], "model.github.int_github__issue_open_length": ["model.github_source.stg_github__issue", "model.github_source.stg_github__issue_closed_history"], "model.github.int_github__repository_teams": ["model.github_source.stg_github__repo_team", "model.github_source.stg_github__repository", "model.github_source.stg_github__team"], "model.github_source.stg_github__issue_comment": ["model.github_source.stg_github__issue_comment_tmp", "model.github_source.stg_github__issue_comment_tmp"], "model.github_source.stg_github__requested_reviewer_history": ["model.github_source.stg_github__requested_reviewer_history_tmp", "model.github_source.stg_github__requested_reviewer_history_tmp"], "model.github_source.stg_github__issue_label": ["model.github_source.stg_github__issue_label_tmp", "model.github_source.stg_github__issue_label_tmp"], "model.github_source.stg_github__issue_merged": ["model.github_source.stg_github__issue_merged_tmp", "model.github_source.stg_github__issue_merged_tmp"], "model.github_source.stg_github__issue_closed_history": ["model.github_source.stg_github__issue_closed_history_tmp", "model.github_source.stg_github__issue_closed_history_tmp"], "model.github_source.stg_github__issue_assignee": ["model.github_source.stg_github__issue_assignee_tmp", "model.github_source.stg_github__issue_assignee_tmp"], "model.github_source.stg_github__repository": ["model.github_source.stg_github__repository_tmp", "model.github_source.stg_github__repository_tmp"], "model.github_source.stg_github__user": ["model.github_source.stg_github__user_tmp", "model.github_source.stg_github__user_tmp"], "model.github_source.stg_github__pull_request_review": ["model.github_source.stg_github__pull_request_review_tmp", "model.github_source.stg_github__pull_request_review_tmp"], "model.github_source.stg_github__repo_team": ["model.github_source.stg_github__repo_team_tmp", "model.github_source.stg_github__repo_team_tmp"], "model.github_source.stg_github__label": ["model.github_source.stg_github__label_tmp", "model.github_source.stg_github__label_tmp"], "model.github_source.stg_github__issue": ["model.github_source.stg_github__issue_tmp", "model.github_source.stg_github__issue_tmp"], "model.github_source.stg_github__team": ["model.github_source.stg_github__team_tmp", "model.github_source.stg_github__team_tmp"], "model.github_source.stg_github__pull_request": ["model.github_source.stg_github__pull_request_tmp", "model.github_source.stg_github__pull_request_tmp"], "model.github_source.stg_github__repository_tmp": ["source.github_source.github.repository"], "model.github_source.stg_github__label_tmp": ["source.github_source.github.label"], "model.github_source.stg_github__requested_reviewer_history_tmp": ["source.github_source.github.requested_reviewer_history"], "model.github_source.stg_github__issue_comment_tmp": ["source.github_source.github.issue_comment"], "model.github_source.stg_github__pull_request_review_tmp": ["source.github_source.github.pull_request_review"], "model.github_source.stg_github__issue_label_tmp": ["source.github_source.github.issue_label"], "model.github_source.stg_github__team_tmp": ["source.github_source.github.team"], "model.github_source.stg_github__pull_request_tmp": ["source.github_source.github.pull_request"], "model.github_source.stg_github__issue_merged_tmp": ["source.github_source.github.issue_merged"], "model.github_source.stg_github__user_tmp": ["source.github_source.github.user"], "model.github_source.stg_github__issue_closed_history_tmp": ["source.github_source.github.issue_closed_history"], "model.github_source.stg_github__issue_assignee_tmp": ["source.github_source.github.issue_assignee"], "model.github_source.stg_github__issue_tmp": ["source.github_source.github.issue"], "model.github_source.stg_github__repo_team_tmp": ["source.github_source.github.repo_team"], "test.github.unique_github__issues_issue_id.6723b9b1db": ["model.github.github__issues"], "test.github.not_null_github__issues_issue_id.fed0631e25": ["model.github.github__issues"], "test.github.unique_github__pull_requests_issue_id.ce23997907": ["model.github.github__pull_requests"], "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f": ["model.github.github__pull_requests"], "test.github.unique_github__daily_metrics_day.f98cab9456": ["model.github.github__daily_metrics"], "test.github.not_null_github__daily_metrics_day.647e494434": ["model.github.github__daily_metrics"], "test.github.unique_github__weekly_metrics_week.6794858a8e": ["model.github.github__weekly_metrics"], "test.github.not_null_github__weekly_metrics_week.4b0b928243": ["model.github.github__weekly_metrics"], "test.github.unique_github__monthly_metrics_month.3076284fbb": ["model.github.github__monthly_metrics"], "test.github.not_null_github__monthly_metrics_month.9e4fba84df": ["model.github.github__monthly_metrics"], "test.github.unique_github__quarterly_metrics_quarter.9165a921c1": ["model.github.github__quarterly_metrics"], "test.github.not_null_github__quarterly_metrics_quarter.92394d46dc": ["model.github.github__quarterly_metrics"], "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4": ["model.github_source.stg_github__issue_assignee"], "test.github_source.not_null_stg_github__label_label_id.9f07379974": ["model.github_source.stg_github__label"], "test.github_source.unique_stg_github__label_label_id.74d3c21466": ["model.github_source.stg_github__label"], "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d": ["model.github_source.stg_github__issue_closed_history"], "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a": ["model.github_source.stg_github__issue_comment"], "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f": ["model.github_source.stg_github__issue_comment"], "test.github_source.unique_stg_github__issue_issue_id.84891aeece": ["model.github_source.stg_github__issue"], "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7": ["model.github_source.stg_github__issue"], "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508": ["model.github_source.stg_github__pull_request_review"], "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790": ["model.github_source.stg_github__pull_request_review"], "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa": ["model.github_source.stg_github__pull_request"], "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71": ["model.github_source.stg_github__pull_request"], "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503": ["model.github_source.stg_github__repo_team"], "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c": ["model.github_source.stg_github__repo_team"], "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d": ["model.github_source.stg_github__repository"], "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f": ["model.github_source.stg_github__repository"], "test.github_source.unique_stg_github__team_team_id.94e9716ab4": ["model.github_source.stg_github__team"], "test.github_source.not_null_stg_github__team_team_id.440aefe7a7": ["model.github_source.stg_github__team"], "test.github_source.unique_stg_github__user_user_id.5c1a00cd90": ["model.github_source.stg_github__user"], "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b": ["model.github_source.stg_github__user"], "source.github_source.github.issue_assignee": [], "source.github_source.github.label": [], "source.github_source.github.issue_closed_history": [], "source.github_source.github.issue_label": [], "source.github_source.github.issue_comment": [], "source.github_source.github.issue_merged": [], "source.github_source.github.issue": [], "source.github_source.github.pull_request_review": [], "source.github_source.github.pull_request": [], "source.github_source.github.repo_team": [], "source.github_source.github.repository": [], "source.github_source.github.requested_reviewer_history": [], "source.github_source.github.team": [], "source.github_source.github.user": []}, "child_map": {"model.github.github__weekly_metrics": ["test.github.not_null_github__weekly_metrics_week.4b0b928243", "test.github.unique_github__weekly_metrics_week.6794858a8e"], "model.github.github__monthly_metrics": ["test.github.not_null_github__monthly_metrics_month.9e4fba84df", "test.github.unique_github__monthly_metrics_month.3076284fbb"], "model.github.github__quarterly_metrics": ["test.github.not_null_github__quarterly_metrics_quarter.92394d46dc", "test.github.unique_github__quarterly_metrics_quarter.9165a921c1"], "model.github.github__pull_requests": ["model.github.github__daily_metrics", "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f", "test.github.unique_github__pull_requests_issue_id.ce23997907"], "model.github.github__daily_metrics": ["model.github.github__monthly_metrics", "model.github.github__quarterly_metrics", "model.github.github__weekly_metrics", "test.github.not_null_github__daily_metrics_day.647e494434", "test.github.unique_github__daily_metrics_day.f98cab9456"], "model.github.github__issues": ["model.github.github__daily_metrics", "test.github.not_null_github__issues_issue_id.fed0631e25", "test.github.unique_github__issues_issue_id.6723b9b1db"], "model.github.int_github__pull_request_times": ["model.github.int_github__issue_joined"], "model.github.int_github__pull_request_reviewers": ["model.github.int_github__issue_joined"], "model.github.int_github__issue_label_joined": ["model.github.int_github__issue_labels"], "model.github.int_github__issue_joined": ["model.github.github__issues", "model.github.github__pull_requests"], "model.github.int_github__issue_labels": ["model.github.int_github__issue_joined"], "model.github.int_github__issue_assignees": ["model.github.int_github__issue_joined"], "model.github.int_github__issue_comments": ["model.github.int_github__issue_joined"], "model.github.int_github__issue_open_length": ["model.github.int_github__issue_joined"], "model.github.int_github__repository_teams": ["model.github.int_github__issue_joined"], "model.github_source.stg_github__issue_comment": ["model.github.int_github__issue_comments", "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f", "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a"], "model.github_source.stg_github__requested_reviewer_history": ["model.github.int_github__pull_request_times"], "model.github_source.stg_github__issue_label": ["model.github.int_github__issue_label_joined"], "model.github_source.stg_github__issue_merged": ["model.github.int_github__pull_request_times"], "model.github_source.stg_github__issue_closed_history": ["model.github.int_github__issue_open_length", "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d"], "model.github_source.stg_github__issue_assignee": ["model.github.int_github__issue_assignees", "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4"], "model.github_source.stg_github__repository": ["model.github.int_github__repository_teams", "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f", "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d"], "model.github_source.stg_github__user": ["model.github.int_github__issue_assignees", "model.github.int_github__issue_joined", "model.github.int_github__pull_request_reviewers", "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b", "test.github_source.unique_stg_github__user_user_id.5c1a00cd90"], "model.github_source.stg_github__pull_request_review": ["model.github.int_github__pull_request_reviewers", "model.github.int_github__pull_request_times", "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790", "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508"], "model.github_source.stg_github__repo_team": ["model.github.int_github__repository_teams", "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503", "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c"], "model.github_source.stg_github__label": ["model.github.int_github__issue_label_joined", "test.github_source.not_null_stg_github__label_label_id.9f07379974", "test.github_source.unique_stg_github__label_label_id.74d3c21466"], "model.github_source.stg_github__issue": ["model.github.int_github__issue_joined", "model.github.int_github__issue_open_length", "model.github.int_github__pull_request_times", "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7", "test.github_source.unique_stg_github__issue_issue_id.84891aeece"], "model.github_source.stg_github__team": ["model.github.int_github__repository_teams", "test.github_source.not_null_stg_github__team_team_id.440aefe7a7", "test.github_source.unique_stg_github__team_team_id.94e9716ab4"], "model.github_source.stg_github__pull_request": ["model.github.int_github__issue_joined", "model.github.int_github__pull_request_times", "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71", "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa"], "model.github_source.stg_github__repository_tmp": ["model.github_source.stg_github__repository", "model.github_source.stg_github__repository"], "model.github_source.stg_github__label_tmp": ["model.github_source.stg_github__label", "model.github_source.stg_github__label"], "model.github_source.stg_github__requested_reviewer_history_tmp": ["model.github_source.stg_github__requested_reviewer_history", "model.github_source.stg_github__requested_reviewer_history"], "model.github_source.stg_github__issue_comment_tmp": ["model.github_source.stg_github__issue_comment", "model.github_source.stg_github__issue_comment"], "model.github_source.stg_github__pull_request_review_tmp": ["model.github_source.stg_github__pull_request_review", "model.github_source.stg_github__pull_request_review"], "model.github_source.stg_github__issue_label_tmp": ["model.github_source.stg_github__issue_label", "model.github_source.stg_github__issue_label"], "model.github_source.stg_github__team_tmp": ["model.github_source.stg_github__team", "model.github_source.stg_github__team"], "model.github_source.stg_github__pull_request_tmp": ["model.github_source.stg_github__pull_request", "model.github_source.stg_github__pull_request"], "model.github_source.stg_github__issue_merged_tmp": ["model.github_source.stg_github__issue_merged", "model.github_source.stg_github__issue_merged"], "model.github_source.stg_github__user_tmp": ["model.github_source.stg_github__user", "model.github_source.stg_github__user"], "model.github_source.stg_github__issue_closed_history_tmp": ["model.github_source.stg_github__issue_closed_history", "model.github_source.stg_github__issue_closed_history"], "model.github_source.stg_github__issue_assignee_tmp": ["model.github_source.stg_github__issue_assignee", "model.github_source.stg_github__issue_assignee"], "model.github_source.stg_github__issue_tmp": ["model.github_source.stg_github__issue", "model.github_source.stg_github__issue"], "model.github_source.stg_github__repo_team_tmp": ["model.github_source.stg_github__repo_team", "model.github_source.stg_github__repo_team"], "test.github.unique_github__issues_issue_id.6723b9b1db": [], "test.github.not_null_github__issues_issue_id.fed0631e25": [], "test.github.unique_github__pull_requests_issue_id.ce23997907": [], "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f": [], "test.github.unique_github__daily_metrics_day.f98cab9456": [], "test.github.not_null_github__daily_metrics_day.647e494434": [], "test.github.unique_github__weekly_metrics_week.6794858a8e": [], "test.github.not_null_github__weekly_metrics_week.4b0b928243": [], "test.github.unique_github__monthly_metrics_month.3076284fbb": [], "test.github.not_null_github__monthly_metrics_month.9e4fba84df": [], "test.github.unique_github__quarterly_metrics_quarter.9165a921c1": [], "test.github.not_null_github__quarterly_metrics_quarter.92394d46dc": [], "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4": [], "test.github_source.not_null_stg_github__label_label_id.9f07379974": [], "test.github_source.unique_stg_github__label_label_id.74d3c21466": [], "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d": [], "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a": [], "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f": [], "test.github_source.unique_stg_github__issue_issue_id.84891aeece": [], "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7": [], "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508": [], "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790": [], "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa": [], "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71": [], "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503": [], "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c": [], "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d": [], "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f": [], "test.github_source.unique_stg_github__team_team_id.94e9716ab4": [], "test.github_source.not_null_stg_github__team_team_id.440aefe7a7": [], "test.github_source.unique_stg_github__user_user_id.5c1a00cd90": [], "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b": [], "source.github_source.github.issue_assignee": ["model.github_source.stg_github__issue_assignee_tmp"], "source.github_source.github.label": ["model.github_source.stg_github__label_tmp"], "source.github_source.github.issue_closed_history": ["model.github_source.stg_github__issue_closed_history_tmp"], "source.github_source.github.issue_label": ["model.github_source.stg_github__issue_label_tmp"], "source.github_source.github.issue_comment": ["model.github_source.stg_github__issue_comment_tmp"], "source.github_source.github.issue_merged": ["model.github_source.stg_github__issue_merged_tmp"], "source.github_source.github.issue": ["model.github_source.stg_github__issue_tmp"], "source.github_source.github.pull_request_review": ["model.github_source.stg_github__pull_request_review_tmp"], "source.github_source.github.pull_request": ["model.github_source.stg_github__pull_request_tmp"], "source.github_source.github.repo_team": ["model.github_source.stg_github__repo_team_tmp"], "source.github_source.github.repository": ["model.github_source.stg_github__repository_tmp"], "source.github_source.github.requested_reviewer_history": ["model.github_source.stg_github__requested_reviewer_history_tmp"], "source.github_source.github.team": ["model.github_source.stg_github__team_tmp"], "source.github_source.github.user": ["model.github_source.stg_github__user_tmp"]}} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v7.json", "dbt_version": "1.3.0", "generated_at": "2022-10-26T19:31:43.194980Z", "invocation_id": "56400515-88f7-4836-88ef-853ef5bcc0a5", "env": {}, "project_id": "b4ed7eda1f97e936d48d60e52edb4717", "user_id": "8268eefe-e8f7-472e-ab2a-a92f0135d76d", "send_anonymous_usage_stats": true, "adapter_type": "bigquery"}, "nodes": {"seed.github_integration_tests.github_pull_request_review_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "INT64", "submitted_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_pull_request_review_data"], "unique_id": "seed.github_integration_tests.github_pull_request_review_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_pull_request_review_data.csv", "original_file_path": "seeds/github_pull_request_review_data.csv", "name": "github_pull_request_review_data", "alias": "github_pull_request_review_data", "checksum": {"name": "sha256", "checksum": "4bdebf989d5e5d1bf41df343300be0a7e2a12f74b8148de6a97e75118edf0efa"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "submitted_at": "timestamp"}}, "created_at": 1666812439.189562, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_pull_request_review_data`"}, "seed.github_integration_tests.github_label_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "INT64"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_label_data"], "unique_id": "seed.github_integration_tests.github_label_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_label_data.csv", "original_file_path": "seeds/github_label_data.csv", "name": "github_label_data", "alias": "github_label_data", "checksum": {"name": "sha256", "checksum": "f47357ad7761ae8e671c889ce5e385f6916b78cb669dfc65f09bacea1ecafb1f"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "created_at": 1666812439.195436, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_label_data`"}, "seed.github_integration_tests.github_repository_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "created_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_repository_data"], "unique_id": "seed.github_integration_tests.github_repository_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_repository_data.csv", "original_file_path": "seeds/github_repository_data.csv", "name": "github_repository_data", "alias": "github_repository_data", "checksum": {"name": "sha256", "checksum": "78cd55c70468340db27d24a3fc299fc8c191129ca26ea80620a0d796a608a1a4"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"created_at": "timestamp"}}, "created_at": 1666812439.196762, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_repository_data`"}, "seed.github_integration_tests.github_issue_merged_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "merged_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_issue_merged_data"], "unique_id": "seed.github_integration_tests.github_issue_merged_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_issue_merged_data.csv", "original_file_path": "seeds/github_issue_merged_data.csv", "name": "github_issue_merged_data", "alias": "github_issue_merged_data", "checksum": {"name": "sha256", "checksum": "397efa928dca45bafbdc11219b3335265bd9a6cce1447c02e07c0bf53ddaba31"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"merged_at": "timestamp"}}, "created_at": 1666812439.197939, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_merged_data`"}, "seed.github_integration_tests.github_issue_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "closed_at": "timestamp", "created_at": "timestamp", "updated_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_issue_data"], "unique_id": "seed.github_integration_tests.github_issue_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_issue_data.csv", "original_file_path": "seeds/github_issue_data.csv", "name": "github_issue_data", "alias": "github_issue_data", "checksum": {"name": "sha256", "checksum": "6eabcc9bc0920d64775f8058446b279e803384a2205f18a07d7a2f1ebcf89286"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"closed_at": "timestamp", "created_at": "timestamp", "updated_at": "timestamp"}}, "created_at": 1666812439.199287, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_data`"}, "seed.github_integration_tests.github_repo_team_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_repo_team_data"], "unique_id": "seed.github_integration_tests.github_repo_team_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_repo_team_data.csv", "original_file_path": "seeds/github_repo_team_data.csv", "name": "github_repo_team_data", "alias": "github_repo_team_data", "checksum": {"name": "sha256", "checksum": "3a16bf772f5f15231f0d7e26c116041543fad5a9dbdabbdfec30ddd063058722"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1666812439.2006059, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_repo_team_data`"}, "seed.github_integration_tests.github_requested_reviewer_history_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "created_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_requested_reviewer_history_data"], "unique_id": "seed.github_integration_tests.github_requested_reviewer_history_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_requested_reviewer_history_data.csv", "original_file_path": "seeds/github_requested_reviewer_history_data.csv", "name": "github_requested_reviewer_history_data", "alias": "github_requested_reviewer_history_data", "checksum": {"name": "sha256", "checksum": "91225ac95874fc314f772530dfcb6ece74f35c292ea5bba53ff86b599b902743"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"created_at": "timestamp"}}, "created_at": 1666812439.201875, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_requested_reviewer_history_data`"}, "seed.github_integration_tests.github_issue_label_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "issue_id": "INT64", "label_id": "INT64"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_issue_label_data"], "unique_id": "seed.github_integration_tests.github_issue_label_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_issue_label_data.csv", "original_file_path": "seeds/github_issue_label_data.csv", "name": "github_issue_label_data", "alias": "github_issue_label_data", "checksum": {"name": "sha256", "checksum": "847ef3245b5610a81f3d8e91b4787d24829b2b0d3d064c529a61d430e90f0585"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"issue_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "label_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "created_at": 1666812439.203082, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_label_data`"}, "seed.github_integration_tests.github_issue_comment_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "INT64"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_issue_comment_data"], "unique_id": "seed.github_integration_tests.github_issue_comment_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_issue_comment_data.csv", "original_file_path": "seeds/github_issue_comment_data.csv", "name": "github_issue_comment_data", "alias": "github_issue_comment_data", "checksum": {"name": "sha256", "checksum": "6cc173c061308bc4de703c7c5d0fc30228b2c86117ed7db1daf9decf1a4238cd"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "created_at": 1666812439.204253, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_comment_data`"}, "seed.github_integration_tests.github_issue_assignee_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_issue_assignee_data"], "unique_id": "seed.github_integration_tests.github_issue_assignee_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_issue_assignee_data.csv", "original_file_path": "seeds/github_issue_assignee_data.csv", "name": "github_issue_assignee_data", "alias": "github_issue_assignee_data", "checksum": {"name": "sha256", "checksum": "fe25fadc4593349b873b50da5e2e2fbf436cbb3c1bcfe325c3340c64a7d8972b"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1666812439.205397, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_assignee_data`"}, "seed.github_integration_tests.github_issue_closed_history_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "updated_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_issue_closed_history_data"], "unique_id": "seed.github_integration_tests.github_issue_closed_history_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_issue_closed_history_data.csv", "original_file_path": "seeds/github_issue_closed_history_data.csv", "name": "github_issue_closed_history_data", "alias": "github_issue_closed_history_data", "checksum": {"name": "sha256", "checksum": "5f281ce9e29e69280633dc6aae2e9f8028c86815442821a608bb793c82aab3f1"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"updated_at": "timestamp"}}, "created_at": 1666812439.206629, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_closed_history_data`"}, "seed.github_integration_tests.github_pull_request_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_pull_request_data"], "unique_id": "seed.github_integration_tests.github_pull_request_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_pull_request_data.csv", "original_file_path": "seeds/github_pull_request_data.csv", "name": "github_pull_request_data", "alias": "github_pull_request_data", "checksum": {"name": "sha256", "checksum": "1e27d3e9b6881a3fda6402b048071032411d81612ff4b2009d852a194b137006"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1666812439.207768, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_pull_request_data`"}, "seed.github_integration_tests.github_team_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_team_data"], "unique_id": "seed.github_integration_tests.github_team_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_team_data.csv", "original_file_path": "seeds/github_team_data.csv", "name": "github_team_data", "alias": "github_team_data", "checksum": {"name": "sha256", "checksum": "a3916608387192c2bcec219067bd19e3280a23a3d4f546390e5d7e9aa16420bd"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1666812439.208873, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_team_data`"}, "seed.github_integration_tests.github_user_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_user_data"], "unique_id": "seed.github_integration_tests.github_user_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_user_data.csv", "original_file_path": "seeds/github_user_data.csv", "name": "github_user_data", "alias": "github_user_data", "checksum": {"name": "sha256", "checksum": "5d101839c6a685fac17231a071c6516f3ac668b133d7a96a83d97ede20f16e46"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1666812439.210102, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_user_data`"}, "model.github.github__weekly_metrics": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.date_trunc"], "nodes": ["model.github.github__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "github__weekly_metrics"], "unique_id": "model.github.github__weekly_metrics", "raw_code": "with daily_metrics as (\n select *\n from {{ ref('github__daily_metrics') }}\n)\n\nselect \n {{ dbt.date_trunc('week', 'day') }} as week, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__weekly_metrics.sql", "original_file_path": "models/github__weekly_metrics.sql", "name": "github__weekly_metrics", "alias": "github__weekly_metrics", "checksum": {"name": "sha256", "checksum": "0c23e13d9ae5aa9256b832965069a021826131bbcf8c23be244b660d1a513870"}, "tags": [], "refs": [["github__daily_metrics"]], "sources": [], "metrics": [], "description": "Summary numbers for issues and pull requests by week\n", "columns": {"week": {"name": "week", "description": "The reporting week", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_opened": {"name": "number_issues_opened", "description": "The total number of issues created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_closed": {"name": "number_issues_closed", "description": "The total number of issues closed during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_issue_open": {"name": "avg_days_issue_open", "description": "The average number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_issue_open": {"name": "longest_days_issue_open", "description": "The longest number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_opened": {"name": "number_prs_opened", "description": "The total number of pull requests created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_merged": {"name": "number_prs_merged", "description": "The total number of pull requests merged during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_closed_without_merge": {"name": "number_prs_closed_without_merge", "description": "The total number of pull requests closed without a merge during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_pr_open": {"name": "avg_days_pr_open", "description": "The average number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_pr_open": {"name": "longest_days_pr_open", "description": "The longest number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__weekly_metrics.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1666812439.5157928, "compiled_code": "with daily_metrics as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`github__daily_metrics`\n)\n\nselect \n timestamp_trunc(\n cast(day as timestamp),\n week\n ) as week, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github__weekly_metrics`"}, "model.github.github__monthly_metrics": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.date_trunc"], "nodes": ["model.github.github__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "github__monthly_metrics"], "unique_id": "model.github.github__monthly_metrics", "raw_code": "with daily_metrics as (\n select *\n from {{ ref('github__daily_metrics') }}\n)\n\nselect \n {{ dbt.date_trunc('month', 'day') }} as month, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__monthly_metrics.sql", "original_file_path": "models/github__monthly_metrics.sql", "name": "github__monthly_metrics", "alias": "github__monthly_metrics", "checksum": {"name": "sha256", "checksum": "13125ad4966c9d1caa3cd74e6174cc3845a7ceb7929836e849e70628af2b0d0d"}, "tags": [], "refs": [["github__daily_metrics"]], "sources": [], "metrics": [], "description": "Summary numbers for issues and pull requests by month\n", "columns": {"month": {"name": "month", "description": "The reporting month", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_opened": {"name": "number_issues_opened", "description": "The total number of issues created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_closed": {"name": "number_issues_closed", "description": "The total number of issues closed during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_issue_open": {"name": "avg_days_issue_open", "description": "The average number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_issue_open": {"name": "longest_days_issue_open", "description": "The longest number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_opened": {"name": "number_prs_opened", "description": "The total number of pull requests created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_merged": {"name": "number_prs_merged", "description": "The total number of pull requests merged during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_closed_without_merge": {"name": "number_prs_closed_without_merge", "description": "The total number of pull requests closed without a merge during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_pr_open": {"name": "avg_days_pr_open", "description": "The average number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_pr_open": {"name": "longest_days_pr_open", "description": "The longest number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__monthly_metrics.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1666812439.51751, "compiled_code": "with daily_metrics as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`github__daily_metrics`\n)\n\nselect \n timestamp_trunc(\n cast(day as timestamp),\n month\n ) as month, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github__monthly_metrics`"}, "model.github.github__quarterly_metrics": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.date_trunc"], "nodes": ["model.github.github__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "github__quarterly_metrics"], "unique_id": "model.github.github__quarterly_metrics", "raw_code": "with daily_metrics as (\n select *\n from {{ ref('github__daily_metrics') }}\n)\n\nselect \n {{ dbt.date_trunc('quarter', 'day') }} as quarter, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\n\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__quarterly_metrics.sql", "original_file_path": "models/github__quarterly_metrics.sql", "name": "github__quarterly_metrics", "alias": "github__quarterly_metrics", "checksum": {"name": "sha256", "checksum": "482a40e9b5ae8283bec98905910cc35747f7f98accd058453d69064844533c50"}, "tags": [], "refs": [["github__daily_metrics"]], "sources": [], "metrics": [], "description": "Summary numbers for issues and pull requests by quarter\n", "columns": {"quarter": {"name": "quarter", "description": "The reporting quarter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_opened": {"name": "number_issues_opened", "description": "The total number of issues created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_closed": {"name": "number_issues_closed", "description": "The total number of issues closed during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_issue_open": {"name": "avg_days_issue_open", "description": "The average number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_issue_open": {"name": "longest_days_issue_open", "description": "The longest number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_opened": {"name": "number_prs_opened", "description": "The total number of pull requests created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_merged": {"name": "number_prs_merged", "description": "The total number of pull requests merged during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_closed_without_merge": {"name": "number_prs_closed_without_merge", "description": "The total number of pull requests closed without a merge during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_pr_open": {"name": "avg_days_pr_open", "description": "The average number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_pr_open": {"name": "longest_days_pr_open", "description": "The longest number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__quarterly_metrics.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1666812439.519181, "compiled_code": "with daily_metrics as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`github__daily_metrics`\n)\n\nselect \n timestamp_trunc(\n cast(day as timestamp),\n quarter\n ) as quarter, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\n\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github__quarterly_metrics`"}, "model.github.github__pull_requests": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.github.int_github__issue_joined"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "github__pull_requests"], "unique_id": "model.github.github__pull_requests", "raw_code": "with issue_joined as (\n select *\n from {{ ref('int_github__issue_joined') }} \n)\n\nselect\n *\nfrom issue_joined\nwhere is_pull_request", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__pull_requests.sql", "original_file_path": "models/github__pull_requests.sql", "name": "github__pull_requests", "alias": "github__pull_requests", "checksum": {"name": "sha256", "checksum": "ab4761ae05c0aabc7585d92ed7c68e12b53317a47a4278810e1777a051f43350"}, "tags": [], "refs": [["int_github__issue_joined"]], "sources": [], "metrics": [], "description": "Basic information about pull_requests as well as additional fields about reviews and time between actions\n", "columns": {"issue_id": {"name": "issue_id", "description": "The unique ID of an issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "body": {"name": "body", "description": "the text body of the description of the pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed_at": {"name": "closed_at", "description": "Timestamp of when the pull request was closed. NULL for pull requests that are still open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the pull request was created", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_locked": {"name": "is_locked", "description": "Boolean indicating whether the issue is locked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "milestone_id": {"name": "milestone_id", "description": "Foreign key that references the milestone.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_pull_request": {"name": "is_pull_request", "description": "Boolean indiciating whether the issue is a pull request.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_number": {"name": "issue_number", "description": "The number of the pull request. Unique within a repository, but not accross.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_id": {"name": "repository_id", "description": "Foreign key that references the repository table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the issue was last updated", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "days_issue_open": {"name": "days_issue_open", "description": "The number of days an issue has been open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_times_reopened": {"name": "number_of_times_reopened", "description": "Total number of times the issue was reopened", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_comments": {"name": "number_of_comments", "description": "The total number of comments included in the issue", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_login_name": {"name": "creator_login_name", "description": "User that created the issue login name", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_name": {"name": "creator_name", "description": "User that created the issue name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_company": {"name": "creator_company", "description": "User that created the issue company name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the pull request is open or closed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url_link": {"name": "url_link", "description": "A link to the pull request on github.com", "meta": {}, "data_type": null, "quote": null, "tags": []}, "labels": {"name": "labels", "description": "The labels currently applied to the pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository": {"name": "repository", "description": "The repository that the pull request applies to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_team_names": {"name": "repository_team_names", "description": "An aggreate of the teams associated with the repository", "meta": {}, "data_type": null, "quote": null, "tags": []}, "assignees": {"name": "assignees", "description": "Users who have been assigned to the pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hours_request_review_to_first_review": {"name": "hours_request_review_to_first_review", "description": "Number of hours between the first request for review and a review", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hours_request_review_to_first_action": {"name": "hours_request_review_to_first_action", "description": "Number of hours between the first request for review and any action besides dismissing the request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hours_request_review_to_merge": {"name": "hours_request_review_to_merge", "description": "Number of hours between the first request for review and the pull request being merged", "meta": {}, "data_type": null, "quote": null, "tags": []}, "merged_at": {"name": "merged_at", "description": "Timestamp of when the pull request was merged", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reviewers": {"name": "reviewers", "description": "List of Users who reviewed the pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_reviews": {"name": "number_of_reviews", "description": "Number of times a pull request was reviewed", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__pull_requests.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1666812439.5124412, "compiled_code": "with __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n), __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n), __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n), __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n), __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n), __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n), __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n), __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n), __dbt__cte__int_github__issue_joined as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_labels as (\n select *\n from __dbt__cte__int_github__issue_labels\n), \n\nrepository_teams as (\n select \n \n *\n from __dbt__cte__int_github__repository_teams\n\n \n), \n\nissue_assignees as (\n select *\n from __dbt__cte__int_github__issue_assignees\n), \n\nissue_open_length as (\n select *\n from __dbt__cte__int_github__issue_open_length\n), \n\nissue_comments as (\n select *\n from __dbt__cte__int_github__issue_comments\n), \n\ncreator as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n), \n\npull_request_times as (\n select *\n from __dbt__cte__int_github__pull_request_times\n), \n\npull_request_reviewers as (\n select *\n from __dbt__cte__int_github__pull_request_reviewers\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then 'https://github.com/' || repository_teams.repository || '/pull/' || issue.issue_number\n else 'https://github.com/' || repository_teams.repository || '/issues/' || issue.issue_number\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n \n repository_teams.repository_team_names,\n \n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id\n),issue_joined as (\n select *\n from __dbt__cte__int_github__issue_joined \n)\n\nselect\n *\nfrom issue_joined\nwhere is_pull_request", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.github.int_github__issue_label_joined", "sql": " __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n)"}, {"id": "model.github.int_github__issue_labels", "sql": " __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n)"}, {"id": "model.github.int_github__repository_teams", "sql": " __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n)"}, {"id": "model.github.int_github__issue_assignees", "sql": " __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n)"}, {"id": "model.github.int_github__issue_open_length", "sql": " __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n)"}, {"id": "model.github.int_github__issue_comments", "sql": " __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n)"}, {"id": "model.github.int_github__pull_request_times", "sql": " __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n)"}, {"id": "model.github.int_github__pull_request_reviewers", "sql": " __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n)"}, {"id": "model.github.int_github__issue_joined", "sql": " __dbt__cte__int_github__issue_joined as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_labels as (\n select *\n from __dbt__cte__int_github__issue_labels\n), \n\nrepository_teams as (\n select \n \n *\n from __dbt__cte__int_github__repository_teams\n\n \n), \n\nissue_assignees as (\n select *\n from __dbt__cte__int_github__issue_assignees\n), \n\nissue_open_length as (\n select *\n from __dbt__cte__int_github__issue_open_length\n), \n\nissue_comments as (\n select *\n from __dbt__cte__int_github__issue_comments\n), \n\ncreator as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n), \n\npull_request_times as (\n select *\n from __dbt__cte__int_github__pull_request_times\n), \n\npull_request_reviewers as (\n select *\n from __dbt__cte__int_github__pull_request_reviewers\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then 'https://github.com/' || repository_teams.repository || '/pull/' || issue.issue_number\n else 'https://github.com/' || repository_teams.repository || '/issues/' || issue.issue_number\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n \n repository_teams.repository_team_names,\n \n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id\n)"}], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github__pull_requests`"}, "model.github.github__daily_metrics": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.date_trunc"], "nodes": ["model.github.github__issues", "model.github.github__pull_requests"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "github__daily_metrics"], "unique_id": "model.github.github__daily_metrics", "raw_code": "with github_issues as (\n select *\n from {{ ref('github__issues') }}\n), \n\npull_requests as (\n select *\n from {{ ref('github__pull_requests') }}\n), \n\nissues_opened_per_day as (\n select \n {{ dbt.date_trunc('day', 'created_at') }} as day, \n count(*) as number_issues_opened,\n sum(days_issue_open) as sum_days_issue_open,\n max(days_issue_open) as longest_days_issue_open\n from github_issues\n group by 1\n), \n\nissues_closed_per_day as (\n select \n {{ dbt.date_trunc('day', 'closed_at') }} as day, \n count(*) as number_issues_closed\n from github_issues\n where closed_at is not null\n group by 1\n), \n\nprs_opened_per_day as (\n select \n {{ dbt.date_trunc('day', 'created_at') }} as day, \n count(*) as number_prs_opened,\n sum(days_issue_open) as sum_days_pr_open,\n max(days_issue_open) as longest_days_pr_open\n from pull_requests\n group by 1\n), \n\nprs_merged_per_day as (\n select \n {{ dbt.date_trunc('day', 'merged_at') }} as day, \n count(*) as number_prs_merged\n from pull_requests\n where merged_at is not null\n group by 1\n), \n\nprs_closed_without_merge_per_day as (\n select \n {{ dbt.date_trunc('day', 'closed_at') }} as day, \n count(*) as number_prs_closed_without_merge\n from pull_requests\n where closed_at is not null\n and merged_at is null\n group by 1\n), \n\nissues_per_day as (\n select \n coalesce(issues_opened_per_day.day, \n issues_closed_per_day.day\n ) as day,\n number_issues_opened,\n number_issues_closed, \n sum_days_issue_open,\n longest_days_issue_open\n from issues_opened_per_day\n full outer join issues_closed_per_day on issues_opened_per_day.day = issues_closed_per_day.day\n), \n\nprs_per_day as (\n select \n coalesce(prs_opened_per_day.day, \n prs_merged_per_day.day,\n prs_closed_without_merge_per_day.day\n ) as day,\n number_prs_opened,\n number_prs_merged,\n number_prs_closed_without_merge,\n sum_days_pr_open,\n longest_days_pr_open\n from prs_opened_per_day\n full outer join prs_merged_per_day on prs_opened_per_day.day = prs_merged_per_day.day\n full outer join prs_closed_without_merge_per_day on coalesce(prs_opened_per_day.day, prs_merged_per_day.day) = prs_closed_without_merge_per_day.day\n)\n\nselect \n coalesce(issues_per_day.day, prs_per_day.day) as day,\n coalesce(number_issues_opened, 0) as number_issues_opened,\n coalesce(number_issues_closed, 0) as number_issues_closed,\n sum_days_issue_open,\n longest_days_issue_open,\n coalesce(number_prs_opened, 0) as number_prs_opened,\n coalesce(number_prs_merged, 0) as number_prs_merged,\n coalesce(number_prs_closed_without_merge, 0) as number_prs_closed_without_merge,\n sum_days_pr_open,\n longest_days_pr_open\nfrom issues_per_day \nfull outer join prs_per_day on issues_per_day.day = prs_per_day.day\norder by day desc", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__daily_metrics.sql", "original_file_path": "models/github__daily_metrics.sql", "name": "github__daily_metrics", "alias": "github__daily_metrics", "checksum": {"name": "sha256", "checksum": "a6ee3eb9c8198f8b11e48b8e0206e90860a02af8a20f748985a58499dde4f476"}, "tags": [], "refs": [["github__issues"], ["github__pull_requests"]], "sources": [], "metrics": [], "description": "Summary numbers for issues and pull requests by day\n", "columns": {"day": {"name": "day", "description": "The reporting day", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_opened": {"name": "number_issues_opened", "description": "The total number of issues created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_closed": {"name": "number_issues_closed", "description": "The total number of issues closed during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sum_days_issue_open": {"name": "sum_days_issue_open", "description": "The total number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_issue_open": {"name": "longest_days_issue_open", "description": "The longest number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_opened": {"name": "number_prs_opened", "description": "The total number of pull requests created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_merged": {"name": "number_prs_merged", "description": "The total number of pull requests merged during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_closed_without_merge": {"name": "number_prs_closed_without_merge", "description": "The total number of pull requests closed without a merge during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sum_days_pr_open": {"name": "sum_days_pr_open", "description": "The total number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_pr_open": {"name": "longest_days_pr_open", "description": "The longest number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__daily_metrics.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1666812439.5141602, "compiled_code": "with github_issues as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`github__issues`\n), \n\npull_requests as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`github__pull_requests`\n), \n\nissues_opened_per_day as (\n select \n timestamp_trunc(\n cast(created_at as timestamp),\n day\n ) as day, \n count(*) as number_issues_opened,\n sum(days_issue_open) as sum_days_issue_open,\n max(days_issue_open) as longest_days_issue_open\n from github_issues\n group by 1\n), \n\nissues_closed_per_day as (\n select \n timestamp_trunc(\n cast(closed_at as timestamp),\n day\n ) as day, \n count(*) as number_issues_closed\n from github_issues\n where closed_at is not null\n group by 1\n), \n\nprs_opened_per_day as (\n select \n timestamp_trunc(\n cast(created_at as timestamp),\n day\n ) as day, \n count(*) as number_prs_opened,\n sum(days_issue_open) as sum_days_pr_open,\n max(days_issue_open) as longest_days_pr_open\n from pull_requests\n group by 1\n), \n\nprs_merged_per_day as (\n select \n timestamp_trunc(\n cast(merged_at as timestamp),\n day\n ) as day, \n count(*) as number_prs_merged\n from pull_requests\n where merged_at is not null\n group by 1\n), \n\nprs_closed_without_merge_per_day as (\n select \n timestamp_trunc(\n cast(closed_at as timestamp),\n day\n ) as day, \n count(*) as number_prs_closed_without_merge\n from pull_requests\n where closed_at is not null\n and merged_at is null\n group by 1\n), \n\nissues_per_day as (\n select \n coalesce(issues_opened_per_day.day, \n issues_closed_per_day.day\n ) as day,\n number_issues_opened,\n number_issues_closed, \n sum_days_issue_open,\n longest_days_issue_open\n from issues_opened_per_day\n full outer join issues_closed_per_day on issues_opened_per_day.day = issues_closed_per_day.day\n), \n\nprs_per_day as (\n select \n coalesce(prs_opened_per_day.day, \n prs_merged_per_day.day,\n prs_closed_without_merge_per_day.day\n ) as day,\n number_prs_opened,\n number_prs_merged,\n number_prs_closed_without_merge,\n sum_days_pr_open,\n longest_days_pr_open\n from prs_opened_per_day\n full outer join prs_merged_per_day on prs_opened_per_day.day = prs_merged_per_day.day\n full outer join prs_closed_without_merge_per_day on coalesce(prs_opened_per_day.day, prs_merged_per_day.day) = prs_closed_without_merge_per_day.day\n)\n\nselect \n coalesce(issues_per_day.day, prs_per_day.day) as day,\n coalesce(number_issues_opened, 0) as number_issues_opened,\n coalesce(number_issues_closed, 0) as number_issues_closed,\n sum_days_issue_open,\n longest_days_issue_open,\n coalesce(number_prs_opened, 0) as number_prs_opened,\n coalesce(number_prs_merged, 0) as number_prs_merged,\n coalesce(number_prs_closed_without_merge, 0) as number_prs_closed_without_merge,\n sum_days_pr_open,\n longest_days_pr_open\nfrom issues_per_day \nfull outer join prs_per_day on issues_per_day.day = prs_per_day.day\norder by day desc", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github__daily_metrics`"}, "model.github.github__issues": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.github.int_github__issue_joined"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "github__issues"], "unique_id": "model.github.github__issues", "raw_code": "with issue_joined as (\n select *\n from {{ ref('int_github__issue_joined') }} \n)\n\nselect\n issue_id,\n body,\n closed_at,\n created_at,\n is_locked,\n milestone_id,\n issue_number,\n is_pull_request,\n repository_id,\n state,\n title,\n updated_at,\n user_id,\n url_link,\n days_issue_open,\n number_of_times_reopened,\n labels,\n number_of_comments,\n repository,\n {% if var('github__using_repo_team', true) %}\n repository_team_names,\n {% endif %}\n assignees,\n creator_login_name,\n creator_name,\n creator_company\nfrom issue_joined\nwhere not is_pull_request", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__issues.sql", "original_file_path": "models/github__issues.sql", "name": "github__issues", "alias": "github__issues", "checksum": {"name": "sha256", "checksum": "382d94f82ea63be958d53cc7353d6e3e792844f45ab9c48609e03355eb68a133"}, "tags": [], "refs": [["int_github__issue_joined"]], "sources": [], "metrics": [], "description": "Basic information about issues as well as additional fields for things like assignees, projects, labels and open time\n", "columns": {"issue_id": {"name": "issue_id", "description": "The unique ID of an issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "body": {"name": "body", "description": "The text body of the issue's main description", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed_at": {"name": "closed_at", "description": "The timestamp for when an issue was last closed. \"null\" for issues that are open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The timestamp for when an issue was created", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_locked": {"name": "is_locked", "description": "Boolean indicating if the issue is locked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "milestone_id": {"name": "milestone_id", "description": "Foreign key that references the milestone table representing the current milestone the issue is in", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_number": {"name": "issue_number", "description": "The number of the issue. Is unique within a repository, but not accross", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_pull_request": {"name": "is_pull_request", "description": "Boolean indicating whether the issue is a pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_id": {"name": "repository_id", "description": "Foreign key that references the repository table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the issue is open or closed", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the issue", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the issue was last updated", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url_link": {"name": "url_link", "description": "a link to the issue on github.com", "meta": {}, "data_type": null, "quote": null, "tags": []}, "days_issue_open": {"name": "days_issue_open", "description": "The number of days an issue has been open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_times_reopened": {"name": "number_of_times_reopened", "description": "Total number of times the issue was reopened", "meta": {}, "data_type": null, "quote": null, "tags": []}, "labels": {"name": "labels", "description": "A list of the labels that are currently applied to the issue", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_comments": {"name": "number_of_comments", "description": "The total number of comments included in the issue", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_login_name": {"name": "creator_login_name", "description": "User that created the issue login name", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_name": {"name": "creator_name", "description": "User that created the issue name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_company": {"name": "creator_company", "description": "User that created the issue company name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository": {"name": "repository", "description": "The repository that the issue is applicable to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_team_names": {"name": "repository_team_names", "description": "An aggreate of the teams associated with the repository", "meta": {}, "data_type": null, "quote": null, "tags": []}, "assignees": {"name": "assignees", "description": "The current list of users assigned to the issue", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__issues.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1666812439.5075572, "compiled_code": "with __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n), __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n), __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n), __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n), __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n), __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n), __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n), __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n), __dbt__cte__int_github__issue_joined as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_labels as (\n select *\n from __dbt__cte__int_github__issue_labels\n), \n\nrepository_teams as (\n select \n \n *\n from __dbt__cte__int_github__repository_teams\n\n \n), \n\nissue_assignees as (\n select *\n from __dbt__cte__int_github__issue_assignees\n), \n\nissue_open_length as (\n select *\n from __dbt__cte__int_github__issue_open_length\n), \n\nissue_comments as (\n select *\n from __dbt__cte__int_github__issue_comments\n), \n\ncreator as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n), \n\npull_request_times as (\n select *\n from __dbt__cte__int_github__pull_request_times\n), \n\npull_request_reviewers as (\n select *\n from __dbt__cte__int_github__pull_request_reviewers\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then 'https://github.com/' || repository_teams.repository || '/pull/' || issue.issue_number\n else 'https://github.com/' || repository_teams.repository || '/issues/' || issue.issue_number\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n \n repository_teams.repository_team_names,\n \n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id\n),issue_joined as (\n select *\n from __dbt__cte__int_github__issue_joined \n)\n\nselect\n issue_id,\n body,\n closed_at,\n created_at,\n is_locked,\n milestone_id,\n issue_number,\n is_pull_request,\n repository_id,\n state,\n title,\n updated_at,\n user_id,\n url_link,\n days_issue_open,\n number_of_times_reopened,\n labels,\n number_of_comments,\n repository,\n \n repository_team_names,\n \n assignees,\n creator_login_name,\n creator_name,\n creator_company\nfrom issue_joined\nwhere not is_pull_request", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.github.int_github__issue_label_joined", "sql": " __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n)"}, {"id": "model.github.int_github__issue_labels", "sql": " __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n)"}, {"id": "model.github.int_github__repository_teams", "sql": " __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n)"}, {"id": "model.github.int_github__issue_assignees", "sql": " __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n)"}, {"id": "model.github.int_github__issue_open_length", "sql": " __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n)"}, {"id": "model.github.int_github__issue_comments", "sql": " __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n)"}, {"id": "model.github.int_github__pull_request_times", "sql": " __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n)"}, {"id": "model.github.int_github__pull_request_reviewers", "sql": " __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n)"}, {"id": "model.github.int_github__issue_joined", "sql": " __dbt__cte__int_github__issue_joined as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_labels as (\n select *\n from __dbt__cte__int_github__issue_labels\n), \n\nrepository_teams as (\n select \n \n *\n from __dbt__cte__int_github__repository_teams\n\n \n), \n\nissue_assignees as (\n select *\n from __dbt__cte__int_github__issue_assignees\n), \n\nissue_open_length as (\n select *\n from __dbt__cte__int_github__issue_open_length\n), \n\nissue_comments as (\n select *\n from __dbt__cte__int_github__issue_comments\n), \n\ncreator as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n), \n\npull_request_times as (\n select *\n from __dbt__cte__int_github__pull_request_times\n), \n\npull_request_reviewers as (\n select *\n from __dbt__cte__int_github__pull_request_reviewers\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then 'https://github.com/' || repository_teams.repository || '/pull/' || issue.issue_number\n else 'https://github.com/' || repository_teams.repository || '/issues/' || issue.issue_number\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n \n repository_teams.repository_team_names,\n \n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id\n)"}], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github__issues`"}, "model.github.int_github__pull_request_times": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt.datediff"], "nodes": ["model.github_source.stg_github__pull_request_review", "model.github_source.stg_github__pull_request", "model.github_source.stg_github__requested_reviewer_history", "model.github_source.stg_github__issue", "model.github_source.stg_github__issue_merged"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__pull_request_times"], "unique_id": "model.github.int_github__pull_request_times", "raw_code": "with pull_request_review as (\n select *\n from {{ var('pull_request_review') }}\n), \n\npull_request as (\n select *\n from {{ var('pull_request')}}\n), \n\nrequested_reviewer_history as (\n select *\n from {{ var('requested_reviewer_history')}}\n where not removed\n), \n\nissue as (\n select *\n from {{ var('issue') }}\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from {{ var('issue_merged')}}\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n {{ dbt.datediff(\n 'time_of_first_request', \n \"coalesce(time_of_first_review_post_request, \" ~ dbt.current_timestamp_backcompat() ~ \")\", \n 'second') \n }}/ 60/60 as hours_request_review_to_first_review,\n {{ dbt.datediff(\n 'time_of_first_request', \n \"least(\n coalesce(time_of_first_requested_reviewer_review, \" ~ dbt.current_timestamp_backcompat() ~ \"),\n coalesce(issue.closed_at, \" ~ dbt.current_timestamp_backcompat() ~ \"))\", \n 'second') \n }} / 60/60 as hours_request_review_to_first_action,\n {{ dbt.datediff('time_of_first_request', 'merged_at', 'second') }}/ 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__pull_request_times.sql", "original_file_path": "models/intermediate/int_github__pull_request_times.sql", "name": "int_github__pull_request_times", "alias": "int_github__pull_request_times", "checksum": {"name": "sha256", "checksum": "35a197fef6ef12f2b408564be9d54b15ba8ff1eee0cf8514abedef9f7818422c"}, "tags": [], "refs": [["stg_github__pull_request_review"], ["stg_github__pull_request"], ["stg_github__requested_reviewer_history"], ["stg_github__issue"], ["stg_github__issue_merged"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__pull_request_times.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1666812439.250686, "compiled_code": "with pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__pull_request_reviewers": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.github_source.stg_github__pull_request_review", "model.github_source.stg_github__user"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__pull_request_reviewers"], "unique_id": "model.github.int_github__pull_request_reviewers", "raw_code": "with pull_request_review as (\n select *\n from {{ var('pull_request_review') }}\n), \n\ngithub_user as (\n select *\n from {{ var('user')}}\n)\n\nselect\n pull_request_review.pull_request_id,\n {{ fivetran_utils.string_agg( 'github_user.login_name', \"', '\" )}} as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__pull_request_reviewers.sql", "original_file_path": "models/intermediate/int_github__pull_request_reviewers.sql", "name": "int_github__pull_request_reviewers", "alias": "int_github__pull_request_reviewers", "checksum": {"name": "sha256", "checksum": "fd5518273ce75ae9066be686308ee078ce9a3df73f3799620f8eb6e611655cd7"}, "tags": [], "refs": [["stg_github__pull_request_review"], ["stg_github__user"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__pull_request_reviewers.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1666812439.261657, "compiled_code": "with pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__issue_label_joined": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.github_source.stg_github__issue_label", "model.github_source.stg_github__label"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_label_joined"], "unique_id": "model.github.int_github__issue_label_joined", "raw_code": "with issue_label as (\n\n select *\n from {{ var('issue_label') }}\n\n), label as (\n\n select *\n from {{ var('label') }}\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_label_joined.sql", "original_file_path": "models/intermediate/int_github__issue_label_joined.sql", "name": "int_github__issue_label_joined", "alias": "int_github__issue_label_joined", "checksum": {"name": "sha256", "checksum": "6f1b225ff9958e67fae4ea1ba0be10ebb9426da364c758c37d0b83305d575d98"}, "tags": [], "refs": [["stg_github__issue_label"], ["stg_github__label"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_label_joined.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1666812439.2669702, "compiled_code": "with issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__issue_joined": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.concat"], "nodes": ["model.github_source.stg_github__issue", "model.github.int_github__issue_labels", "model.github.int_github__repository_teams", "model.github.int_github__issue_assignees", "model.github.int_github__issue_open_length", "model.github.int_github__issue_comments", "model.github_source.stg_github__user", "model.github.int_github__pull_request_times", "model.github.int_github__pull_request_reviewers", "model.github_source.stg_github__pull_request"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_joined"], "unique_id": "model.github.int_github__issue_joined", "raw_code": "with issue as (\n select *\n from {{ var('issue') }}\n), \n\nissue_labels as (\n select *\n from {{ ref('int_github__issue_labels')}}\n), \n\nrepository_teams as (\n select \n {% if var('github__using_repo_team', true) %}\n *\n from {{ ref('int_github__repository_teams') }}\n\n {% else %}\n repository_id,\n full_name as repository\n from {{ var('repository') }}\n\n {% endif %}\n), \n\nissue_assignees as (\n select *\n from {{ ref('int_github__issue_assignees')}}\n), \n\nissue_open_length as (\n select *\n from {{ ref('int_github__issue_open_length')}}\n), \n\nissue_comments as (\n select *\n from {{ ref('int_github__issue_comments')}}\n), \n\ncreator as (\n select *\n from {{ var('user')}}\n), \n\npull_request_times as (\n select *\n from {{ ref('int_github__pull_request_times')}}\n), \n\npull_request_reviewers as (\n select *\n from {{ ref('int_github__pull_request_reviewers')}}\n), \n\npull_request as (\n select *\n from {{ var('pull_request')}}\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then {{ dbt.concat([\"'https://github.com/'\",'repository_teams.repository',\"'/pull/'\", 'issue.issue_number']) }}\n else {{ dbt.concat([\"'https://github.com/'\",'repository_teams.repository',\"'/issues/'\", 'issue.issue_number']) }}\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n {% if var('github__using_repo_team', true) %}\n repository_teams.repository_team_names,\n {% endif %}\n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_joined.sql", "original_file_path": "models/intermediate/int_github__issue_joined.sql", "name": "int_github__issue_joined", "alias": "int_github__issue_joined", "checksum": {"name": "sha256", "checksum": "75658855b696a3744360bbbf58433d6155e44d35128236e08da3df93b87ead16"}, "tags": [], "refs": [["stg_github__issue"], ["int_github__issue_labels"], ["int_github__repository_teams"], ["int_github__issue_assignees"], ["int_github__issue_open_length"], ["int_github__issue_comments"], ["stg_github__user"], ["int_github__pull_request_times"], ["int_github__pull_request_reviewers"], ["stg_github__pull_request"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_joined.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1666812439.2707431, "compiled_code": "with __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n), __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n), __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n), __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n), __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n), __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n), __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n), __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n),issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_labels as (\n select *\n from __dbt__cte__int_github__issue_labels\n), \n\nrepository_teams as (\n select \n \n *\n from __dbt__cte__int_github__repository_teams\n\n \n), \n\nissue_assignees as (\n select *\n from __dbt__cte__int_github__issue_assignees\n), \n\nissue_open_length as (\n select *\n from __dbt__cte__int_github__issue_open_length\n), \n\nissue_comments as (\n select *\n from __dbt__cte__int_github__issue_comments\n), \n\ncreator as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n), \n\npull_request_times as (\n select *\n from __dbt__cte__int_github__pull_request_times\n), \n\npull_request_reviewers as (\n select *\n from __dbt__cte__int_github__pull_request_reviewers\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then 'https://github.com/' || repository_teams.repository || '/pull/' || issue.issue_number\n else 'https://github.com/' || repository_teams.repository || '/issues/' || issue.issue_number\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n \n repository_teams.repository_team_names,\n \n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.github.int_github__issue_label_joined", "sql": " __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n)"}, {"id": "model.github.int_github__issue_labels", "sql": " __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n)"}, {"id": "model.github.int_github__repository_teams", "sql": " __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n)"}, {"id": "model.github.int_github__issue_assignees", "sql": " __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n)"}, {"id": "model.github.int_github__issue_open_length", "sql": " __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n)"}, {"id": "model.github.int_github__issue_comments", "sql": " __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n)"}, {"id": "model.github.int_github__pull_request_times", "sql": " __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n)"}, {"id": "model.github.int_github__pull_request_reviewers", "sql": " __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n)"}], "relation_name": null}, "model.github.int_github__issue_labels": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.github.int_github__issue_label_joined"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_labels"], "unique_id": "model.github.int_github__issue_labels", "raw_code": "with issue_label as (\n select *\n from {{ ref('int_github__issue_label_joined') }}\n)\n\nselect\n issue_id,\n {{ fivetran_utils.string_agg( 'label', \"', '\" )}} as labels\nfrom issue_label\ngroup by issue_id", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_labels.sql", "original_file_path": "models/intermediate/int_github__issue_labels.sql", "name": "int_github__issue_labels", "alias": "int_github__issue_labels", "checksum": {"name": "sha256", "checksum": "126b7de5034d8b9e5067e9d0a346ea3d93132574cc3ae85d4d711270404f4064"}, "tags": [], "refs": [["int_github__issue_label_joined"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_labels.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1666812439.278359, "compiled_code": "with __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n),issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.github.int_github__issue_label_joined", "sql": " __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n)"}], "relation_name": null}, "model.github.int_github__issue_assignees": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.github_source.stg_github__issue_assignee", "model.github_source.stg_github__user"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_assignees"], "unique_id": "model.github.int_github__issue_assignees", "raw_code": "with issue_assignee as (\n select *\n from {{ var('issue_assignee') }}\n), \n\ngithub_user as (\n select *\n from {{ var('user')}}\n)\n\nselect\n issue_assignee.issue_id,\n {{ fivetran_utils.string_agg( 'github_user.login_name', \"', '\" )}} as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_assignees.sql", "original_file_path": "models/intermediate/int_github__issue_assignees.sql", "name": "int_github__issue_assignees", "alias": "int_github__issue_assignees", "checksum": {"name": "sha256", "checksum": "837310bb78ff6f1460babc622037227dbc0c5776aae3ce3f5e9de48cb2ffac9c"}, "tags": [], "refs": [["stg_github__issue_assignee"], ["stg_github__user"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_assignees.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1666812439.281491, "compiled_code": "with issue_assignee as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__issue_comments": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.github_source.stg_github__issue_comment"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_comments"], "unique_id": "model.github.int_github__issue_comments", "raw_code": "with issue_comment as (\n select *\n from {{ var('issue_comment') }}\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_comments.sql", "original_file_path": "models/intermediate/int_github__issue_comments.sql", "name": "int_github__issue_comments", "alias": "int_github__issue_comments", "checksum": {"name": "sha256", "checksum": "b56ffccc19ec39a1d1bc4137557c8e1971167f97e673ea30d0f713bd34bc111a"}, "tags": [], "refs": [["stg_github__issue_comment"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_comments.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1666812439.285284, "compiled_code": "with issue_comment as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__issue_open_length": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt.datediff"], "nodes": ["model.github_source.stg_github__issue", "model.github_source.stg_github__issue_closed_history"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_open_length"], "unique_id": "model.github.int_github__issue_open_length", "raw_code": "with issue as (\n select *\n from {{ var('issue') }}\n), \n\nissue_closed_history as (\n select *\n from {{ var('issue_closed_history') }}\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), {{ dbt.current_timestamp_backcompat() }}) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum({{ dbt.datediff('valid_starting', 'valid_until', 'second') }}) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_open_length.sql", "original_file_path": "models/intermediate/int_github__issue_open_length.sql", "name": "int_github__issue_open_length", "alias": "int_github__issue_open_length", "checksum": {"name": "sha256", "checksum": "58de864860664b785e8000ef983dcb006d60af6cbba301e72e9e4c45aa1d8d5a"}, "tags": [], "refs": [["stg_github__issue"], ["stg_github__issue_closed_history"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_open_length.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1666812439.28928, "compiled_code": "with issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__repository_teams": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.github_source.stg_github__repository", "model.github_source.stg_github__repo_team", "model.github_source.stg_github__team"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__repository_teams"], "unique_id": "model.github.int_github__repository_teams", "raw_code": "{{ config(enabled=var('github__using_repo_team', True)) }}\n\nwith repository as (\n select *\n from {{ var('repository')}}\n),\n\nrepo_teams as (\n select *\n from {{ var('repo_team')}}\n),\n\nteams as (\n select *\n from {{ var('team')}}\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n {{ fivetran_utils.string_agg('team_name', \"', '\" ) }} as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__repository_teams.sql", "original_file_path": "models/intermediate/int_github__repository_teams.sql", "name": "int_github__repository_teams", "alias": "int_github__repository_teams", "checksum": {"name": "sha256", "checksum": "aa75375faa9f533b0c9c935f80ed6e9c7b90f20249089e7d64b7b47194f9044e"}, "tags": [], "refs": [["stg_github__repository"], ["stg_github__repo_team"], ["stg_github__team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__repository_teams.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "enabled": true}, "created_at": 1666812439.293377, "compiled_code": "\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github_source.stg_github__issue_comment": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_comment_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__issue_comment_tmp", "model.github_source.stg_github__issue_comment_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__issue_comment"], "unique_id": "model.github_source.stg_github__issue_comment", "raw_code": "with issue_comment as (\n\n select *\n from {{ ref('stg_github__issue_comment_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_comment_tmp')),\n staging_columns=get_issue_comment_columns()\n )\n }}\n\n from issue_comment\n\n), fields as (\n\n select \n id as issue_comment_id,\n issue_id,\n user_id\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue_comment.sql", "original_file_path": "models/stg_github__issue_comment.sql", "name": "stg_github__issue_comment", "alias": "stg_github__issue_comment", "checksum": {"name": "sha256", "checksum": "2f96156ac9d0de0afe220888eb6912117a7d04b1680b8fb1f5890dfbbcdb2994"}, "tags": [], "refs": [["stg_github__issue_comment_tmp"], ["stg_github__issue_comment_tmp"]], "sources": [], "metrics": [], "description": "Table that contains comments made on issues", "columns": {"issue_comment_id": {"name": "issue_comment_id", "description": "System generated unique id for the issue comment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue_comment.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1666812439.558922, "compiled_code": "with issue_comment as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n body\n \n as \n \n body\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 issue_id\n \n as \n \n issue_id\n \n, \n \n \n updated_at\n \n as \n \n updated_at\n \n, \n \n \n user_id\n \n as \n \n user_id\n \n\n\n\n\n from issue_comment\n\n), fields as (\n\n select \n id as issue_comment_id,\n issue_id,\n user_id\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment`"}, "model.github_source.stg_github__requested_reviewer_history": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_requested_reviewer_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.github_source.stg_github__requested_reviewer_history_tmp", "model.github_source.stg_github__requested_reviewer_history_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__requested_reviewer_history"], "unique_id": "model.github_source.stg_github__requested_reviewer_history", "raw_code": "with requested_reviewer_history as (\n\n select *\n from {{ ref('stg_github__requested_reviewer_history_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__requested_reviewer_history_tmp')),\n staging_columns=get_requested_reviewer_history_columns()\n )\n }}\n\n from requested_reviewer_history\n\n), fields as (\n\n select \n pull_request_id,\n cast(created_at as {{ dbt.type_timestamp() }}) as created_at,\n requested_id,\n removed\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__requested_reviewer_history.sql", "original_file_path": "models/stg_github__requested_reviewer_history.sql", "name": "stg_github__requested_reviewer_history", "alias": "stg_github__requested_reviewer_history", "checksum": {"name": "sha256", "checksum": "40abf6ac94bece080abe8e8a45ed43030166df171697acf3c59c5958ffe68eba"}, "tags": [], "refs": [["stg_github__requested_reviewer_history_tmp"], ["stg_github__requested_reviewer_history_tmp"]], "sources": [], "metrics": [], "description": "Table containing when a user requests another user to review a pull request", "columns": {"pull_request_id": {"name": "pull_request_id", "description": "Foreign key that references the pull request table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the review was submitted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "requested_id": {"name": "requested_id", "description": "Foreign key that references the user table, representing the user that was requested to review a PR.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "removed": {"name": "removed", "description": "Boolean variable indicating if the requester was removed from the PR (true) or added to the PR (false).", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__requested_reviewer_history.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1666812439.565063, "compiled_code": "with requested_reviewer_history as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__requested_reviewer_history_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n actor_id\n \n as \n \n actor_id\n \n, \n \n \n created_at\n \n as \n \n created_at\n \n, \n \n \n pull_request_id\n \n as \n \n pull_request_id\n \n, \n \n \n removed\n \n as \n \n removed\n \n, \n \n \n requested_id\n \n as \n \n requested_id\n \n\n\n\n\n from requested_reviewer_history\n\n), fields as (\n\n select \n pull_request_id,\n cast(created_at as TIMESTAMP) as created_at,\n requested_id,\n removed\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__requested_reviewer_history`"}, "model.github_source.stg_github__issue_label": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_label_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__issue_label_tmp", "model.github_source.stg_github__issue_label_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__issue_label"], "unique_id": "model.github_source.stg_github__issue_label", "raw_code": "with issue_label as (\n\n select *\n from {{ ref('stg_github__issue_label_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_label_tmp')),\n staging_columns=get_issue_label_columns()\n )\n }}\n\n from issue_label\n\n), fields as (\n\n select \n issue_id,\n label_id\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue_label.sql", "original_file_path": "models/stg_github__issue_label.sql", "name": "stg_github__issue_label", "alias": "stg_github__issue_label", "checksum": {"name": "sha256", "checksum": "bbc4b8e82ab26b7cb753ead2165a6d483171b6def78a34c8ab6b2c9d1dc1357c"}, "tags": [], "refs": [["stg_github__issue_label_tmp"], ["stg_github__issue_label_tmp"]], "sources": [], "metrics": [], "description": "The current labels attached to an issue", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "label_id": {"name": "label_id", "description": "Unique identifier of the used label", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue_label.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1666812439.558292, "compiled_code": "with issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n label_id\n \n as \n \n label_id\n \n, \n \n \n issue_id\n \n as \n \n issue_id\n \n\n\n\n\n from issue_label\n\n), fields as (\n\n select \n issue_id,\n label_id\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label`"}, "model.github_source.stg_github__issue_merged": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_merged_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.github_source.stg_github__issue_merged_tmp", "model.github_source.stg_github__issue_merged_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__issue_merged"], "unique_id": "model.github_source.stg_github__issue_merged", "raw_code": "with issue_merged as (\n\n select *\n from {{ ref('stg_github__issue_merged_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_merged_tmp')),\n staging_columns=get_issue_merged_columns()\n )\n }}\n\n from issue_merged\n\n), fields as (\n\n select \n issue_id,\n cast(merged_at as {{ dbt.type_timestamp() }}) as merged_at\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue_merged.sql", "original_file_path": "models/stg_github__issue_merged.sql", "name": "stg_github__issue_merged", "alias": "stg_github__issue_merged", "checksum": {"name": "sha256", "checksum": "d0ffc63496f8a12ccde9c115909db85d5f2fbd7c2ca8a7761cd96abcf31f532c"}, "tags": [], "refs": [["stg_github__issue_merged_tmp"], ["stg_github__issue_merged_tmp"]], "sources": [], "metrics": [], "description": "Table that tracks when an issue (always a pull request) is merged", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table. This table will only reference issues that are pull requests", "meta": {}, "data_type": null, "quote": null, "tags": []}, "merged_at": {"name": "merged_at", "description": "Timestamp of when the code merge took place", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue_merged.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1666812439.559469, "compiled_code": "with issue_merged as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_merged_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n actor_id\n \n as \n \n actor_id\n \n, \n \n \n commit_sha\n \n as \n \n commit_sha\n \n, \n \n \n issue_id\n \n as \n \n issue_id\n \n, \n \n \n merged_at\n \n as \n \n merged_at\n \n\n\n\n\n from issue_merged\n\n), fields as (\n\n select \n issue_id,\n cast(merged_at as TIMESTAMP) as merged_at\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_merged`"}, "model.github_source.stg_github__issue_closed_history": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_closed_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.github_source.stg_github__issue_closed_history_tmp", "model.github_source.stg_github__issue_closed_history_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__issue_closed_history"], "unique_id": "model.github_source.stg_github__issue_closed_history", "raw_code": "with issue_closed_history as (\n\n select *\n from {{ ref('stg_github__issue_closed_history_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_closed_history_tmp')),\n staging_columns=get_issue_closed_history_columns()\n )\n }}\n\n from issue_closed_history\n\n), fields as (\n\n select \n issue_id,\n cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at,\n closed as is_closed\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue_closed_history.sql", "original_file_path": "models/stg_github__issue_closed_history.sql", "name": "stg_github__issue_closed_history", "alias": "stg_github__issue_closed_history", "checksum": {"name": "sha256", "checksum": "8820baed7a5b47177c8e57576741ab5d3763026682f66c52429092e655e07408"}, "tags": [], "refs": [["stg_github__issue_closed_history_tmp"], ["stg_github__issue_closed_history_tmp"]], "sources": [], "metrics": [], "description": "Table to track when an issue is closed or re-opened", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the action took place", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_closed": {"name": "is_closed", "description": "Boolean variable for if the issue was closed (true) or re-opened (false)", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue_closed_history.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1666812439.557817, "compiled_code": "with issue_closed_history as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n actor_id\n \n as \n \n actor_id\n \n, \n \n \n closed\n \n as \n \n closed\n \n, \n \n \n commit_sha\n \n as \n \n commit_sha\n \n, \n \n \n issue_id\n \n as \n \n issue_id\n \n, \n \n \n updated_at\n \n as \n \n updated_at\n \n\n\n\n\n from issue_closed_history\n\n), fields as (\n\n select \n issue_id,\n cast(updated_at as TIMESTAMP) as updated_at,\n closed as is_closed\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history`"}, "model.github_source.stg_github__issue_assignee": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_assignee_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__issue_assignee_tmp", "model.github_source.stg_github__issue_assignee_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__issue_assignee"], "unique_id": "model.github_source.stg_github__issue_assignee", "raw_code": "with issue_assignee as (\n\n select *\n from {{ ref('stg_github__issue_assignee_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_assignee_tmp')),\n staging_columns=get_issue_assignee_columns()\n )\n }}\n\n from issue_assignee\n\n), fields as (\n\n select \n issue_id,\n user_id\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue_assignee.sql", "original_file_path": "models/stg_github__issue_assignee.sql", "name": "stg_github__issue_assignee", "alias": "stg_github__issue_assignee", "checksum": {"name": "sha256", "checksum": "1ee1ae6a0a648f4fddde4964f184b889bfd09ca43f0560fb10faaa8544b2f90d"}, "tags": [], "refs": [["stg_github__issue_assignee_tmp"], ["stg_github__issue_assignee_tmp"]], "sources": [], "metrics": [], "description": "Table with the current user(s) assigned to an issue", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue_assignee.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1666812439.5558798, "compiled_code": "with issue_assignee as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n issue_id\n \n as \n \n issue_id\n \n, \n \n \n user_id\n \n as \n \n user_id\n \n\n\n\n\n from issue_assignee\n\n), fields as (\n\n select \n issue_id,\n user_id\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee`"}, "model.github_source.stg_github__repository": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_repository_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__repository_tmp", "model.github_source.stg_github__repository_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__repository"], "unique_id": "model.github_source.stg_github__repository", "raw_code": "with repository as (\n\n select *\n from {{ ref('stg_github__repository_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__repository_tmp')),\n staging_columns=get_repository_columns()\n )\n }}\n\n from repository\n\n), fields as (\n\n select \n id as repository_id,\n full_name,\n private as is_private\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__repository.sql", "original_file_path": "models/stg_github__repository.sql", "name": "stg_github__repository", "alias": "stg_github__repository", "checksum": {"name": "sha256", "checksum": "52faadfa1a36e8b144c01bdba106b9b22c58154bbd60b69c069c409f1b2f4712"}, "tags": [], "refs": [["stg_github__repository_tmp"], ["stg_github__repository_tmp"]], "sources": [], "metrics": [], "description": "Table representing the file structure of a directory under git control", "columns": {"repository_id": {"name": "repository_id", "description": "System generated unique id for the repository.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "full_name": {"name": "full_name", "description": "The name of the git repository.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_private": {"name": "is_private", "description": "Boolean field indicating whether the repository is private (true) or public (false).", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__repository.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1666812439.564342, "compiled_code": "with repository as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repository_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\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 created_at\n \n as \n \n created_at\n \n, \n \n \n default_branch\n \n as \n \n default_branch\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n fork\n \n as \n \n fork\n \n, \n \n \n full_name\n \n as \n \n full_name\n \n, \n \n \n homepage\n \n as \n \n homepage\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n language\n \n as \n \n language\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n owner_id\n \n as \n \n owner_id\n \n, \n \n \n private\n \n as \n \n private\n \n\n\n\n\n from repository\n\n), fields as (\n\n select \n id as repository_id,\n full_name,\n private as is_private\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__repository`"}, "model.github_source.stg_github__user": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_user_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__user_tmp", "model.github_source.stg_github__user_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__user"], "unique_id": "model.github_source.stg_github__user", "raw_code": "with github_user as (\n\n select *\n from {{ ref('stg_github__user_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__user_tmp')),\n staging_columns=get_user_columns()\n )\n }}\n \n \n from github_user\n\n), fields as (\n\n select\n id as user_id,\n login as login_name,\n name,\n company\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__user.sql", "original_file_path": "models/stg_github__user.sql", "name": "stg_github__user", "alias": "stg_github__user", "checksum": {"name": "sha256", "checksum": "3fade99df6af62e01efd3bdabe4245077eeb17d7c05a33eae885ab9cebfb33a6"}, "tags": [], "refs": [["stg_github__user_tmp"], ["stg_github__user_tmp"]], "sources": [], "metrics": [], "description": "Table representing contributors to a git project", "columns": {"user_id": {"name": "user_id", "description": "System generated unique id for the user.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "login_name": {"name": "login_name", "description": "The alias the user uses to login to github.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the user", "meta": {}, "data_type": null, "quote": null, "tags": []}, "company": {"name": "company", "description": "The company of the user.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__user.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1666812439.567612, "compiled_code": "with github_user as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n company\n \n as \n \n company\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n login\n \n as \n \n login\n \n, \n \n \n name\n \n as \n \n name\n \n\n\n\n \n \n from github_user\n\n), fields as (\n\n select\n id as user_id,\n login as login_name,\n name,\n company\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__user`"}, "model.github_source.stg_github__pull_request_review": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_pull_request_review_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.github_source.stg_github__pull_request_review_tmp", "model.github_source.stg_github__pull_request_review_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__pull_request_review"], "unique_id": "model.github_source.stg_github__pull_request_review", "raw_code": "with pull_request_review as (\n\n select *\n from {{ ref('stg_github__pull_request_review_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__pull_request_review_tmp')),\n staging_columns=get_pull_request_review_columns()\n )\n }}\n\n from pull_request_review\n\n), fields as (\n\n select \n id as pull_request_review_id,\n pull_request_id,\n cast(submitted_at as {{ dbt.type_timestamp() }}) as submitted_at,\n state,\n user_id\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__pull_request_review.sql", "original_file_path": "models/stg_github__pull_request_review.sql", "name": "stg_github__pull_request_review", "alias": "stg_github__pull_request_review", "checksum": {"name": "sha256", "checksum": "3c5b56fcda26503106a11215aa4895199d140d378e4f81dc73fee0a95a39ef6b"}, "tags": [], "refs": [["stg_github__pull_request_review_tmp"], ["stg_github__pull_request_review_tmp"]], "sources": [], "metrics": [], "description": "Table containing reviews made to pull requests", "columns": {"pull_request_review_id": {"name": "pull_request_review_id", "description": "System generated unique id for the pull request review.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pull_request_id": {"name": "pull_request_id", "description": "Foreign key that references the pull request table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "submitted_at": {"name": "submitted_at", "description": "Timestamp of when the request for review was submitted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the review was an approval, request for change, comment, dismissal.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table, representing the user that reviewed the pull request.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__pull_request_review.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1666812439.562358, "compiled_code": "with pull_request_review as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n body\n \n as \n \n body\n \n, \n \n \n commit_sha\n \n as \n \n commit_sha\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n pull_request_id\n \n as \n \n pull_request_id\n \n, \n \n \n state\n \n as \n \n state\n \n, \n \n \n submitted_at\n \n as \n \n submitted_at\n \n, \n \n \n user_id\n \n as \n \n user_id\n \n\n\n\n\n from pull_request_review\n\n), fields as (\n\n select \n id as pull_request_review_id,\n pull_request_id,\n cast(submitted_at as TIMESTAMP) as submitted_at,\n state,\n user_id\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`"}, "model.github_source.stg_github__repo_team": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_repo_team_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__repo_team_tmp", "model.github_source.stg_github__repo_team_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__repo_team"], "unique_id": "model.github_source.stg_github__repo_team", "raw_code": "{{ config(enabled=var('github__using_repo_team', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_github__repo_team_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__repo_team_tmp')),\n staging_columns=get_repo_team_columns()\n )\n }}\n \n from base\n \n), final as (\n \n select \n repository_id,\n team_id\n from fields\n)\n\nselect * from final", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__repo_team.sql", "original_file_path": "models/stg_github__repo_team.sql", "name": "stg_github__repo_team", "alias": "stg_github__repo_team", "checksum": {"name": "sha256", "checksum": "bbf2296c63f5601191f285d1b9509717c9af73282ef8faae25df101d5c2058ec"}, "tags": [], "refs": [["stg_github__repo_team_tmp"], ["stg_github__repo_team_tmp"]], "sources": [], "metrics": [], "description": "Table representing the mapping relationships between repositories and teams", "columns": {"repository_id": {"name": "repository_id", "description": "Reference to the respective repository for the record.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "team_id": {"name": "team_id", "description": "Reference to the respective team for the record.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__repo_team.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "enabled": true}, "created_at": 1666812439.563639, "compiled_code": "\n\nwith base as (\n\n select * \n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team_tmp`\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n permission\n \n as \n \n permission\n \n, \n \n \n repository_id\n \n as \n \n repository_id\n \n, \n \n \n team_id\n \n as \n \n team_id\n \n\n\n\n \n from base\n \n), final as (\n \n select \n repository_id,\n team_id\n from fields\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team`"}, "model.github_source.stg_github__label": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_label_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__label_tmp", "model.github_source.stg_github__label_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__label"], "unique_id": "model.github_source.stg_github__label", "raw_code": "with issue_label as (\n\n select *\n from {{ ref('stg_github__label_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__label_tmp')),\n staging_columns=get_label_columns()\n )\n }}\n\n from issue_label\n\n), fields as (\n\n select \n id as label_id,\n _fivetran_synced,\t\n color,\n description,\n is_default,\n name as label,\n url\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__label.sql", "original_file_path": "models/stg_github__label.sql", "name": "stg_github__label", "alias": "stg_github__label", "checksum": {"name": "sha256", "checksum": "65919f8309be5eb259a6143e007f38f4ac91c1692d10990206708faa17f086e1"}, "tags": [], "refs": [["stg_github__label_tmp"], ["stg_github__label_tmp"]], "sources": [], "metrics": [], "description": "Table that contains labels that are used across your Github account within individual repositories.", "columns": {"label_id": {"name": "label_id", "description": "Unique identifier of the Github label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of the record being synced by Fivetran", "meta": {}, "data_type": null, "quote": null, "tags": []}, "color": {"name": "color", "description": "The color of the label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "The description of the label indicating the purpose", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_default": {"name": "is_default", "description": "Boolean flagging if the label is default on creation", "meta": {}, "data_type": null, "quote": null, "tags": []}, "label": {"name": "label", "description": "Name of the label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url": {"name": "url", "description": "Url where the label was used", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__label.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1666812439.557178, "compiled_code": "with issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\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 description\n \n as \n \n description\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n is_default\n \n as \n \n is_default\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n url\n \n as \n \n url\n \n\n\n\n\n from issue_label\n\n), fields as (\n\n select \n id as label_id,\n _fivetran_synced,\t\n color,\n description,\n is_default,\n name as label,\n url\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__label`"}, "model.github_source.stg_github__issue": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.github_source.stg_github__issue_tmp", "model.github_source.stg_github__issue_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__issue"], "unique_id": "model.github_source.stg_github__issue", "raw_code": "with issue as (\n\n select *\n from {{ ref('stg_github__issue_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_tmp')),\n staging_columns=get_issue_columns()\n )\n }}\n\n from issue \n\n), fields as (\n\n select \n id as issue_id,\n body,\n cast(closed_at as {{ dbt.type_timestamp() }}) as closed_at,\n cast(created_at as {{ dbt.type_timestamp() }}) as created_at,\n locked as is_locked,\n milestone_id,\n number as issue_number,\n pull_request as is_pull_request,\n repository_id,\n state,\n title,\n cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at,\n user_id\n \n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue.sql", "original_file_path": "models/stg_github__issue.sql", "name": "stg_github__issue", "alias": "stg_github__issue", "checksum": {"name": "sha256", "checksum": "4fa11e7a1ff0785189f14a205478aba55bb62784e05066f421e1723ec12240d0"}, "tags": [], "refs": [["stg_github__issue_tmp"], ["stg_github__issue_tmp"]], "sources": [], "metrics": [], "description": "Table that contains 1 entry for every issue created. Pull Requests also create an entry in this table, and there is a boolean field to determine if an entry is a pull request.", "columns": {"issue_id": {"name": "issue_id", "description": "System generated unique id for the issue. This is not the number that appears in the URL.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "body": {"name": "body", "description": "The text of the main description of the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed_at": {"name": "closed_at", "description": "Timestamp of when the issue was closed, NULL for issues that are open.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_locked": {"name": "is_locked", "description": "Boolean indicating whether the issue is locked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the issue was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "milestone_id": {"name": "milestone_id", "description": "Foreign key that references the milestone table representing the current milestone the issue is in.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_number": {"name": "issue_number", "description": "The issue number within a repository. Is unique by repository, but not across repositories.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_pull_request": {"name": "is_pull_request", "description": "Boolean for is the issue is a pull request (true) ot regular issue (false)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_id": {"name": "repository_id", "description": "Foreign key that references the repository table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the issue is open or closed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "Title of the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the last update was made to the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table, representing the user that created the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1666812439.561398, "compiled_code": "with issue as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n body\n \n as \n \n body\n \n, \n \n \n closed_at\n \n as \n \n closed_at\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 locked\n \n as \n \n locked\n \n, \n \n \n milestone_id\n \n as \n \n milestone_id\n \n, \n \n \n number\n \n as \n \n number\n \n, \n \n \n pull_request\n \n as \n \n pull_request\n \n, \n \n \n repository_id\n \n as \n \n repository_id\n \n, \n \n \n state\n \n as \n \n state\n \n, \n \n \n title\n \n as \n \n title\n \n, \n \n \n updated_at\n \n as \n \n updated_at\n \n, \n \n \n user_id\n \n as \n \n user_id\n \n\n\n\n\n from issue \n\n), fields as (\n\n select \n id as issue_id,\n body,\n cast(closed_at as TIMESTAMP) as closed_at,\n cast(created_at as TIMESTAMP) as created_at,\n locked as is_locked,\n milestone_id,\n number as issue_number,\n pull_request as is_pull_request,\n repository_id,\n state,\n title,\n cast(updated_at as TIMESTAMP) as updated_at,\n user_id\n \n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue`"}, "model.github_source.stg_github__team": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_team_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__team_tmp", "model.github_source.stg_github__team_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__team"], "unique_id": "model.github_source.stg_github__team", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_github__team_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__team_tmp')),\n staging_columns=get_team_columns()\n )\n }}\n \n from base\n \n), final as (\n \n select \n id as team_id,\n description,\n name,\n parent_id,\n privacy,\n slug\n from fields\n)\n\nselect * \nfrom final", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__team.sql", "original_file_path": "models/stg_github__team.sql", "name": "stg_github__team", "alias": "stg_github__team", "checksum": {"name": "sha256", "checksum": "219e47883ec9f076dc1c27b22f72534709edaedd60e8ad9dc1b13db05499f4a4"}, "tags": [], "refs": [["stg_github__team_tmp"], ["stg_github__team_tmp"]], "sources": [], "metrics": [], "description": "Table containing teams and team details", "columns": {"team_id": {"name": "team_id", "description": "System generated unique id for the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "User created description of the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "User created name of the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "Reference to the parent team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "privacy": {"name": "privacy", "description": "Type of privacy permissions associated with the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "slug": {"name": "slug", "description": "Url friendly version of the team name.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__team.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1666812439.566155, "compiled_code": "with base as (\n\n select * \n from `dbt-package-testing`.`github_integration_tests`.`stg_github__team_tmp`\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n description\n \n as \n \n description\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 org_id\n \n as \n \n org_id\n \n, \n \n \n parent_id\n \n as \n \n parent_id\n \n, \n \n \n privacy\n \n as \n \n privacy\n \n, \n \n \n slug\n \n as \n \n slug\n \n\n\n\n \n from base\n \n), final as (\n \n select \n id as team_id,\n description,\n name,\n parent_id,\n privacy,\n slug\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__team`"}, "model.github_source.stg_github__pull_request": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_pull_request_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__pull_request_tmp", "model.github_source.stg_github__pull_request_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__pull_request"], "unique_id": "model.github_source.stg_github__pull_request", "raw_code": "with pull_request as (\n\n select *\n from {{ ref('stg_github__pull_request_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__pull_request_tmp')),\n staging_columns=get_pull_request_columns()\n )\n }}\n\n from pull_request\n\n), fields as (\n\n select \n id as pull_request_id,\n issue_id,\n head_repo_id,\n head_user_id\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__pull_request.sql", "original_file_path": "models/stg_github__pull_request.sql", "name": "stg_github__pull_request", "alias": "stg_github__pull_request", "checksum": {"name": "sha256", "checksum": "c2b1a593030492afcf35407523b636105f42f1cf3fd14f6067e31ba76d70dfe8"}, "tags": [], "refs": [["stg_github__pull_request_tmp"], ["stg_github__pull_request_tmp"]], "sources": [], "metrics": [], "description": "A special type of issue that is created when a user wants to merge one branch of code into another", "columns": {"pull_request_id": {"name": "pull_request_id", "description": "System generated unique id for the pull request.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "head_repo_id": {"name": "head_repo_id", "description": "Foreign key that references the repository table, referencing the current branch.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "head_user_id": {"name": "head_user_id", "description": "Foreign key that references the user table, referencing who created the current branch.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__pull_request.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1666812439.5631201, "compiled_code": "with pull_request as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n base_label\n \n as \n \n base_label\n \n, \n \n \n base_ref\n \n as \n \n base_ref\n \n, \n \n \n base_repo_id\n \n as \n \n base_repo_id\n \n, \n \n \n base_sha\n \n as \n \n base_sha\n \n, \n \n \n base_user_id\n \n as \n \n base_user_id\n \n, \n \n \n head_label\n \n as \n \n head_label\n \n, \n \n \n head_ref\n \n as \n \n head_ref\n \n, \n \n \n head_repo_id\n \n as \n \n head_repo_id\n \n, \n \n \n head_sha\n \n as \n \n head_sha\n \n, \n \n \n head_user_id\n \n as \n \n head_user_id\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n issue_id\n \n as \n \n issue_id\n \n, \n \n \n merge_commit_sha\n \n as \n \n merge_commit_sha\n \n\n\n\n\n from pull_request\n\n), fields as (\n\n select \n id as pull_request_id,\n issue_id,\n head_repo_id,\n head_user_id\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`"}, "model.github_source.stg_github__repository_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.github_integration_tests.github_repository_data"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__repository_tmp"], "unique_id": "model.github_source.stg_github__repository_tmp", "raw_code": "select *\nfrom {{ var('repository') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__repository_tmp.sql", "original_file_path": "models/tmp/stg_github__repository_tmp.sql", "name": "stg_github__repository_tmp", "alias": "stg_github__repository_tmp", "checksum": {"name": "sha256", "checksum": "e090c8cb68dc96c49ee363d95e9bbaf417dd03e2ec675bfdc3d9cefdf889cfc8"}, "tags": [], "refs": [["github_repository_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__repository_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1666812439.450547, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_repository_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__repository_tmp`"}, "model.github_source.stg_github__label_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.github_integration_tests.github_label_data"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__label_tmp"], "unique_id": "model.github_source.stg_github__label_tmp", "raw_code": "select *\nfrom {{ var('label') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__label_tmp.sql", "original_file_path": "models/tmp/stg_github__label_tmp.sql", "name": "stg_github__label_tmp", "alias": "stg_github__label_tmp", "checksum": {"name": "sha256", "checksum": "8e66aceee9e6c677e3b0b105b85de66edea0f4141bef42cd097fd9a236abcf2f"}, "tags": [], "refs": [["github_label_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__label_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1666812439.454255, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_label_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__label_tmp`"}, "model.github_source.stg_github__requested_reviewer_history_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.github_integration_tests.github_requested_reviewer_history_data"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__requested_reviewer_history_tmp"], "unique_id": "model.github_source.stg_github__requested_reviewer_history_tmp", "raw_code": "select *\nfrom {{ var('requested_reviewer_history') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__requested_reviewer_history_tmp.sql", "original_file_path": "models/tmp/stg_github__requested_reviewer_history_tmp.sql", "name": "stg_github__requested_reviewer_history_tmp", "alias": "stg_github__requested_reviewer_history_tmp", "checksum": {"name": "sha256", "checksum": "ed713a77bb2c7407b63c6cc1eb5da22d3267a585bd972dabeb7c86e568180aaf"}, "tags": [], "refs": [["github_requested_reviewer_history_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__requested_reviewer_history_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1666812439.457622, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_requested_reviewer_history_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__requested_reviewer_history_tmp`"}, "model.github_source.stg_github__issue_comment_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.github_integration_tests.github_issue_comment_data"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_comment_tmp"], "unique_id": "model.github_source.stg_github__issue_comment_tmp", "raw_code": "select *\nfrom {{ var('issue_comment') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_comment_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_comment_tmp.sql", "name": "stg_github__issue_comment_tmp", "alias": "stg_github__issue_comment_tmp", "checksum": {"name": "sha256", "checksum": "0954877e30180964df220c97f9b398d775fc74106c25666bf9dd98c5449a72a1"}, "tags": [], "refs": [["github_issue_comment_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_comment_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1666812439.4616761, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_issue_comment_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment_tmp`"}, "model.github_source.stg_github__pull_request_review_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.github_integration_tests.github_pull_request_review_data"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__pull_request_review_tmp"], "unique_id": "model.github_source.stg_github__pull_request_review_tmp", "raw_code": "select *\nfrom {{ var('pull_request_review') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__pull_request_review_tmp.sql", "original_file_path": "models/tmp/stg_github__pull_request_review_tmp.sql", "name": "stg_github__pull_request_review_tmp", "alias": "stg_github__pull_request_review_tmp", "checksum": {"name": "sha256", "checksum": "3419833d93b14d370eb3c9cfb7fda9a373c47a2f9701620425d882b95fbaa55c"}, "tags": [], "refs": [["github_pull_request_review_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__pull_request_review_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1666812439.4647622, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_pull_request_review_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review_tmp`"}, "model.github_source.stg_github__issue_label_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.github_integration_tests.github_issue_label_data"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_label_tmp"], "unique_id": "model.github_source.stg_github__issue_label_tmp", "raw_code": "select *\nfrom {{ var('issue_label') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_label_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_label_tmp.sql", "name": "stg_github__issue_label_tmp", "alias": "stg_github__issue_label_tmp", "checksum": {"name": "sha256", "checksum": "3cd52e662c2bc67a66c9c3e6250e38739362a0b688287d41329d2989297fa201"}, "tags": [], "refs": [["github_issue_label_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_label_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1666812439.467735, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_issue_label_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label_tmp`"}, "model.github_source.stg_github__team_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.github_integration_tests.github_team_data"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__team_tmp"], "unique_id": "model.github_source.stg_github__team_tmp", "raw_code": "select * \nfrom {{ var('team') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__team_tmp.sql", "original_file_path": "models/tmp/stg_github__team_tmp.sql", "name": "stg_github__team_tmp", "alias": "stg_github__team_tmp", "checksum": {"name": "sha256", "checksum": "8c107692c9394962da82e0c2460045e6686d962c1eefe0cff564c618aed7a17d"}, "tags": [], "refs": [["github_team_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__team_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1666812439.4708219, "compiled_code": "select * \nfrom `dbt-package-testing`.`github_integration_tests`.`github_team_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__team_tmp`"}, "model.github_source.stg_github__pull_request_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.github_integration_tests.github_pull_request_data"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__pull_request_tmp"], "unique_id": "model.github_source.stg_github__pull_request_tmp", "raw_code": "select *\nfrom {{ var('pull_request') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__pull_request_tmp.sql", "original_file_path": "models/tmp/stg_github__pull_request_tmp.sql", "name": "stg_github__pull_request_tmp", "alias": "stg_github__pull_request_tmp", "checksum": {"name": "sha256", "checksum": "11df5e7fd7046db485c6654ea88c82c566b71140c4e233f3567bd63bbf1cca19"}, "tags": [], "refs": [["github_pull_request_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__pull_request_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1666812439.473834, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_pull_request_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_tmp`"}, "model.github_source.stg_github__issue_merged_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.github_integration_tests.github_issue_merged_data"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_merged_tmp"], "unique_id": "model.github_source.stg_github__issue_merged_tmp", "raw_code": "select *\nfrom {{ var('issue_merged') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_merged_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_merged_tmp.sql", "name": "stg_github__issue_merged_tmp", "alias": "stg_github__issue_merged_tmp", "checksum": {"name": "sha256", "checksum": "e61fb5297937f494370067232958a443ec21c885a55cca0022f480b463ce90a9"}, "tags": [], "refs": [["github_issue_merged_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_merged_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1666812439.476795, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_issue_merged_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_merged_tmp`"}, "model.github_source.stg_github__user_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.github_integration_tests.github_user_data"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__user_tmp"], "unique_id": "model.github_source.stg_github__user_tmp", "raw_code": "select *\nfrom {{ var('user') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__user_tmp.sql", "original_file_path": "models/tmp/stg_github__user_tmp.sql", "name": "stg_github__user_tmp", "alias": "stg_github__user_tmp", "checksum": {"name": "sha256", "checksum": "e71885bca06f3e1feaef9e729cfb58827c8999bc4d4b7cda538c392c5f56ffdf"}, "tags": [], "refs": [["github_user_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__user_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1666812439.4806578, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_user_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__user_tmp`"}, "model.github_source.stg_github__issue_closed_history_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.github_integration_tests.github_issue_closed_history_data"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_closed_history_tmp"], "unique_id": "model.github_source.stg_github__issue_closed_history_tmp", "raw_code": "select *\nfrom {{ var('issue_closed_history') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_closed_history_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_closed_history_tmp.sql", "name": "stg_github__issue_closed_history_tmp", "alias": "stg_github__issue_closed_history_tmp", "checksum": {"name": "sha256", "checksum": "5ce3eed90261c385c0ddcb0dc9d914a0bf3d3e0f737e4e233af244d29bbf3ce4"}, "tags": [], "refs": [["github_issue_closed_history_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_closed_history_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1666812439.484015, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_issue_closed_history_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history_tmp`"}, "model.github_source.stg_github__issue_assignee_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.github_integration_tests.github_issue_assignee_data"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_assignee_tmp"], "unique_id": "model.github_source.stg_github__issue_assignee_tmp", "raw_code": "select *\nfrom {{ var('issue_assignee') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_assignee_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_assignee_tmp.sql", "name": "stg_github__issue_assignee_tmp", "alias": "stg_github__issue_assignee_tmp", "checksum": {"name": "sha256", "checksum": "4cab39e652c5972bfa16de13454df8e5745610e91b69f3840305e49a9d613753"}, "tags": [], "refs": [["github_issue_assignee_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_assignee_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1666812439.487417, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_issue_assignee_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee_tmp`"}, "model.github_source.stg_github__issue_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.github_integration_tests.github_issue_data"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_tmp"], "unique_id": "model.github_source.stg_github__issue_tmp", "raw_code": "select *\nfrom {{ var('issue') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_tmp.sql", "name": "stg_github__issue_tmp", "alias": "stg_github__issue_tmp", "checksum": {"name": "sha256", "checksum": "4100b13686c42d580a5eeaab15449896ec2ce740b0e5f002775eb9f222ef7c32"}, "tags": [], "refs": [["github_issue_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1666812439.490473, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_issue_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_tmp`"}, "model.github_source.stg_github__repo_team_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.github_integration_tests.github_repo_team_data"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__repo_team_tmp"], "unique_id": "model.github_source.stg_github__repo_team_tmp", "raw_code": "{{ config(enabled=var('github__using_repo_team', True)) }}\n\nselect * \nfrom {{ var('repo_team') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__repo_team_tmp.sql", "original_file_path": "models/tmp/stg_github__repo_team_tmp.sql", "name": "stg_github__repo_team_tmp", "alias": "stg_github__repo_team_tmp", "checksum": {"name": "sha256", "checksum": "25a704d9235d40dc05601995f184779690eabcc6e3a64d3a0489e00c3e6d13ab"}, "tags": [], "refs": [["github_repo_team_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__repo_team_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "enabled": true}, "created_at": 1666812439.493454, "compiled_code": "\n\nselect * \nfrom `dbt-package-testing`.`github_integration_tests`.`github_repo_team_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team_tmp`"}, "test.github.unique_github__issues_issue_id.6723b9b1db": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('github__issues')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__issues"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__issues_issue_id"], "unique_id": "test.github.unique_github__issues_issue_id.6723b9b1db", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__issues_issue_id.sql", "original_file_path": "models/github.yml", "name": "unique_github__issues_issue_id", "alias": "unique_github__issues_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__issues"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__issues_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.5233788, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select issue_id as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`github__issues`\n where issue_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.github__issues"}, "test.github.not_null_github__issues_issue_id.fed0631e25": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('github__issues')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__issues"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__issues_issue_id"], "unique_id": "test.github.not_null_github__issues_issue_id.fed0631e25", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__issues_issue_id.sql", "original_file_path": "models/github.yml", "name": "not_null_github__issues_issue_id", "alias": "not_null_github__issues_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__issues"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__issues_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.524467, "compiled_code": "\n \n \n\n\n\nselect issue_id\nfrom `dbt-package-testing`.`github_integration_tests`.`github__issues`\nwhere issue_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.github__issues"}, "test.github.unique_github__pull_requests_issue_id.ce23997907": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('github__pull_requests')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__pull_requests"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__pull_requests_issue_id"], "unique_id": "test.github.unique_github__pull_requests_issue_id.ce23997907", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__pull_requests_issue_id.sql", "original_file_path": "models/github.yml", "name": "unique_github__pull_requests_issue_id", "alias": "unique_github__pull_requests_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__pull_requests"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__pull_requests_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.525402, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select issue_id as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`github__pull_requests`\n where issue_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.github__pull_requests"}, "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('github__pull_requests')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__pull_requests"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__pull_requests_issue_id"], "unique_id": "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__pull_requests_issue_id.sql", "original_file_path": "models/github.yml", "name": "not_null_github__pull_requests_issue_id", "alias": "not_null_github__pull_requests_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__pull_requests"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__pull_requests_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.526331, "compiled_code": "\n \n \n\n\n\nselect issue_id\nfrom `dbt-package-testing`.`github_integration_tests`.`github__pull_requests`\nwhere issue_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.github__pull_requests"}, "test.github.unique_github__daily_metrics_day.f98cab9456": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "day", "model": "{{ get_where_subquery(ref('github__daily_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__daily_metrics_day"], "unique_id": "test.github.unique_github__daily_metrics_day.f98cab9456", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__daily_metrics_day.sql", "original_file_path": "models/github.yml", "name": "unique_github__daily_metrics_day", "alias": "unique_github__daily_metrics_day", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__daily_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__daily_metrics_day.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.52738, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select day as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`github__daily_metrics`\n where day is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "day", "file_key_name": "models.github__daily_metrics"}, "test.github.not_null_github__daily_metrics_day.647e494434": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "day", "model": "{{ get_where_subquery(ref('github__daily_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__daily_metrics_day"], "unique_id": "test.github.not_null_github__daily_metrics_day.647e494434", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__daily_metrics_day.sql", "original_file_path": "models/github.yml", "name": "not_null_github__daily_metrics_day", "alias": "not_null_github__daily_metrics_day", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__daily_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__daily_metrics_day.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.5282838, "compiled_code": "\n \n \n\n\n\nselect day\nfrom `dbt-package-testing`.`github_integration_tests`.`github__daily_metrics`\nwhere day is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "day", "file_key_name": "models.github__daily_metrics"}, "test.github.unique_github__weekly_metrics_week.6794858a8e": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "week", "model": "{{ get_where_subquery(ref('github__weekly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__weekly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__weekly_metrics_week"], "unique_id": "test.github.unique_github__weekly_metrics_week.6794858a8e", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__weekly_metrics_week.sql", "original_file_path": "models/github.yml", "name": "unique_github__weekly_metrics_week", "alias": "unique_github__weekly_metrics_week", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__weekly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__weekly_metrics_week.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.529196, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select week as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`github__weekly_metrics`\n where week is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "week", "file_key_name": "models.github__weekly_metrics"}, "test.github.not_null_github__weekly_metrics_week.4b0b928243": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "week", "model": "{{ get_where_subquery(ref('github__weekly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__weekly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__weekly_metrics_week"], "unique_id": "test.github.not_null_github__weekly_metrics_week.4b0b928243", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__weekly_metrics_week.sql", "original_file_path": "models/github.yml", "name": "not_null_github__weekly_metrics_week", "alias": "not_null_github__weekly_metrics_week", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__weekly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__weekly_metrics_week.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.530111, "compiled_code": "\n \n \n\n\n\nselect week\nfrom `dbt-package-testing`.`github_integration_tests`.`github__weekly_metrics`\nwhere week is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "week", "file_key_name": "models.github__weekly_metrics"}, "test.github.unique_github__monthly_metrics_month.3076284fbb": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "month", "model": "{{ get_where_subquery(ref('github__monthly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__monthly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__monthly_metrics_month"], "unique_id": "test.github.unique_github__monthly_metrics_month.3076284fbb", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__monthly_metrics_month.sql", "original_file_path": "models/github.yml", "name": "unique_github__monthly_metrics_month", "alias": "unique_github__monthly_metrics_month", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__monthly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__monthly_metrics_month.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.531159, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select month as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`github__monthly_metrics`\n where month is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "month", "file_key_name": "models.github__monthly_metrics"}, "test.github.not_null_github__monthly_metrics_month.9e4fba84df": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "month", "model": "{{ get_where_subquery(ref('github__monthly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__monthly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__monthly_metrics_month"], "unique_id": "test.github.not_null_github__monthly_metrics_month.9e4fba84df", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__monthly_metrics_month.sql", "original_file_path": "models/github.yml", "name": "not_null_github__monthly_metrics_month", "alias": "not_null_github__monthly_metrics_month", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__monthly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__monthly_metrics_month.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.532068, "compiled_code": "\n \n \n\n\n\nselect month\nfrom `dbt-package-testing`.`github_integration_tests`.`github__monthly_metrics`\nwhere month is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "month", "file_key_name": "models.github__monthly_metrics"}, "test.github.unique_github__quarterly_metrics_quarter.9165a921c1": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "quarter", "model": "{{ get_where_subquery(ref('github__quarterly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__quarterly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__quarterly_metrics_quarter"], "unique_id": "test.github.unique_github__quarterly_metrics_quarter.9165a921c1", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__quarterly_metrics_quarter.sql", "original_file_path": "models/github.yml", "name": "unique_github__quarterly_metrics_quarter", "alias": "unique_github__quarterly_metrics_quarter", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__quarterly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__quarterly_metrics_quarter.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.533098, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select quarter as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`github__quarterly_metrics`\n where quarter is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "quarter", "file_key_name": "models.github__quarterly_metrics"}, "test.github.not_null_github__quarterly_metrics_quarter.92394d46dc": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "quarter", "model": "{{ get_where_subquery(ref('github__quarterly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__quarterly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__quarterly_metrics_quarter"], "unique_id": "test.github.not_null_github__quarterly_metrics_quarter.92394d46dc", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__quarterly_metrics_quarter.sql", "original_file_path": "models/github.yml", "name": "not_null_github__quarterly_metrics_quarter", "alias": "not_null_github__quarterly_metrics_quarter", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__quarterly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__quarterly_metrics_quarter.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.534125, "compiled_code": "\n \n \n\n\n\nselect quarter\nfrom `dbt-package-testing`.`github_integration_tests`.`github__quarterly_metrics`\nwhere quarter is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "quarter", "file_key_name": "models.github__quarterly_metrics"}, "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["issue_id", "user_id"], "model": "{{ get_where_subquery(ref('stg_github__issue_assignee')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue_assignee"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id"], "unique_id": "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388\") }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388.sql", "original_file_path": "models/stg_github.yml", "name": "dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id", "alias": "dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue_assignee"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388"}, "created_at": 1666812439.5681238, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n issue_id, user_id\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee`\n group by issue_id, user_id\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_github__issue_assignee"}, "test.github_source.not_null_stg_github__label_label_id.9f07379974": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "label_id", "model": "{{ get_where_subquery(ref('stg_github__label')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__label"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__label_label_id"], "unique_id": "test.github_source.not_null_stg_github__label_label_id.9f07379974", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__label_label_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__label_label_id", "alias": "not_null_stg_github__label_label_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__label"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__label_label_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.5751219, "compiled_code": "\n \n \n\n\n\nselect label_id\nfrom `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\nwhere label_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "label_id", "file_key_name": "models.stg_github__label"}, "test.github_source.unique_stg_github__label_label_id.74d3c21466": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "label_id", "model": "{{ get_where_subquery(ref('stg_github__label')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__label"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__label_label_id"], "unique_id": "test.github_source.unique_stg_github__label_label_id.74d3c21466", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__label_label_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__label_label_id", "alias": "unique_stg_github__label_label_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__label"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__label_label_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.576064, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select label_id as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\n where label_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "label_id", "file_key_name": "models.stg_github__label"}, "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["issue_id", "updated_at"], "model": "{{ get_where_subquery(ref('stg_github__issue_closed_history')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue_closed_history"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at"], "unique_id": "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f\") }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f.sql", "original_file_path": "models/stg_github.yml", "name": "dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at", "alias": "dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue_closed_history"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f"}, "created_at": 1666812439.577471, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n issue_id, updated_at\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history`\n group by issue_id, updated_at\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_github__issue_closed_history"}, "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "issue_comment_id", "model": "{{ get_where_subquery(ref('stg_github__issue_comment')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue_comment"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__issue_comment_issue_comment_id"], "unique_id": "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__issue_comment_issue_comment_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__issue_comment_issue_comment_id", "alias": "unique_stg_github__issue_comment_issue_comment_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue_comment"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__issue_comment_issue_comment_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.580319, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select issue_comment_id as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment`\n where issue_comment_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_comment_id", "file_key_name": "models.stg_github__issue_comment"}, "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "issue_comment_id", "model": "{{ get_where_subquery(ref('stg_github__issue_comment')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue_comment"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__issue_comment_issue_comment_id"], "unique_id": "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__issue_comment_issue_comment_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__issue_comment_issue_comment_id", "alias": "not_null_stg_github__issue_comment_issue_comment_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue_comment"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__issue_comment_issue_comment_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.581419, "compiled_code": "\n \n \n\n\n\nselect issue_comment_id\nfrom `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment`\nwhere issue_comment_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_comment_id", "file_key_name": "models.stg_github__issue_comment"}, "test.github_source.unique_stg_github__issue_issue_id.84891aeece": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('stg_github__issue')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__issue_issue_id"], "unique_id": "test.github_source.unique_stg_github__issue_issue_id.84891aeece", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__issue_issue_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__issue_issue_id", "alias": "unique_stg_github__issue_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__issue_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.582388, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select issue_id as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n where issue_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.stg_github__issue"}, "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('stg_github__issue')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__issue_issue_id"], "unique_id": "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__issue_issue_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__issue_issue_id", "alias": "not_null_stg_github__issue_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__issue_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.583352, "compiled_code": "\n \n \n\n\n\nselect issue_id\nfrom `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\nwhere issue_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.stg_github__issue"}, "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "pull_request_review_id", "model": "{{ get_where_subquery(ref('stg_github__pull_request_review')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__pull_request_review"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__pull_request_review_pull_request_review_id"], "unique_id": "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__pull_request_review_pull_request_review_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__pull_request_review_pull_request_review_id", "alias": "unique_stg_github__pull_request_review_pull_request_review_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__pull_request_review"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__pull_request_review_pull_request_review_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.584297, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select pull_request_review_id as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n where pull_request_review_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "pull_request_review_id", "file_key_name": "models.stg_github__pull_request_review"}, "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "pull_request_review_id", "model": "{{ get_where_subquery(ref('stg_github__pull_request_review')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__pull_request_review"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__pull_request_review_pull_request_review_id"], "unique_id": "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__pull_request_review_pull_request_review_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__pull_request_review_pull_request_review_id", "alias": "not_null_stg_github__pull_request_review_pull_request_review_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__pull_request_review"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__pull_request_review_pull_request_review_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.585383, "compiled_code": "\n \n \n\n\n\nselect pull_request_review_id\nfrom `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\nwhere pull_request_review_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "pull_request_review_id", "file_key_name": "models.stg_github__pull_request_review"}, "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "pull_request_id", "model": "{{ get_where_subquery(ref('stg_github__pull_request')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__pull_request"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__pull_request_pull_request_id"], "unique_id": "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__pull_request_pull_request_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__pull_request_pull_request_id", "alias": "unique_stg_github__pull_request_pull_request_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__pull_request"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__pull_request_pull_request_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.586422, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select pull_request_id as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n where pull_request_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "pull_request_id", "file_key_name": "models.stg_github__pull_request"}, "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "pull_request_id", "model": "{{ get_where_subquery(ref('stg_github__pull_request')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__pull_request"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__pull_request_pull_request_id"], "unique_id": "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__pull_request_pull_request_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__pull_request_pull_request_id", "alias": "not_null_stg_github__pull_request_pull_request_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__pull_request"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__pull_request_pull_request_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.5874949, "compiled_code": "\n \n \n\n\n\nselect pull_request_id\nfrom `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\nwhere pull_request_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "pull_request_id", "file_key_name": "models.stg_github__pull_request"}, "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "repository_id", "model": "{{ get_where_subquery(ref('stg_github__repo_team')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__repo_team"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__repo_team_repository_id"], "unique_id": "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__repo_team_repository_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__repo_team_repository_id", "alias": "not_null_stg_github__repo_team_repository_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__repo_team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__repo_team_repository_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.588463, "compiled_code": "\n \n \n\n\n\nselect repository_id\nfrom `dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team`\nwhere repository_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "repository_id", "file_key_name": "models.stg_github__repo_team"}, "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "team_id", "model": "{{ get_where_subquery(ref('stg_github__repo_team')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__repo_team"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__repo_team_team_id"], "unique_id": "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__repo_team_team_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__repo_team_team_id", "alias": "not_null_stg_github__repo_team_team_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__repo_team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__repo_team_team_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.5895329, "compiled_code": "\n \n \n\n\n\nselect team_id\nfrom `dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team`\nwhere team_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "team_id", "file_key_name": "models.stg_github__repo_team"}, "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "repository_id", "model": "{{ get_where_subquery(ref('stg_github__repository')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__repository"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__repository_repository_id"], "unique_id": "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__repository_repository_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__repository_repository_id", "alias": "unique_stg_github__repository_repository_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__repository"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__repository_repository_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.590462, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select repository_id as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repository`\n where repository_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "repository_id", "file_key_name": "models.stg_github__repository"}, "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "repository_id", "model": "{{ get_where_subquery(ref('stg_github__repository')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__repository"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__repository_repository_id"], "unique_id": "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__repository_repository_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__repository_repository_id", "alias": "not_null_stg_github__repository_repository_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__repository"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__repository_repository_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.591392, "compiled_code": "\n \n \n\n\n\nselect repository_id\nfrom `dbt-package-testing`.`github_integration_tests`.`stg_github__repository`\nwhere repository_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "repository_id", "file_key_name": "models.stg_github__repository"}, "test.github_source.unique_stg_github__team_team_id.94e9716ab4": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "team_id", "model": "{{ get_where_subquery(ref('stg_github__team')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__team"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__team_team_id"], "unique_id": "test.github_source.unique_stg_github__team_team_id.94e9716ab4", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__team_team_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__team_team_id", "alias": "unique_stg_github__team_team_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__team_team_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.59231, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select team_id as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__team`\n where team_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "team_id", "file_key_name": "models.stg_github__team"}, "test.github_source.not_null_stg_github__team_team_id.440aefe7a7": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "team_id", "model": "{{ get_where_subquery(ref('stg_github__team')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__team"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__team_team_id"], "unique_id": "test.github_source.not_null_stg_github__team_team_id.440aefe7a7", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__team_team_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__team_team_id", "alias": "not_null_stg_github__team_team_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__team_team_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.593385, "compiled_code": "\n \n \n\n\n\nselect team_id\nfrom `dbt-package-testing`.`github_integration_tests`.`stg_github__team`\nwhere team_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "team_id", "file_key_name": "models.stg_github__team"}, "test.github_source.unique_stg_github__user_user_id.5c1a00cd90": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(ref('stg_github__user')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__user"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__user_user_id"], "unique_id": "test.github_source.unique_stg_github__user_user_id.5c1a00cd90", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__user_user_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__user_user_id", "alias": "unique_stg_github__user_user_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__user"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__user_user_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.5942929, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select user_id as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n where user_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "user_id", "file_key_name": "models.stg_github__user"}, "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(ref('stg_github__user')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__user"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__user_user_id"], "unique_id": "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__user_user_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__user_user_id", "alias": "not_null_stg_github__user_user_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__user"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__user_user_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.5951948, "compiled_code": "\n \n \n\n\n\nselect user_id\nfrom `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "user_id", "file_key_name": "models.stg_github__user"}}, "sources": {"source.github_source.github.issue_assignee": {"fqn": ["github_source", "github", "issue_assignee"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue_assignee", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue_assignee", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "issue_assignee", "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": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table with the current user(s) assigned to an issue", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`issue_assignee`", "created_at": 1666812439.595996}, "source.github_source.github.label": {"fqn": ["github_source", "github", "label"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.label", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "label", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "label", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Table that contains labels that are used across your Github account within individual repositories.", "columns": {"id": {"name": "id", "description": "Unique identifier of the Github label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of the record being synced by Fivetran", "meta": {}, "data_type": null, "quote": null, "tags": []}, "color": {"name": "color", "description": "The color of the label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "The description of the label indicating the purpose", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_default": {"name": "is_default", "description": "Boolean flagging if the label is default on creation", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "Name of the label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url": {"name": "url", "description": "Url where the label was used", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`label`", "created_at": 1666812439.596092}, "source.github_source.github.issue_closed_history": {"fqn": ["github_source", "github", "issue_closed_history"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue_closed_history", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue_closed_history", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "issue_closed_history", "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": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table to track when an issue is closed or re-opened", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the action took place", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed": {"name": "closed", "description": "Boolean variable for if the issue was closed (true) or re-opened (false)", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`issue_closed_history`", "created_at": 1666812439.59616}, "source.github_source.github.issue_label": {"fqn": ["github_source", "github", "issue_label"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue_label", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue_label", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "issue_label", "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": 168, "period": "hour"}, "filter": null}, "external": null, "description": "The current labels attached to an issue", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "label_id": {"name": "label_id", "description": "Unique identifier of the used label", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`issue_label`", "created_at": 1666812439.596221}, "source.github_source.github.issue_comment": {"fqn": ["github_source", "github", "issue_comment"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue_comment", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue_comment", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "issue_comment", "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": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table that contains comments made on issues", "columns": {"id": {"name": "id", "description": "System generated unique id for the issue comment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`issue_comment`", "created_at": 1666812439.596282}, "source.github_source.github.issue_merged": {"fqn": ["github_source", "github", "issue_merged"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue_merged", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue_merged", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "issue_merged", "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": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table that tracks when an issue (always a pull request) is merged", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table. This table will only reference issues that are pull requests", "meta": {}, "data_type": null, "quote": null, "tags": []}, "merged_at": {"name": "merged_at", "description": "Timestamp of when the code merge took place", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`issue_merged`", "created_at": 1666812439.596344}, "source.github_source.github.issue": {"fqn": ["github_source", "github", "issue"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "issue", "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": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table that contains 1 entry for every issue created. Pull Requests also create an entry in this table, and there is a boolean field to determine if an entry is a pull request.", "columns": {"id": {"name": "id", "description": "System generated unique id for the issue. This is not the number that appears in the URL.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "body": {"name": "body", "description": "The text of the main description of the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "locked": {"name": "locked", "description": "Boolean indicating whether the issue is locked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed_at": {"name": "closed_at", "description": "Timestamp of when the issue was closed, NULL for issues that are open.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the issue was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "milestone_id": {"name": "milestone_id", "description": "Foreign key that references the milestone table representing the current milestone the issue is in.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number": {"name": "number", "description": "The issue number within a repository. Is unique by repository, but not across repositories.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pull_request": {"name": "pull_request", "description": "Boolean for is the issue is a pull request (true) ot regular issue (false)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_id": {"name": "repository_id", "description": "Foreign key that references the repository table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the issue is open or closed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "Title of the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the last update was made to the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table, representing the user that created the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`issue`", "created_at": 1666812439.596417}, "source.github_source.github.pull_request_review": {"fqn": ["github_source", "github", "pull_request_review"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.pull_request_review", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "pull_request_review", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "pull_request_review", "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": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table containing reviews made to pull requests", "columns": {"id": {"name": "id", "description": "System generated unique id for the pull request review.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pull_request_id": {"name": "pull_request_id", "description": "Foreign key that references the pull request table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "submitted_at": {"name": "submitted_at", "description": "Timestamp of when the request for review was submitted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the review was an approval, request for change, comment, dismissal.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table, representing the user that reviewed the pull request.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`pull_request_review`", "created_at": 1666812439.596481}, "source.github_source.github.pull_request": {"fqn": ["github_source", "github", "pull_request"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.pull_request", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "pull_request", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "pull_request", "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": 168, "period": "hour"}, "filter": null}, "external": null, "description": "A special type of issue that is created when a user wants to merge one branch of code into another", "columns": {"id": {"name": "id", "description": "System generated unique id for the pull request.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "head_repo_id": {"name": "head_repo_id", "description": "Foreign key that references the repository table, referencing the current branch.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "head_user_id": {"name": "head_user_id", "description": "Foreign key that references the user table, referencing who created the current branch.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`pull_request`", "created_at": 1666812439.596542}, "source.github_source.github.repo_team": {"fqn": ["github_source", "github", "repo_team"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.repo_team", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "repo_team", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "repo_team", "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": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table representing the mapping relationships between repositories and teams", "columns": {"repository_id": {"name": "repository_id", "description": "Reference to the respective repository for the record.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "team_id": {"name": "team_id", "description": "Reference to the respective team for the record.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {"is_enabled": true}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`repo_team`", "created_at": 1666812439.596601}, "source.github_source.github.repository": {"fqn": ["github_source", "github", "repository"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.repository", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "repository", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "repository", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Table representing the file structure of a directory under git control", "columns": {"id": {"name": "id", "description": "System generated unique id for the repository.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the repository was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "full_name": {"name": "full_name", "description": "The name of the git repository.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "private": {"name": "private", "description": "Boolean field indicating whether the repository is private (true) or public (false).", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`repository`", "created_at": 1666812439.596661}, "source.github_source.github.requested_reviewer_history": {"fqn": ["github_source", "github", "requested_reviewer_history"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.requested_reviewer_history", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "requested_reviewer_history", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "requested_reviewer_history", "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": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table containing when a user requests another user to review a pull request", "columns": {"pull_request_id": {"name": "pull_request_id", "description": "Foreign key that references the pull request table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the review was submitted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "requested_id": {"name": "requested_id", "description": "Foreign key that references the user table, representing the user that was requested to review a PR.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "removed": {"name": "removed", "description": "Boolean variable indicating if the requester was removed from the PR (true) or added to the PR (false).", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`requested_reviewer_history`", "created_at": 1666812439.596725}, "source.github_source.github.team": {"fqn": ["github_source", "github", "team"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.team", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "team", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "team", "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": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table containing teams and team details", "columns": {"id": {"name": "id", "description": "System generated unique id for the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "User created description of the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "User created name of the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "Reference to the parent team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "privacy": {"name": "privacy", "description": "Type of privacy permissions associated with the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "slug": {"name": "slug", "description": "Url friendly version of the team name.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`team`", "created_at": 1666812439.5967948}, "source.github_source.github.user": {"fqn": ["github_source", "github", "user"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.user", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "user", "source_name": "github", "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 representing contributors to a git project", "columns": {"id": {"name": "id", "description": "System generated unique id for the user.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "login": {"name": "login", "description": "The alias the user uses to login to github.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the user", "meta": {}, "data_type": null, "quote": null, "tags": []}, "company": {"name": "company", "description": "The company of the user.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`user`", "created_at": 1666812439.596854}}, "macros": {"macro.dbt_bigquery.date_sharded_table": {"unique_id": "macro.dbt_bigquery.date_sharded_table", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "date_sharded_table", "macro_sql": "{% macro date_sharded_table(base_name) %}\n {{ return(base_name ~ \"[DBT__PARTITION_DATE]\") }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.6762729, "supported_languages": null}, "macro.dbt_bigquery.grant_access_to": {"unique_id": "macro.dbt_bigquery.grant_access_to", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "grant_access_to", "macro_sql": "{% macro grant_access_to(entity, entity_type, role, grant_target_dict) -%}\n {% do adapter.grant_access_to(entity, entity_type, role, grant_target_dict) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.6765199, "supported_languages": null}, "macro.dbt_bigquery.get_partitions_metadata": {"unique_id": "macro.dbt_bigquery.get_partitions_metadata", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "get_partitions_metadata", "macro_sql": "\n\n{%- macro get_partitions_metadata(table) -%}\n {%- if execute -%}\n {%- set res = adapter.get_partitions_metadata(table) -%}\n {{- return(res) -}}\n {%- endif -%}\n {{- return(None) -}}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.676818, "supported_languages": null}, "macro.dbt_bigquery.bigquery__get_catalog": {"unique_id": "macro.dbt_bigquery.bigquery__get_catalog", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "name": "bigquery__get_catalog", "macro_sql": "{% macro bigquery__get_catalog(information_schema, schemas) -%}\n\n {%- if (schemas | length) == 0 -%}\n {# Hopefully nothing cares about the columns we return when there are no rows #}\n {%- set query = \"select 1 as id limit 0\" -%}\n {%- else -%}\n\n {%- set query -%}\n with tables as (\n select\n project_id as table_database,\n dataset_id as table_schema,\n table_id as original_table_name,\n\n concat(project_id, '.', dataset_id, '.', table_id) as relation_id,\n\n row_count,\n size_bytes as size_bytes,\n case\n when type = 1 then 'table'\n when type = 2 then 'view'\n else 'external'\n end as table_type,\n\n REGEXP_CONTAINS(table_id, '^.+[0-9]{8}$') and coalesce(type, 0) = 1 as is_date_shard,\n REGEXP_EXTRACT(table_id, '^(.+)[0-9]{8}$') as shard_base_name,\n REGEXP_EXTRACT(table_id, '^.+([0-9]{8})$') as shard_name\n\n from {{ information_schema.replace(information_schema_view='__TABLES__') }}\n where (\n {%- for schema in schemas -%}\n upper(dataset_id) = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n ),\n\n extracted as (\n\n select *,\n case\n when is_date_shard then shard_base_name\n else original_table_name\n end as table_name\n\n from tables\n\n ),\n\n unsharded_tables as (\n\n select\n table_database,\n table_schema,\n table_name,\n coalesce(table_type, 'external') as table_type,\n is_date_shard,\n\n struct(\n min(shard_name) as shard_min,\n max(shard_name) as shard_max,\n count(*) as shard_count\n ) as table_shards,\n\n sum(size_bytes) as size_bytes,\n sum(row_count) as row_count,\n\n max(relation_id) as relation_id\n\n from extracted\n group by 1,2,3,4,5\n\n ),\n\n info_schema_columns as (\n\n select\n concat(table_catalog, '.', table_schema, '.', table_name) as relation_id,\n table_catalog as table_database,\n table_schema,\n table_name,\n\n -- use the \"real\" column name from the paths query below\n column_name as base_column_name,\n ordinal_position as column_index,\n\n is_partitioning_column,\n clustering_ordinal_position\n\n from {{ information_schema.replace(information_schema_view='COLUMNS') }}\n where ordinal_position is not null\n\n ),\n\n info_schema_column_paths as (\n\n select\n concat(table_catalog, '.', table_schema, '.', table_name) as relation_id,\n field_path as column_name,\n data_type as column_type,\n column_name as base_column_name,\n description as column_comment\n\n from {{ information_schema.replace(information_schema_view='COLUMN_FIELD_PATHS') }}\n\n ),\n\n columns as (\n\n select * except (base_column_name)\n from info_schema_columns\n join info_schema_column_paths using (relation_id, base_column_name)\n\n ),\n\n column_stats as (\n\n select\n table_database,\n table_schema,\n table_name,\n max(relation_id) as relation_id,\n max(case when is_partitioning_column = 'YES' then 1 else 0 end) = 1 as is_partitioned,\n max(case when is_partitioning_column = 'YES' then column_name else null end) as partition_column,\n max(case when clustering_ordinal_position is not null then 1 else 0 end) = 1 as is_clustered,\n array_to_string(\n array_agg(\n case\n when clustering_ordinal_position is not null then column_name\n else null\n end ignore nulls\n order by clustering_ordinal_position\n ), ', '\n ) as clustering_columns\n\n from columns\n group by 1,2,3\n\n )\n\n select\n unsharded_tables.table_database,\n unsharded_tables.table_schema,\n case\n when is_date_shard then concat(unsharded_tables.table_name, '*')\n else unsharded_tables.table_name\n end as table_name,\n unsharded_tables.table_type,\n\n -- coalesce name and type for External tables - these columns are not\n -- present in the COLUMN_FIELD_PATHS resultset\n coalesce(columns.column_name, '') as column_name,\n -- invent a row number to account for nested fields -- BQ does\n -- not treat these nested properties as independent fields\n row_number() over (\n partition by relation_id\n order by columns.column_index, columns.column_name\n ) as column_index,\n coalesce(columns.column_type, '') as column_type,\n columns.column_comment,\n\n 'Shard count' as `stats__date_shards__label`,\n table_shards.shard_count as `stats__date_shards__value`,\n 'The number of date shards in this table' as `stats__date_shards__description`,\n is_date_shard as `stats__date_shards__include`,\n\n 'Shard (min)' as `stats__date_shard_min__label`,\n table_shards.shard_min as `stats__date_shard_min__value`,\n 'The first date shard in this table' as `stats__date_shard_min__description`,\n is_date_shard as `stats__date_shard_min__include`,\n\n 'Shard (max)' as `stats__date_shard_max__label`,\n table_shards.shard_max as `stats__date_shard_max__value`,\n 'The last date shard in this table' as `stats__date_shard_max__description`,\n is_date_shard as `stats__date_shard_max__include`,\n\n '# Rows' as `stats__num_rows__label`,\n row_count as `stats__num_rows__value`,\n 'Approximate count of rows in this table' as `stats__num_rows__description`,\n (unsharded_tables.table_type = 'table') as `stats__num_rows__include`,\n\n 'Approximate Size' as `stats__num_bytes__label`,\n size_bytes as `stats__num_bytes__value`,\n 'Approximate size of table as reported by BigQuery' as `stats__num_bytes__description`,\n (unsharded_tables.table_type = 'table') as `stats__num_bytes__include`,\n\n 'Partitioned By' as `stats__partitioning_type__label`,\n partition_column as `stats__partitioning_type__value`,\n 'The partitioning column for this table' as `stats__partitioning_type__description`,\n is_partitioned as `stats__partitioning_type__include`,\n\n 'Clustered By' as `stats__clustering_fields__label`,\n clustering_columns as `stats__clustering_fields__value`,\n 'The clustering columns for this table' as `stats__clustering_fields__description`,\n is_clustered as `stats__clustering_fields__include`\n\n -- join using relation_id (an actual relation, not a shard prefix) to make\n -- sure that column metadata is picked up through the join. This will only\n -- return the column information for the \"max\" table in a date-sharded table set\n from unsharded_tables\n left join columns using (relation_id)\n left join column_stats using (relation_id)\n {%- endset -%}\n\n {%- endif -%}\n\n {{ return(run_query(query)) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.6802409, "supported_languages": null}, "macro.dbt_bigquery.partition_by": {"unique_id": "macro.dbt_bigquery.partition_by", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "partition_by", "macro_sql": "{% macro partition_by(partition_config) -%}\n {%- if partition_config is none -%}\n {% do return('') %}\n {%- elif partition_config.data_type | lower in ('date','timestamp','datetime') -%}\n partition by {{ partition_config.render() }}\n {%- elif partition_config.data_type | lower in ('int64') -%}\n {%- set range = partition_config.range -%}\n partition by range_bucket(\n {{ partition_config.field }},\n generate_array({{ range.start}}, {{ range.end }}, {{ range.interval }})\n )\n {%- endif -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.684181, "supported_languages": null}, "macro.dbt_bigquery.cluster_by": {"unique_id": "macro.dbt_bigquery.cluster_by", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "cluster_by", "macro_sql": "{% macro cluster_by(raw_cluster_by) %}\n {%- if raw_cluster_by is not none -%}\n cluster by {% if raw_cluster_by is string -%}\n {% set raw_cluster_by = [raw_cluster_by] %}\n {%- endif -%}\n {%- for cluster in raw_cluster_by -%}\n {{ cluster }}\n {%- if not loop.last -%}, {% endif -%}\n {%- endfor -%}\n\n {% endif %}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.684744, "supported_languages": null}, "macro.dbt_bigquery.bigquery_options": {"unique_id": "macro.dbt_bigquery.bigquery_options", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_options", "macro_sql": "{% macro bigquery_options(opts) %}\n {% set options -%}\n OPTIONS({% for opt_key, opt_val in opts.items() %}\n {{ opt_key }}={{ opt_val }}{{ \",\" if not loop.last }}\n {% endfor %})\n {%- endset %}\n {%- do return(options) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.685181, "supported_languages": null}, "macro.dbt_bigquery.bigquery_table_options": {"unique_id": "macro.dbt_bigquery.bigquery_table_options", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_table_options", "macro_sql": "{% macro bigquery_table_options(config, node, temporary) %}\n {% set opts = adapter.get_table_options(config, node, temporary) %}\n {%- do return(bigquery_options(opts)) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.6854558, "supported_languages": null}, "macro.dbt_bigquery.bigquery__create_table_as": {"unique_id": "macro.dbt_bigquery.bigquery__create_table_as", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_table_as", "macro_sql": "{% macro bigquery__create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {%- if language == '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 {{ compiled_code }}\n );\n {%- elif language == 'python' -%}\n {#--\n N.B. Python models _can_ write to temp views HOWEVER they use a different session\n and have already expired by the time they need to be used (I.E. in merges for incremental models)\n\n TODO: Deep dive into spark sessions to see if we can reuse a single session for an entire\n dbt invocation.\n --#}\n {{ py_write_table(compiled_code=compiled_code, target_relation=relation.quote(database=False, schema=False, identifier=False)) }}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"bigquery__create_table_as macro didn't get supported language, it got %s\" % language) %}\n {%- endif -%}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.partition_by", "macro.dbt_bigquery.cluster_by", "macro.dbt_bigquery.bigquery_table_options", "macro.dbt_bigquery.py_write_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.686474, "supported_languages": null}, "macro.dbt_bigquery.bigquery_view_options": {"unique_id": "macro.dbt_bigquery.bigquery_view_options", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_view_options", "macro_sql": "{% macro bigquery_view_options(config, node) %}\n {% set opts = adapter.get_view_options(config, node) %}\n {%- do return(bigquery_options(opts)) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.686722, "supported_languages": null}, "macro.dbt_bigquery.bigquery__create_view_as": {"unique_id": "macro.dbt_bigquery.bigquery__create_view_as", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_view_as", "macro_sql": "{% macro bigquery__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create or replace view {{ relation }}\n {{ bigquery_view_options(config, model) }}\n as {{ sql }};\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_view_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.6870332, "supported_languages": null}, "macro.dbt_bigquery.bigquery__drop_schema": {"unique_id": "macro.dbt_bigquery.bigquery__drop_schema", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__drop_schema", "macro_sql": "{% macro bigquery__drop_schema(relation) -%}\n {{ adapter.drop_schema(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.68716, "supported_languages": null}, "macro.dbt_bigquery.bigquery__drop_relation": {"unique_id": "macro.dbt_bigquery.bigquery__drop_relation", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__drop_relation", "macro_sql": "{% macro bigquery__drop_relation(relation) -%}\n {% call statement('drop_relation') -%}\n drop {{ relation.type }} if exists {{ relation }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.687344, "supported_languages": null}, "macro.dbt_bigquery.bigquery__get_columns_in_relation": {"unique_id": "macro.dbt_bigquery.bigquery__get_columns_in_relation", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__get_columns_in_relation", "macro_sql": "{% macro bigquery__get_columns_in_relation(relation) -%}\n {{ return(adapter.get_columns_in_relation(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.687489, "supported_languages": null}, "macro.dbt_bigquery.bigquery__list_relations_without_caching": {"unique_id": "macro.dbt_bigquery.bigquery__list_relations_without_caching", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__list_relations_without_caching", "macro_sql": "{% macro bigquery__list_relations_without_caching(schema_relation) -%}\n {{ return(adapter.list_relations_without_caching(schema_relation)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.687644, "supported_languages": null}, "macro.dbt_bigquery.bigquery__list_schemas": {"unique_id": "macro.dbt_bigquery.bigquery__list_schemas", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__list_schemas", "macro_sql": "{% macro bigquery__list_schemas(database) -%}\n {{ return(adapter.list_schemas(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.6877902, "supported_languages": null}, "macro.dbt_bigquery.bigquery__check_schema_exists": {"unique_id": "macro.dbt_bigquery.bigquery__check_schema_exists", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__check_schema_exists", "macro_sql": "{% macro bigquery__check_schema_exists(information_schema, schema) %}\n {{ return(adapter.check_schema_exists(information_schema.database, schema)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.687965, "supported_languages": null}, "macro.dbt_bigquery.bigquery__persist_docs": {"unique_id": "macro.dbt_bigquery.bigquery__persist_docs", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__persist_docs", "macro_sql": "{% macro bigquery__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do alter_column_comment(relation, model.columns) %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.688352, "supported_languages": null}, "macro.dbt_bigquery.bigquery__alter_column_comment": {"unique_id": "macro.dbt_bigquery.bigquery__alter_column_comment", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_column_comment", "macro_sql": "{% macro bigquery__alter_column_comment(relation, column_dict) -%}\n {% do adapter.update_columns(relation, column_dict) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.688504, "supported_languages": null}, "macro.dbt_bigquery.bigquery__rename_relation": {"unique_id": "macro.dbt_bigquery.bigquery__rename_relation", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__rename_relation", "macro_sql": "{% macro bigquery__rename_relation(from_relation, to_relation) -%}\n {% do adapter.rename_relation(from_relation, to_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.68865, "supported_languages": null}, "macro.dbt_bigquery.bigquery__alter_relation_add_columns": {"unique_id": "macro.dbt_bigquery.bigquery__alter_relation_add_columns", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_relation_add_columns", "macro_sql": "{% macro bigquery__alter_relation_add_columns(relation, add_columns) %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation }}\n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {{ return(run_query(sql)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.689025, "supported_languages": null}, "macro.dbt_bigquery.bigquery__alter_relation_drop_columns": {"unique_id": "macro.dbt_bigquery.bigquery__alter_relation_drop_columns", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_relation_drop_columns", "macro_sql": "{% macro bigquery__alter_relation_drop_columns(relation, drop_columns) %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation }}\n\n {% for column in drop_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {{ return(run_query(sql)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.689394, "supported_languages": null}, "macro.dbt_bigquery.bigquery__alter_column_type": {"unique_id": "macro.dbt_bigquery.bigquery__alter_column_type", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_column_type", "macro_sql": "{% macro bigquery__alter_column_type(relation, column_name, new_column_type) -%}\n {#-- Changing a column's data type using a query requires you to scan the entire table.\n The query charges can be significant if the table is very large.\n\n https://cloud.google.com/bigquery/docs/manually-changing-schemas#changing_a_columns_data_type\n #}\n {% set relation_columns = get_columns_in_relation(relation) %}\n\n {% set sql %}\n select\n {%- for col in relation_columns -%}\n {% if col.column == column_name %}\n CAST({{ col.quoted }} AS {{ new_column_type }}) AS {{ col.quoted }}\n {%- else %}\n {{ col.quoted }}\n {%- endif %}\n {%- if not loop.last %},{% endif -%}\n {%- endfor %}\n from {{ relation }}\n {% endset %}\n\n {% call statement('alter_column_type') %}\n {{ create_table_as(False, relation, sql)}}\n {%- endcall %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_columns_in_relation", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.6900349, "supported_languages": null}, "macro.dbt_bigquery.bigquery__test_unique": {"unique_id": "macro.dbt_bigquery.bigquery__test_unique", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__test_unique", "macro_sql": "{% macro bigquery__test_unique(model, column_name) %}\n\nwith dbt_test__target as (\n\n select {{ column_name }} as unique_field\n from {{ model }}\n where {{ column_name }} is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.69021, "supported_languages": null}, "macro.dbt_bigquery.bigquery__upload_file": {"unique_id": "macro.dbt_bigquery.bigquery__upload_file", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__upload_file", "macro_sql": "{% macro bigquery__upload_file(local_file_path, database, table_schema, table_name) %}\n\n {{ log(\"kwargs: \" ~ kwargs) }}\n\n {% do adapter.upload_file(local_file_path, database, table_schema, table_name, kwargs=kwargs) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.690479, "supported_languages": null}, "macro.dbt_bigquery.bigquery__create_csv_table": {"unique_id": "macro.dbt_bigquery.bigquery__create_csv_table", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__create_csv_table", "macro_sql": "{% macro bigquery__create_csv_table(model, agate_table) %}\n -- no-op\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.6909702, "supported_languages": null}, "macro.dbt_bigquery.bigquery__reset_csv_table": {"unique_id": "macro.dbt_bigquery.bigquery__reset_csv_table", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__reset_csv_table", "macro_sql": "{% macro bigquery__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.691125, "supported_languages": null}, "macro.dbt_bigquery.bigquery__load_csv_rows": {"unique_id": "macro.dbt_bigquery.bigquery__load_csv_rows", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__load_csv_rows", "macro_sql": "{% macro bigquery__load_csv_rows(model, agate_table) %}\n\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {{ adapter.load_dataframe(model['database'], model['schema'], model['alias'],\n \t\t\t\t\t\t\tagate_table, column_override) }}\n {% if config.persist_relation_docs() and 'description' in model %}\n\n \t{{ adapter.update_table_description(model['database'], model['schema'], model['alias'], model['description']) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.691707, "supported_languages": null}, "macro.dbt_bigquery.bigquery__handle_existing_table": {"unique_id": "macro.dbt_bigquery.bigquery__handle_existing_table", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/view.sql", "original_file_path": "macros/materializations/view.sql", "name": "bigquery__handle_existing_table", "macro_sql": "{% macro bigquery__handle_existing_table(full_refresh, old_relation) %}\n {%- if full_refresh -%}\n {{ adapter.drop_relation(old_relation) }}\n {%- else -%}\n {{ exceptions.relation_wrong_type(old_relation, 'view') }}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.692307, "supported_languages": null}, "macro.dbt_bigquery.materialization_view_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_view_bigquery", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/view.sql", "original_file_path": "macros/materializations/view.sql", "name": "materialization_view_bigquery", "macro_sql": "{% materialization view, adapter='bigquery' -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {% set to_return = create_or_replace_view() %}\n\n {% set target_relation = this.incorporate(type='view') %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if config.get('grant_access_to') %}\n {% for grant_target_dict in config.get('grant_access_to') %}\n {% do adapter.grant_access_to(this, 'view', None, grant_target_dict) %}\n {% endfor %}\n {% endif %}\n\n {% do return(to_return) %}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_or_replace_view", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.6929522, "supported_languages": ["sql"]}, "macro.dbt_bigquery.materialization_table_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_table_bigquery", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "name": "materialization_table_bigquery", "macro_sql": "{% materialization table, adapter='bigquery', supported_languages=['sql', 'python']-%}\n\n {%- set language = model['language'] -%}\n {%- set identifier = model['alias'] -%}\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_not_as_table = (old_relation is not none and not old_relation.is_table) -%}\n {%- set target_relation = api.Relation.create(database=database, schema=schema, identifier=identifier, type='table') -%}\n\n -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\n\n {{ run_hooks(pre_hooks) }}\n\n {#\n We only need to drop this thing if it is not a table.\n If it _is_ already a table, then we can overwrite it without downtime\n Unlike table -> view, no need for `--full-refresh`: dropping a view is no big deal\n #}\n {%- if exists_not_as_table -%}\n {{ adapter.drop_relation(old_relation) }}\n {%- endif -%}\n\n -- build model\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set partition_by = adapter.parse_partition_by(raw_partition_by) -%}\n {%- set cluster_by = config.get('cluster_by', none) -%}\n {% if not adapter.is_replaceable(old_relation, partition_by, cluster_by) %}\n {% do log(\"Hard refreshing \" ~ old_relation ~ \" because it is not replaceable\") %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n\n -- build model\n {%- call statement('main', language=language) -%}\n {{ create_table_as(False, target_relation, compiled_code, language) }}\n {%- endcall -%}\n\n {{ run_hooks(post_hooks) }}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.696316, "supported_languages": ["sql", "python"]}, "macro.dbt_bigquery.py_write_table": {"unique_id": "macro.dbt_bigquery.py_write_table", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "name": "py_write_table", "macro_sql": "{% macro py_write_table(compiled_code, target_relation) %}\nfrom pyspark.sql import SparkSession\n\nspark = SparkSession.builder.appName('smallTest').getOrCreate()\n\nspark.conf.set(\"viewsEnabled\",\"true\")\nspark.conf.set(\"temporaryGcsBucket\",\"{{target.gcs_bucket}}\")\n\n{{ compiled_code }}\ndbt = dbtObj(spark.read.format(\"bigquery\").load)\ndf = model(dbt, spark)\n\n# COMMAND ----------\n# this is materialization code dbt generated, please do not modify\n\nimport pyspark\n# make sure pandas exists before using it\ntry:\n import pandas\n pandas_available = True\nexcept ImportError:\n pandas_available = False\n\n# make sure pyspark.pandas exists before using it\ntry:\n import pyspark.pandas\n pyspark_pandas_api_available = True\nexcept ImportError:\n pyspark_pandas_api_available = False\n\n# make sure databricks.koalas exists before using it\ntry:\n import databricks.koalas\n koalas_available = True\nexcept ImportError:\n koalas_available = False\n\n# preferentially convert pandas DataFrames to pandas-on-Spark or Koalas DataFrames first\n# since they know how to convert pandas DataFrames better than `spark.createDataFrame(df)`\n# and converting from pandas-on-Spark to Spark DataFrame has no overhead\nif pyspark_pandas_api_available and pandas_available and isinstance(df, pandas.core.frame.DataFrame):\n df = pyspark.pandas.frame.DataFrame(df)\nelif koalas_available and pandas_available and isinstance(df, pandas.core.frame.DataFrame):\n df = databricks.koalas.frame.DataFrame(df)\n\n# convert to pyspark.sql.dataframe.DataFrame\nif isinstance(df, pyspark.sql.dataframe.DataFrame):\n pass # since it is already a Spark DataFrame\nelif pyspark_pandas_api_available and isinstance(df, pyspark.pandas.frame.DataFrame):\n df = df.to_spark()\nelif koalas_available and isinstance(df, databricks.koalas.frame.DataFrame):\n df = df.to_spark()\nelif pandas_available and isinstance(df, pandas.core.frame.DataFrame):\n df = spark.createDataFrame(df)\nelse:\n msg = f\"{type(df)} is not a supported type for dbt Python materialization\"\n raise Exception(msg)\n\ndf.write \\\n .mode(\"overwrite\") \\\n .format(\"bigquery\") \\\n .option(\"writeMethod\", \"direct\").option(\"writeDisposition\", 'WRITE_TRUNCATE') \\\n .save(\"{{target_relation}}\")\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.696722, "supported_languages": null}, "macro.dbt_bigquery.materialization_copy_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_copy_bigquery", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/copy.sql", "original_file_path": "macros/materializations/copy.sql", "name": "materialization_copy_bigquery", "macro_sql": "{% materialization copy, adapter='bigquery' -%}\n\n {# Setup #}\n {{ run_hooks(pre_hooks) }}\n\n {% set destination = this.incorporate(type='table') %}\n\n {# there can be several ref() or source() according to BQ copy API docs #}\n {# cycle over ref() and source() to create source tables array #}\n {% set source_array = [] %}\n {% for ref_table in model.refs %}\n {{ source_array.append(ref(*ref_table)) }}\n {% endfor %}\n\n {% for src_table in model.sources %}\n {{ source_array.append(source(*src_table)) }}\n {% endfor %}\n\n {# Call adapter copy_table function #}\n {%- set result_str = adapter.copy_table(\n source_array,\n destination,\n config.get('copy_materialization', default = 'table')) -%}\n\n {{ store_result('main', response=result_str) }}\n\n {# Clean up #}\n {{ run_hooks(post_hooks) }}\n {%- do apply_grants(target_relation, grant_config) -%}\n {{ adapter.commit() }}\n\n {{ return({'relations': [destination]}) }}\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.698048, "supported_languages": ["sql"]}, "macro.dbt_bigquery.declare_dbt_max_partition": {"unique_id": "macro.dbt_bigquery.declare_dbt_max_partition", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "declare_dbt_max_partition", "macro_sql": "{% macro declare_dbt_max_partition(relation, partition_by, complied_code, language='sql') %}\n\n {#-- TODO: revisit partitioning with python models --#}\n {%- if '_dbt_max_partition' in complied_code and language == 'sql' -%}\n\n declare _dbt_max_partition {{ partition_by.data_type }} default (\n select max({{ partition_by.field }}) from {{ this }}\n where {{ partition_by.field }} is not null\n );\n\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.700427, "supported_languages": null}, "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy": {"unique_id": "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "dbt_bigquery_validate_get_incremental_strategy", "macro_sql": "{% macro dbt_bigquery_validate_get_incremental_strategy(config) %}\n {#-- Find and validate the incremental strategy #}\n {%- set strategy = config.get(\"incremental_strategy\") or '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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.700916, "supported_languages": null}, "macro.dbt_bigquery.bq_insert_overwrite": {"unique_id": "macro.dbt_bigquery.bq_insert_overwrite", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "bq_insert_overwrite", "macro_sql": "{% macro bq_insert_overwrite(\n tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n) %}\n\n {% if partitions is not none and partitions != [] %} {# static #}\n\n {% set predicate -%}\n {{ partition_by.render(alias='DBT_INTERNAL_DEST') }} in (\n {{ partitions | join (', ') }}\n )\n {%- endset %}\n\n {%- set source_sql -%}\n (\n {{sql}}\n )\n {%- endset -%}\n\n {#-- Because we're putting the model SQL _directly_ into the MERGE statement,\n we need to prepend the MERGE statement with the user-configured sql_header,\n which may be needed to resolve that model SQL (e.g. referencing a variable or UDF in the header)\n in the \"dynamic\" case, we save the model SQL result as a temp table first, wherein the\n sql_header is included by the create_table_as macro.\n #}\n {{ get_insert_overwrite_merge_sql(target_relation, source_sql, dest_columns, [predicate], include_sql_header=true) }}\n\n {% else %} {# dynamic #}\n\n {% set predicate -%}\n {{ partition_by.render(alias='DBT_INTERNAL_DEST') }} in unnest(dbt_partitions_for_replacement)\n {%- endset %}\n\n {%- set source_sql -%}\n (\n select * from {{ tmp_relation }}\n )\n {%- endset -%}\n\n -- generated script to merge partitions into {{ target_relation }}\n declare dbt_partitions_for_replacement array<{{ partition_by.data_type }}>;\n\n {# have we already created the temp table to check for schema changes? #}\n {% if not tmp_relation_exists %}\n {{ declare_dbt_max_partition(this, partition_by, sql) }}\n\n -- 1. create a temp table\n {{ create_table_as(True, tmp_relation, compiled_code) }}\n {% else %}\n -- 1. temp table already exists, we used it to check for schema changes\n {% endif %}\n\n -- 2. define partitions to update\n set (dbt_partitions_for_replacement) = (\n select as struct\n array_agg(distinct {{ partition_by.render() }})\n from {{ tmp_relation }}\n );\n\n -- 3. run the merge statement\n {{ get_insert_overwrite_merge_sql(target_relation, source_sql, dest_columns, [predicate]) }};\n\n -- 4. clean up the temp table\n drop table if exists {{ tmp_relation }}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql", "macro.dbt_bigquery.declare_dbt_max_partition", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.702147, "supported_languages": null}, "macro.dbt_bigquery.bq_generate_incremental_build_sql": {"unique_id": "macro.dbt_bigquery.bq_generate_incremental_build_sql", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "bq_generate_incremental_build_sql", "macro_sql": "{% macro bq_generate_incremental_build_sql(\n strategy, tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n) %}\n {#-- if partitioned, use BQ scripting to get the range of partition values to be updated --#}\n {% if strategy == 'insert_overwrite' %}\n\n {% set missing_partition_msg -%}\n The 'insert_overwrite' strategy requires the `partition_by` config.\n {%- endset %}\n {% if partition_by is none %}\n {% do exceptions.raise_compiler_error(missing_partition_msg) %}\n {% endif %}\n\n {% set build_sql = bq_insert_overwrite(\n tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n ) %}\n\n {% else %} {# strategy == 'merge' #}\n {%- set source_sql -%}\n {%- if tmp_relation_exists -%}\n (\n select * from {{ tmp_relation }}\n )\n {%- else -%} {#-- wrap sql in parens to make it a subquery --#}\n (\n {{sql}}\n )\n {%- endif -%}\n {%- endset -%}\n\n {% set build_sql = get_merge_sql(target_relation, source_sql, unique_key, dest_columns) %}\n\n {% endif %}\n\n {{ return(build_sql) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bq_insert_overwrite", "macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7029812, "supported_languages": null}, "macro.dbt_bigquery.materialization_incremental_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_incremental_bigquery", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "materialization_incremental_bigquery", "macro_sql": "{% materialization incremental, adapter='bigquery', supported_languages=['sql', 'python'] -%}\n\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n {%- set language = model['language'] %}\n\n {%- set target_relation = this %}\n {%- set existing_relation = load_relation(this) %}\n {%- set tmp_relation = make_temp_relation(this) %}\n\n {#-- Validate early so we don't run SQL if the strategy is invalid --#}\n {% set strategy = dbt_bigquery_validate_get_incremental_strategy(config) -%}\n\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set partition_by = adapter.parse_partition_by(raw_partition_by) -%}\n {%- set partitions = config.get('partitions', none) -%}\n {%- set cluster_by = config.get('cluster_by', none) -%}\n\n {% set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') %}\n\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n {% if existing_relation is none %}\n {%- call statement('main', language=language) -%}\n {{ create_table_as(False, target_relation, compiled_code, language) }}\n {%- endcall -%}\n\n {% elif existing_relation.is_view %}\n {#-- There's no way to atomically replace a view with a table on BQ --#}\n {{ adapter.drop_relation(existing_relation) }}\n {%- call statement('main', language=language) -%}\n {{ create_table_as(False, target_relation, compiled_code, language) }}\n {%- endcall -%}\n\n {% elif full_refresh_mode %}\n {#-- If the partition/cluster config has changed, then we must drop and recreate --#}\n {% if not adapter.is_replaceable(existing_relation, partition_by, cluster_by) %}\n {% do log(\"Hard refreshing \" ~ existing_relation ~ \" because it is not replaceable\") %}\n {{ adapter.drop_relation(existing_relation) }}\n {% endif %}\n {%- call statement('main', language=language) -%}\n {{ create_table_as(False, target_relation, compiled_code, language) }}\n {%- endcall -%}\n\n {% else %}\n {%- if language == 'python' and strategy == 'insert_overwrite' -%}\n {#-- This lets us move forward assuming no python will be directly templated into a query --#}\n {%- set python_unsupported_msg -%}\n The 'insert_overwrite' strategy is not yet supported for python models.\n {%- endset %}\n {% do exceptions.raise_compiler_error(python_unsupported_msg) %}\n {%- endif -%}\n\n {% set tmp_relation_exists = false %}\n {% if on_schema_change != 'ignore' or language == 'python' %}\n {#-- Check first, since otherwise we may not build a temp table --#}\n {#-- Python always needs to create a temp table --#}\n {%- call statement('create_tmp_relation', language=language) -%}\n {{ declare_dbt_max_partition(this, partition_by, compiled_code, language) +\n create_table_as(True, tmp_relation, compiled_code, language)\n }}\n {%- endcall -%}\n {% set tmp_relation_exists = true %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, tmp_relation, existing_relation) %}\n {% endif %}\n\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n {% set build_sql = bq_generate_incremental_build_sql(\n strategy, tmp_relation, target_relation, compiled_code, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n ) %}\n\n {%- call statement('main') -%}\n {{ build_sql }}\n {% endcall %}\n\n {%- if language == 'python' and tmp_relation -%}\n {{ adapter.drop_relation(tmp_relation) }}\n {%- endif -%}\n\n {% endif %}\n\n {{ run_hooks(post_hooks) }}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.load_relation", "macro.dbt.make_temp_relation", "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt_bigquery.declare_dbt_max_partition", "macro.dbt.process_schema_changes", "macro.dbt_bigquery.bq_generate_incremental_build_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.70636, "supported_languages": ["sql", "python"]}, "macro.dbt_bigquery.bigquery__snapshot_hash_arguments": {"unique_id": "macro.dbt_bigquery.bigquery__snapshot_hash_arguments", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__snapshot_hash_arguments", "macro_sql": "{% macro bigquery__snapshot_hash_arguments(args) -%}\n to_hex(md5(concat({%- for arg in args -%}\n coalesce(cast({{ arg }} as string), ''){% if not loop.last %}, '|',{% endif -%}\n {%- endfor -%}\n )))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.70694, "supported_languages": null}, "macro.dbt_bigquery.bigquery__create_columns": {"unique_id": "macro.dbt_bigquery.bigquery__create_columns", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__create_columns", "macro_sql": "{% macro bigquery__create_columns(relation, columns) %}\n {{ adapter.alter_table_add_columns(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.707094, "supported_languages": null}, "macro.dbt_bigquery.bigquery__post_snapshot": {"unique_id": "macro.dbt_bigquery.bigquery__post_snapshot", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__post_snapshot", "macro_sql": "{% macro bigquery__post_snapshot(staging_relation) %}\n -- Clean up the snapshot temp table\n {% do drop_relation(staging_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.707221, "supported_languages": null}, "macro.dbt_bigquery.bigquery__except": {"unique_id": "macro.dbt_bigquery.bigquery__except", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "name": "bigquery__except", "macro_sql": "{% macro bigquery__except() %}\n\n except distinct\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7073889, "supported_languages": null}, "macro.dbt_bigquery.bigquery__dateadd": {"unique_id": "macro.dbt_bigquery.bigquery__dateadd", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "name": "bigquery__dateadd", "macro_sql": "{% macro bigquery__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n datetime_add(\n cast( {{ from_date_or_timestamp }} as datetime),\n interval {{ interval }} {{ datepart }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7076669, "supported_languages": null}, "macro.dbt_bigquery.bigquery__current_timestamp": {"unique_id": "macro.dbt_bigquery.bigquery__current_timestamp", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/timestamps.sql", "original_file_path": "macros/utils/timestamps.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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7078872, "supported_languages": null}, "macro.dbt_bigquery.bigquery__snapshot_string_as_time": {"unique_id": "macro.dbt_bigquery.bigquery__snapshot_string_as_time", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/timestamps.sql", "original_file_path": "macros/utils/timestamps.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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7080588, "supported_languages": null}, "macro.dbt_bigquery.bigquery__current_timestamp_backcompat": {"unique_id": "macro.dbt_bigquery.bigquery__current_timestamp_backcompat", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/timestamps.sql", "original_file_path": "macros/utils/timestamps.sql", "name": "bigquery__current_timestamp_backcompat", "macro_sql": "{% macro bigquery__current_timestamp_backcompat() -%}\n current_timestamp\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7081301, "supported_languages": null}, "macro.dbt_bigquery.bigquery__intersect": {"unique_id": "macro.dbt_bigquery.bigquery__intersect", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "name": "bigquery__intersect", "macro_sql": "{% macro bigquery__intersect() %}\n\n intersect distinct\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7082932, "supported_languages": null}, "macro.dbt_bigquery.bigquery__escape_single_quotes": {"unique_id": "macro.dbt_bigquery.bigquery__escape_single_quotes", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "name": "bigquery__escape_single_quotes", "macro_sql": "{% macro bigquery__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\", \"\\\\'\") }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.708552, "supported_languages": null}, "macro.dbt_bigquery.bigquery__right": {"unique_id": "macro.dbt_bigquery.bigquery__right", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "name": "bigquery__right", "macro_sql": "{% macro bigquery__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0\n then ''\n else\n substr(\n {{ string_text }},\n -1 * ({{ length_expression }})\n )\n end\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.708836, "supported_languages": null}, "macro.dbt_bigquery.bigquery__listagg": {"unique_id": "macro.dbt_bigquery.bigquery__listagg", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "name": "bigquery__listagg", "macro_sql": "{% macro bigquery__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n string_agg(\n {{ measure }},\n {{ delimiter_text }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n {% if limit_num -%}\n limit {{ limit_num }}\n {%- endif %}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.709281, "supported_languages": null}, "macro.dbt_bigquery.bigquery__datediff": {"unique_id": "macro.dbt_bigquery.bigquery__datediff", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "name": "bigquery__datediff", "macro_sql": "{% macro bigquery__datediff(first_date, second_date, datepart) -%}\n\n {% if dbt_version[0] == 1 and dbt_version[2] >= 2 %}\n {{ return(dbt.datediff(first_date, second_date, datepart)) }}\n {% else %}\n\n datetime_diff(\n cast({{second_date}} as datetime),\n cast({{first_date}} as datetime),\n {{datepart}}\n )\n\n {% endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.709811, "supported_languages": null}, "macro.dbt_bigquery.bigquery__safe_cast": {"unique_id": "macro.dbt_bigquery.bigquery__safe_cast", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "name": "bigquery__safe_cast", "macro_sql": "{% macro bigquery__safe_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.710034, "supported_languages": null}, "macro.dbt_bigquery.bigquery__hash": {"unique_id": "macro.dbt_bigquery.bigquery__hash", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "name": "bigquery__hash", "macro_sql": "{% macro bigquery__hash(field) -%}\n to_hex({{dbt.default__hash(field)}})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.710263, "supported_languages": null}, "macro.dbt_bigquery.bigquery__position": {"unique_id": "macro.dbt_bigquery.bigquery__position", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "name": "bigquery__position", "macro_sql": "{% macro bigquery__position(substring_text, string_text) %}\n\n strpos(\n {{ string_text }},\n {{ substring_text }}\n\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.710488, "supported_languages": null}, "macro.dbt_bigquery.bigquery__array_concat": {"unique_id": "macro.dbt_bigquery.bigquery__array_concat", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "name": "bigquery__array_concat", "macro_sql": "{% macro bigquery__array_concat(array_1, array_2) -%}\n array_concat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.710706, "supported_languages": null}, "macro.dbt_bigquery.bigquery__bool_or": {"unique_id": "macro.dbt_bigquery.bigquery__bool_or", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "name": "bigquery__bool_or", "macro_sql": "{% macro bigquery__bool_or(expression) -%}\n\n logical_or({{ expression }})\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.71089, "supported_languages": null}, "macro.dbt_bigquery.bigquery__split_part": {"unique_id": "macro.dbt_bigquery.bigquery__split_part", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "name": "bigquery__split_part", "macro_sql": "{% macro bigquery__split_part(string_text, delimiter_text, part_number) %}\n\n {% if part_number >= 0 %}\n split(\n {{ string_text }},\n {{ delimiter_text }}\n )[safe_offset({{ part_number - 1 }})]\n {% else %}\n split(\n {{ string_text }},\n {{ delimiter_text }}\n )[safe_offset(\n length({{ string_text }})\n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 1\n )]\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.711534, "supported_languages": null}, "macro.dbt_bigquery.bigquery__date_trunc": {"unique_id": "macro.dbt_bigquery.bigquery__date_trunc", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "name": "bigquery__date_trunc", "macro_sql": "{% macro bigquery__date_trunc(datepart, date) -%}\n timestamp_trunc(\n cast({{date}} as timestamp),\n {{datepart}}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.711763, "supported_languages": null}, "macro.dbt_bigquery.bigquery__array_construct": {"unique_id": "macro.dbt_bigquery.bigquery__array_construct", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "name": "bigquery__array_construct", "macro_sql": "{% macro bigquery__array_construct(inputs, data_type) -%}\n {% if inputs|length > 0 %}\n [ {{ inputs|join(' , ') }} ]\n {% else %}\n ARRAY<{{data_type}}>[]\n {% endif %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.712123, "supported_languages": null}, "macro.dbt_bigquery.bigquery__array_append": {"unique_id": "macro.dbt_bigquery.bigquery__array_append", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "name": "bigquery__array_append", "macro_sql": "{% macro bigquery__array_append(array, new_element) -%}\n {{ array_concat(array, array_construct([new_element])) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.array_concat", "macro.dbt.array_construct"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.712379, "supported_languages": null}, "macro.dbt_bigquery.bigquery__get_show_grant_sql": {"unique_id": "macro.dbt_bigquery.bigquery__get_show_grant_sql", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "bigquery__get_show_grant_sql", "macro_sql": "{% macro bigquery__get_show_grant_sql(relation) %}\n {% set location = adapter.get_dataset_location(relation) %}\n {% set relation = relation.incorporate(location=location) %}\n\n select privilege_type, grantee\n from {{ relation.information_schema(\"OBJECT_PRIVILEGES\") }}\n where object_schema = \"{{ relation.dataset }}\"\n and object_name = \"{{ relation.identifier }}\"\n -- filter out current user\n and split(grantee, ':')[offset(1)] != session_user()\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7130392, "supported_languages": null}, "macro.dbt_bigquery.bigquery__get_grant_sql": {"unique_id": "macro.dbt_bigquery.bigquery__get_grant_sql", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "bigquery__get_grant_sql", "macro_sql": "\n\n\n{%- macro bigquery__get_grant_sql(relation, privilege, grantee) -%}\n grant `{{ privilege }}` on {{ relation.type }} {{ relation }} to {{ '\\\"' + grantee|join('\\\", \\\"') + '\\\"' }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.713273, "supported_languages": null}, "macro.dbt_bigquery.bigquery__get_revoke_sql": {"unique_id": "macro.dbt_bigquery.bigquery__get_revoke_sql", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "bigquery__get_revoke_sql", "macro_sql": "{%- macro bigquery__get_revoke_sql(relation, privilege, grantee) -%}\n revoke `{{ privilege }}` on {{ relation.type }} {{ relation }} from {{ '\\\"' + grantee|join('\\\", \\\"') + '\\\"' }}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.713514, "supported_languages": null}, "macro.dbt.run_hooks": {"unique_id": "macro.dbt.run_hooks", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.714599, "supported_languages": null}, "macro.dbt.make_hook_config": {"unique_id": "macro.dbt.make_hook_config", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7147892, "supported_languages": null}, "macro.dbt.before_begin": {"unique_id": "macro.dbt.before_begin", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7149272, "supported_languages": null}, "macro.dbt.in_transaction": {"unique_id": "macro.dbt.in_transaction", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.715064, "supported_languages": null}, "macro.dbt.after_commit": {"unique_id": "macro.dbt.after_commit", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.71525, "supported_languages": null}, "macro.dbt.set_sql_header": {"unique_id": "macro.dbt.set_sql_header", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.715743, "supported_languages": null}, "macro.dbt.should_full_refresh": {"unique_id": "macro.dbt.should_full_refresh", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7160509, "supported_languages": null}, "macro.dbt.should_store_failures": {"unique_id": "macro.dbt.should_store_failures", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7163541, "supported_languages": null}, "macro.dbt.snapshot_merge_sql": {"unique_id": "macro.dbt.snapshot_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "name": "snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.716846, "supported_languages": null}, "macro.dbt.default__snapshot_merge_sql": {"unique_id": "macro.dbt.default__snapshot_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "name": "default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.dbt_scd_id = DBT_INTERNAL_DEST.dbt_scd_id\n\n when matched\n and DBT_INTERNAL_DEST.dbt_valid_to is null\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.717129, "supported_languages": null}, "macro.dbt.strategy_dispatch": {"unique_id": "macro.dbt.strategy_dispatch", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "strategy_dispatch", "macro_sql": "{% macro strategy_dispatch(name) -%}\n{% set original_name = name %}\n {% if '.' in name %}\n {% set package_name, name = name.split(\".\", 1) %}\n {% else %}\n {% set package_name = none %}\n {% endif %}\n\n {% if package_name is none %}\n {% set package_context = context %}\n {% elif package_name in context %}\n {% set package_context = context[package_name] %}\n {% else %}\n {% set error_msg %}\n Could not find package '{{package_name}}', called with '{{original_name}}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n\n {%- set search_name = 'snapshot_' ~ name ~ '_strategy' -%}\n\n {% if search_name not in package_context %}\n {% set error_msg %}\n The specified strategy macro '{{name}}' was not found in package '{{ package_name }}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n {{ return(package_context[search_name]) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.720622, "supported_languages": null}, "macro.dbt.snapshot_hash_arguments": {"unique_id": "macro.dbt.snapshot_hash_arguments", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments', 'dbt')(args) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.720798, "supported_languages": null}, "macro.dbt.default__snapshot_hash_arguments": {"unique_id": "macro.dbt.default__snapshot_hash_arguments", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "default__snapshot_hash_arguments", "macro_sql": "{% macro default__snapshot_hash_arguments(args) -%}\n md5({%- for arg in args -%}\n coalesce(cast({{ arg }} as varchar ), '')\n {% if not loop.last %} || '|' || {% endif %}\n {%- endfor -%})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.721014, "supported_languages": null}, "macro.dbt.snapshot_timestamp_strategy": {"unique_id": "macro.dbt.snapshot_timestamp_strategy", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_timestamp_strategy", "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set primary_key = config['unique_key'] %}\n {% set updated_at = config['updated_at'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/dbt-labs/dbt-core/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.dbt_valid_from < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.721717, "supported_languages": null}, "macro.dbt.snapshot_string_as_time": {"unique_id": "macro.dbt.snapshot_string_as_time", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time', 'dbt')(timestamp) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.721876, "supported_languages": null}, "macro.dbt.default__snapshot_string_as_time": {"unique_id": "macro.dbt.default__snapshot_string_as_time", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "default__snapshot_string_as_time", "macro_sql": "{% macro default__snapshot_string_as_time(timestamp) %}\n {% do exceptions.raise_not_implemented(\n 'snapshot_string_as_time macro not implemented for adapter '+adapter.type()\n ) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.722045, "supported_languages": null}, "macro.dbt.snapshot_check_all_get_existing_columns": {"unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) -%}\n {%- if not target_exists -%}\n {#-- no table yet -> return whatever the query does --#}\n {{ return((false, query_columns)) }}\n {%- endif -%}\n\n {#-- handle any schema changes --#}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=node.alias) -%}\n\n {% if check_cols_config == 'all' %}\n {%- set query_columns = get_columns_in_query(node['compiled_code']) -%}\n\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {#-- query for proper casing/quoting, to support comparison below --#}\n {%- set select_check_cols_from_target -%}\n select {{ check_cols_config | join(', ') }} from ({{ node['compiled_code'] }}) subq\n {%- endset -%}\n {% set query_columns = get_columns_in_query(select_check_cols_from_target) %}\n\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set existing_cols = adapter.get_columns_in_relation(target_relation) | map(attribute = 'name') | list -%}\n {%- set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(adapter.quote(col)) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return((ns.column_added, intersection)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.723435, "supported_languages": null}, "macro.dbt.snapshot_check_strategy": {"unique_id": "macro.dbt.snapshot_check_strategy", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set check_cols_config = config['check_cols'] %}\n {% set primary_key = config['unique_key'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n {% set updated_at = config.get('updated_at', snapshot_get_time()) %}\n\n {% set column_added = false %}\n\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n {{ get_true_sql() }}\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.get_true_sql", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.724736, "supported_languages": null}, "macro.dbt.create_columns": {"unique_id": "macro.dbt.create_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns', 'dbt')(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7285812, "supported_languages": null}, "macro.dbt.default__create_columns": {"unique_id": "macro.dbt.default__create_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation }} add column \"{{ column.name }}\" {{ column.data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.728866, "supported_languages": null}, "macro.dbt.post_snapshot": {"unique_id": "macro.dbt.post_snapshot", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.72903, "supported_languages": null}, "macro.dbt.default__post_snapshot": {"unique_id": "macro.dbt.default__post_snapshot", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7291179, "supported_languages": null}, "macro.dbt.get_true_sql": {"unique_id": "macro.dbt.get_true_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "get_true_sql", "macro_sql": "{% macro get_true_sql() %}\n {{ adapter.dispatch('get_true_sql', 'dbt')() }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_true_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.72926, "supported_languages": null}, "macro.dbt.default__get_true_sql": {"unique_id": "macro.dbt.default__get_true_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__get_true_sql", "macro_sql": "{% macro default__get_true_sql() %}\n {{ return('TRUE') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.729384, "supported_languages": null}, "macro.dbt.snapshot_staging_table": {"unique_id": "macro.dbt.snapshot_staging_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "snapshot_staging_table", "macro_sql": "{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {{ adapter.dispatch('snapshot_staging_table', 'dbt')(strategy, source_sql, target_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_staging_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.729592, "supported_languages": null}, "macro.dbt.default__snapshot_staging_table": {"unique_id": "macro.dbt.default__snapshot_staging_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__snapshot_staging_table", "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *,\n {{ strategy.unique_key }} as dbt_unique_key\n\n from {{ target_relation }}\n where dbt_valid_to is null\n\n ),\n\n insertions_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to,\n {{ strategy.scd_id }} as dbt_scd_id\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n {{ strategy.updated_at }} as dbt_valid_to\n\n from snapshot_query\n ),\n\n {%- if strategy.invalidate_hard_deletes %}\n\n deletes_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from insertions_source_data as source_data\n left outer join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_unique_key is null\n or (\n snapshotted_data.dbt_unique_key is not null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.dbt_scd_id\n\n from updates_source_data as source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where (\n {{ strategy.row_changed }}\n )\n )\n\n {%- if strategy.invalidate_hard_deletes -%}\n ,\n\n deletes as (\n\n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as dbt_valid_from,\n {{ snapshot_get_time() }} as dbt_updated_at,\n {{ snapshot_get_time() }} as dbt_valid_to,\n snapshotted_data.dbt_scd_id\n\n from snapshotted_data\n left join deletes_source_data as source_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where source_data.dbt_unique_key is null\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.invalidate_hard_deletes %}\n union all\n select * from deletes\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.730432, "supported_languages": null}, "macro.dbt.build_snapshot_table": {"unique_id": "macro.dbt.build_snapshot_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) -%}\n {{ adapter.dispatch('build_snapshot_table', 'dbt')(strategy, sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__build_snapshot_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.730618, "supported_languages": null}, "macro.dbt.default__build_snapshot_table": {"unique_id": "macro.dbt.default__build_snapshot_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__build_snapshot_table", "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.730864, "supported_languages": null}, "macro.dbt.build_snapshot_staging_table": {"unique_id": "macro.dbt.build_snapshot_staging_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set temp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, temp_relation, select) }}\n {% endcall %}\n\n {% do return(temp_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.73129, "supported_languages": null}, "macro.dbt.materialization_snapshot_default": {"unique_id": "macro.dbt.materialization_snapshot_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot.sql", "original_file_path": "macros/materializations/snapshots/snapshot.sql", "name": "materialization_snapshot_default", "macro_sql": "{% materialization snapshot, default %}\n {%- set config = model['config'] -%}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\n\n {% set target_relation_exists, target_relation = get_or_create_relation(\n database=model.database,\n schema=model.schema,\n identifier=target_table,\n type='table') -%}\n\n {%- if not target_relation.is_table -%}\n {% do exceptions.relation_wrong_type(target_relation, 'table') %}\n {%- endif -%}\n\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set strategy_macro = strategy_dispatch(strategy_name) %}\n {% set strategy = strategy_macro(model, \"snapshotted_data\", \"source_data\", config, target_relation_exists) %}\n\n {% if not target_relation_exists %}\n\n {% set build_sql = build_snapshot_table(strategy, model['compiled_code']) %}\n {% set final_sql = create_table_as(False, target_relation, build_sql) %}\n\n {% else %}\n\n {{ adapter.valid_snapshot_target(target_relation) }}\n\n {% set staging_table = build_snapshot_staging_table(strategy, sql, target_relation) %}\n\n -- this may no-op if the database does not require column expansion\n {% do adapter.expand_target_column_types(from_relation=staging_table,\n to_relation=target_relation) %}\n\n {% set missing_columns = adapter.get_missing_columns(staging_table, target_relation)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% do create_columns(target_relation, missing_columns) %}\n\n {% set source_columns = adapter.get_columns_in_relation(staging_table)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% set quoted_source_columns = [] %}\n {% for column in source_columns %}\n {% do quoted_source_columns.append(adapter.quote(column.name)) %}\n {% endfor %}\n\n {% set final_sql = snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n %}\n\n {% endif %}\n\n {% call statement('main') %}\n {{ final_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(target_relation_exists, full_refresh_mode=False) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if not target_relation_exists %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if staging_table is defined %}\n {% do post_snapshot(staging_table) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_or_create_relation", "macro.dbt.run_hooks", "macro.dbt.strategy_dispatch", "macro.dbt.build_snapshot_table", "macro.dbt.create_table_as", "macro.dbt.build_snapshot_staging_table", "macro.dbt.create_columns", "macro.dbt.snapshot_merge_sql", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes", "macro.dbt.post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.737076, "supported_languages": ["sql"]}, "macro.dbt.materialization_test_default": {"unique_id": "macro.dbt.materialization_test_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/test.sql", "original_file_path": "macros/materializations/tests/test.sql", "name": "materialization_test_default", "macro_sql": "{%- materialization test, default -%}\n\n {% set relations = [] %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type='table') -%} %}\n\n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n\n {% call statement(auto_begin=True) %}\n {{ create_table_as(False, target_relation, sql) }}\n {% endcall %}\n\n {% do relations.append(target_relation) %}\n\n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n\n {{ adapter.commit() }}\n\n {% else %}\n\n {% set main_sql = sql %}\n\n {% endif %}\n\n {% set limit = config.get('limit') %}\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit)}}\n\n {%- endcall %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7391229, "supported_languages": ["sql"]}, "macro.dbt.get_test_sql": {"unique_id": "macro.dbt.get_test_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "name": "get_test_sql", "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql', 'dbt')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.739626, "supported_languages": null}, "macro.dbt.default__get_test_sql": {"unique_id": "macro.dbt.default__get_test_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "name": "default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.739925, "supported_languages": null}, "macro.dbt.get_where_subquery": {"unique_id": "macro.dbt.get_where_subquery", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "name": "get_where_subquery", "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_where_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.740375, "supported_languages": null}, "macro.dbt.default__get_where_subquery": {"unique_id": "macro.dbt.default__get_where_subquery", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "name": "default__get_where_subquery", "macro_sql": "{% macro default__get_where_subquery(relation) -%}\n {% set where = config.get('where', '') %}\n {% if where %}\n {%- set filtered -%}\n (select * from {{ relation }} where {{ where }}) dbt_subquery\n {%- endset -%}\n {% do return(filtered) %}\n {%- else -%}\n {% do return(relation) %}\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.740768, "supported_languages": null}, "macro.dbt.get_quoted_csv": {"unique_id": "macro.dbt.get_quoted_csv", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\n\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.742374, "supported_languages": null}, "macro.dbt.diff_columns": {"unique_id": "macro.dbt.diff_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "diff_columns", "macro_sql": "{% macro diff_columns(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% set source_names = source_columns | map(attribute = 'column') | list %}\n {% set target_names = target_columns | map(attribute = 'column') | list %}\n\n {# --check whether the name attribute exists in the target - this does not perform a data type check #}\n {% for sc in source_columns %}\n {% if sc.name not in target_names %}\n {{ result.append(sc) }}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.742901, "supported_languages": null}, "macro.dbt.diff_column_data_types": {"unique_id": "macro.dbt.diff_column_data_types", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "diff_column_data_types", "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.data_type != tc.data_type and not sc.can_expand_to(other_column=tc) %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.data_type } ) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7435641, "supported_languages": null}, "macro.dbt.get_merge_update_columns": {"unique_id": "macro.dbt.get_merge_update_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "get_merge_update_columns", "macro_sql": "{% macro get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {{ return(adapter.dispatch('get_merge_update_columns', 'dbt')(merge_update_columns, merge_exclude_columns, dest_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.743807, "supported_languages": null}, "macro.dbt.default__get_merge_update_columns": {"unique_id": "macro.dbt.default__get_merge_update_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "default__get_merge_update_columns", "macro_sql": "{% macro default__get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {%- set default_cols = dest_columns | map(attribute=\"quoted\") | list -%}\n\n {%- if merge_update_columns and merge_exclude_columns -%}\n {{ exceptions.raise_compiler_error(\n 'Model cannot specify merge_update_columns and merge_exclude_columns. Please update model to use only one config'\n )}}\n {%- elif merge_update_columns -%}\n {%- set update_columns = merge_update_columns -%}\n {%- elif merge_exclude_columns -%}\n {%- set update_columns = [] -%}\n {%- for column in dest_columns -%}\n {% if column.column | lower not in merge_exclude_columns | map(\"lower\") | list %}\n {%- do update_columns.append(column.quoted) -%}\n {% endif %}\n {%- endfor -%}\n {%- else -%}\n {%- set update_columns = default_cols -%}\n {%- endif -%}\n\n {{ return(update_columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.744521, "supported_languages": null}, "macro.dbt.get_merge_sql": {"unique_id": "macro.dbt.get_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, predicates=none) -%}\n {{ adapter.dispatch('get_merge_sql', 'dbt')(target, source, unique_key, dest_columns, predicates) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.748619, "supported_languages": null}, "macro.dbt.default__get_merge_sql": {"unique_id": "macro.dbt.default__get_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, predicates) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set merge_update_columns = config.get('merge_update_columns') -%}\n {%- set merge_exclude_columns = config.get('merge_exclude_columns') -%}\n {%- set update_columns = get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not mapping and unique_key is not string %}\n {% for key in unique_key %}\n {% set this_key_match %}\n DBT_INTERNAL_SOURCE.{{ key }} = DBT_INTERNAL_DEST.{{ key }}\n {% endset %}\n {% do predicates.append(this_key_match) %}\n {% endfor %}\n {% else %}\n {% set unique_key_match %}\n DBT_INTERNAL_SOURCE.{{ unique_key }} = DBT_INTERNAL_DEST.{{ unique_key }}\n {% endset %}\n {% do predicates.append(unique_key_match) %}\n {% endif %}\n {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\n\n {{ sql_header if sql_header is not none }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on {{ predicates | join(' and ') }}\n\n {% if unique_key %}\n when matched then update set\n {% for column_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv", "macro.dbt.get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.750189, "supported_languages": null}, "macro.dbt.get_delete_insert_merge_sql": {"unique_id": "macro.dbt.get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql', 'dbt')(target, source, unique_key, dest_columns) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.750422, "supported_languages": null}, "macro.dbt.default__get_delete_insert_merge_sql": {"unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not string %}\n delete from {{target }}\n using {{ source }}\n where (\n {% for key in unique_key %}\n {{ source }}.{{ key }} = {{ target }}.{{ key }}\n {{ \"and \" if not loop.last }}\n {% endfor %}\n );\n {% else %}\n delete from {{ target }}\n where (\n {{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n );\n\n {% endif %}\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.751143, "supported_languages": null}, "macro.dbt.get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql', 'dbt')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.751416, "supported_languages": null}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {#-- The only time include_sql_header is True: --#}\n {#-- BigQuery + insert_overwrite strategy + \"static\" partitions config --#}\n {#-- We should consider including the sql header at the materialization level instead --#}\n\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7520618, "supported_languages": null}, "macro.dbt.is_incremental": {"unique_id": "macro.dbt.is_incremental", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/is_incremental.sql", "original_file_path": "macros/materializations/models/incremental/is_incremental.sql", "name": "is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7527769, "supported_languages": null}, "macro.dbt.get_incremental_append_sql": {"unique_id": "macro.dbt.get_incremental_append_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_append_sql", "macro_sql": "{% macro get_incremental_append_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_append_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.753643, "supported_languages": null}, "macro.dbt.default__get_incremental_append_sql": {"unique_id": "macro.dbt.default__get_incremental_append_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_append_sql", "macro_sql": "{% macro default__get_incremental_append_sql(arg_dict) %}\n\n {% do return(get_insert_into_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_insert_into_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.753876, "supported_languages": null}, "macro.dbt.get_incremental_delete_insert_sql": {"unique_id": "macro.dbt.get_incremental_delete_insert_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_delete_insert_sql", "macro_sql": "{% macro get_incremental_delete_insert_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_delete_insert_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_delete_insert_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.754056, "supported_languages": null}, "macro.dbt.default__get_incremental_delete_insert_sql": {"unique_id": "macro.dbt.default__get_incremental_delete_insert_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_delete_insert_sql", "macro_sql": "{% macro default__get_incremental_delete_insert_sql(arg_dict) %}\n\n {% do return(get_delete_insert_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.754317, "supported_languages": null}, "macro.dbt.get_incremental_merge_sql": {"unique_id": "macro.dbt.get_incremental_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_merge_sql", "macro_sql": "{% macro get_incremental_merge_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.754497, "supported_languages": null}, "macro.dbt.default__get_incremental_merge_sql": {"unique_id": "macro.dbt.default__get_incremental_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_merge_sql", "macro_sql": "{% macro default__get_incremental_merge_sql(arg_dict) %}\n\n {% do return(get_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.75475, "supported_languages": null}, "macro.dbt.get_incremental_insert_overwrite_sql": {"unique_id": "macro.dbt.get_incremental_insert_overwrite_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_insert_overwrite_sql", "macro_sql": "{% macro get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_insert_overwrite_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_insert_overwrite_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.754932, "supported_languages": null}, "macro.dbt.default__get_incremental_insert_overwrite_sql": {"unique_id": "macro.dbt.default__get_incremental_insert_overwrite_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_insert_overwrite_sql", "macro_sql": "{% macro default__get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {% do return(get_insert_overwrite_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"], arg_dict[\"predicates\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.755203, "supported_languages": null}, "macro.dbt.get_incremental_default_sql": {"unique_id": "macro.dbt.get_incremental_default_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_default_sql", "macro_sql": "{% macro get_incremental_default_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_default_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_default_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7553852, "supported_languages": null}, "macro.dbt.default__get_incremental_default_sql": {"unique_id": "macro.dbt.default__get_incremental_default_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_default_sql", "macro_sql": "{% macro default__get_incremental_default_sql(arg_dict) %}\n\n {% do return(get_incremental_append_sql(arg_dict)) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7555299, "supported_languages": null}, "macro.dbt.get_insert_into_sql": {"unique_id": "macro.dbt.get_insert_into_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_insert_into_sql", "macro_sql": "{% macro get_insert_into_sql(target_relation, temp_relation, dest_columns) %}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ temp_relation }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.755795, "supported_languages": null}, "macro.dbt.materialization_incremental_default": {"unique_id": "macro.dbt.materialization_incremental_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/incremental.sql", "original_file_path": "macros/materializations/models/incremental/incremental.sql", "name": "materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% if existing_relation is none %}\n {% set build_sql = get_create_table_as_sql(False, target_relation, sql) %}\n {% elif full_refresh_mode %}\n {% set build_sql = get_create_table_as_sql(False, intermediate_relation, sql) %}\n {% set need_swap = true %}\n {% else %}\n {% do run_query(get_create_table_as_sql(True, temp_relation, sql)) %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set incremental_predicates = config.get('incremental_predicates', none) %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.get_create_table_as_sql", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7606678, "supported_languages": ["sql"]}, "macro.dbt.incremental_validate_on_schema_change": {"unique_id": "macro.dbt.incremental_validate_on_schema_change", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "incremental_validate_on_schema_change", "macro_sql": "{% macro incremental_validate_on_schema_change(on_schema_change, default='ignore') %}\n\n {% if on_schema_change not in ['sync_all_columns', 'append_new_columns', 'fail', 'ignore'] %}\n\n {% set log_message = 'Invalid value for on_schema_change (%s) specified. Setting default value of %s.' % (on_schema_change, default) %}\n {% do log(log_message) %}\n\n {{ return(default) }}\n\n {% else %}\n\n {{ return(on_schema_change) }}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.765741, "supported_languages": null}, "macro.dbt.check_for_schema_changes": {"unique_id": "macro.dbt.check_for_schema_changes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "check_for_schema_changes", "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n\n {% set schema_changed = False %}\n\n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n\n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n\n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.diff_columns", "macro.dbt.diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7669902, "supported_languages": null}, "macro.dbt.sync_column_schemas": {"unique_id": "macro.dbt.sync_column_schemas", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "sync_column_schemas", "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n\n {% elif on_schema_change == 'sync_all_columns' %}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n\n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n\n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n\n {% do log(schema_change_message) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.alter_relation_add_remove_columns", "macro.dbt.alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.768197, "supported_languages": null}, "macro.dbt.process_schema_changes": {"unique_id": "macro.dbt.process_schema_changes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "process_schema_changes", "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n\n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n\n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n\n {% if schema_changes_dict['schema_changed'] %}\n\n {% if on_schema_change == 'fail' %}\n\n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways:\n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n\n Additional troubleshooting context:\n Source columns not in target: {{ schema_changes_dict['source_not_in_target'] }}\n Target columns not in source: {{ schema_changes_dict['target_not_in_source'] }}\n New column types: {{ schema_changes_dict['new_target_types'] }}\n {% endset %}\n\n {% do exceptions.raise_compiler_error(fail_msg) %}\n\n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n\n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {% endif %}\n\n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.769065, "supported_languages": null}, "macro.dbt.materialization_table_default": {"unique_id": "macro.dbt.materialization_table_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/table.sql", "original_file_path": "macros/materializations/models/table/table.sql", "name": "materialization_table_default", "macro_sql": "{% materialization table, default %}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do create_indexes(target_relation) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.get_create_table_as_sql", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7716858, "supported_languages": ["sql"]}, "macro.dbt.get_create_table_as_sql": {"unique_id": "macro.dbt.get_create_table_as_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "get_create_table_as_sql", "macro_sql": "{% macro get_create_table_as_sql(temporary, relation, sql) -%}\n {{ adapter.dispatch('get_create_table_as_sql', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_table_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.772243, "supported_languages": null}, "macro.dbt.default__get_create_table_as_sql": {"unique_id": "macro.dbt.default__get_create_table_as_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "default__get_create_table_as_sql", "macro_sql": "{% macro default__get_create_table_as_sql(temporary, relation, sql) -%}\n {{ return(create_table_as(temporary, relation, sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.772427, "supported_languages": null}, "macro.dbt.create_table_as": {"unique_id": "macro.dbt.create_table_as", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {# backward compatibility for create_table_as that does not support language #}\n {% if language == \"sql\" %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code)}}\n {% else %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code, language) }}\n {% endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.772842, "supported_languages": null}, "macro.dbt.default__create_table_as": {"unique_id": "macro.dbt.default__create_table_as", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.773258, "supported_languages": null}, "macro.dbt.materialization_view_default": {"unique_id": "macro.dbt.materialization_view_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/view.sql", "original_file_path": "macros/materializations/models/view/view.sql", "name": "materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='view') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n This relation (probably) doesn't exist yet. If it does exist, it's a leftover from\n a previous run, and we're going to try to drop it immediately. At the end of this\n materialization, we're going to rename the \"existing_relation\" to this identifier,\n and then we're going to drop it. In order to make sure we run the correct one of:\n - drop view ...\n - drop table ...\n\n We need to set the type of this relation to be the type of the existing_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the existing_relation does not\n exist, then there is nothing to move out of the way and subsequentally drop. In that case,\n this relation will be effectively unused.\n */\n {%- set backup_relation_type = 'view' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.775755, "supported_languages": ["sql"]}, "macro.dbt.handle_existing_table": {"unique_id": "macro.dbt.handle_existing_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/helpers.sql", "original_file_path": "macros/materializations/models/view/helpers.sql", "name": "handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7761102, "supported_languages": null}, "macro.dbt.default__handle_existing_table": {"unique_id": "macro.dbt.default__handle_existing_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/helpers.sql", "original_file_path": "macros/materializations/models/view/helpers.sql", "name": "default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7763379, "supported_languages": null}, "macro.dbt.create_or_replace_view": {"unique_id": "macro.dbt.create_or_replace_view", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/models/view/create_or_replace_view.sql", "name": "create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {% set should_revoke = should_revoke(exists_as_view, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=True) %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7778199, "supported_languages": null}, "macro.dbt.get_create_view_as_sql": {"unique_id": "macro.dbt.get_create_view_as_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "get_create_view_as_sql", "macro_sql": "{% macro get_create_view_as_sql(relation, sql) -%}\n {{ adapter.dispatch('get_create_view_as_sql', 'dbt')(relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.778223, "supported_languages": null}, "macro.dbt.default__get_create_view_as_sql": {"unique_id": "macro.dbt.default__get_create_view_as_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "default__get_create_view_as_sql", "macro_sql": "{% macro default__get_create_view_as_sql(relation, sql) -%}\n {{ return(create_view_as(relation, sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.778389, "supported_languages": null}, "macro.dbt.create_view_as": {"unique_id": "macro.dbt.create_view_as", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.778572, "supported_languages": null}, "macro.dbt.default__create_view_as": {"unique_id": "macro.dbt.default__create_view_as", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation }} as (\n {{ sql }}\n );\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.778822, "supported_languages": null}, "macro.dbt.materialization_seed_default": {"unique_id": "macro.dbt.materialization_seed_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/seed.sql", "original_file_path": "macros/materializations/seeds/seed.sql", "name": "materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set grant_config = config.get('grants') -%}\n {%- set agate_table = load_agate_table() -%}\n -- grab current tables grants config for comparision later on\n\n {%- do store_result('agate_table', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation)) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', code ~ ' ' ~ rows_affected, code, rows_affected) %}\n {{ get_csv_sql(create_table_sql, sql) }};\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if full_refresh_mode or not exists_as_table %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.run_hooks", "macro.dbt.reset_csv_table", "macro.dbt.create_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.noop_statement", "macro.dbt.get_csv_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7820559, "supported_languages": ["sql"]}, "macro.dbt.create_csv_table": {"unique_id": "macro.dbt.create_csv_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.786925, "supported_languages": null}, "macro.dbt.default__create_csv_table": {"unique_id": "macro.dbt.default__create_csv_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.787877, "supported_languages": null}, "macro.dbt.reset_csv_table": {"unique_id": "macro.dbt.reset_csv_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table', 'dbt')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.788117, "supported_languages": null}, "macro.dbt.default__reset_csv_table": {"unique_id": "macro.dbt.default__reset_csv_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.788589, "supported_languages": null}, "macro.dbt.get_csv_sql": {"unique_id": "macro.dbt.get_csv_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_csv_sql", "macro_sql": "{% macro get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ adapter.dispatch('get_csv_sql', 'dbt')(create_or_truncate_sql, insert_sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_csv_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7887812, "supported_languages": null}, "macro.dbt.default__get_csv_sql": {"unique_id": "macro.dbt.default__get_csv_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_csv_sql", "macro_sql": "{% macro default__get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ create_or_truncate_sql }};\n -- dbt seed --\n {{ insert_sql }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.788911, "supported_languages": null}, "macro.dbt.get_binding_char": {"unique_id": "macro.dbt.get_binding_char", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_binding_char", "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7890549, "supported_languages": null}, "macro.dbt.default__get_binding_char": {"unique_id": "macro.dbt.default__get_binding_char", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_binding_char", "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7891688, "supported_languages": null}, "macro.dbt.get_batch_size": {"unique_id": "macro.dbt.get_batch_size", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_batch_size", "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_batch_size"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.789334, "supported_languages": null}, "macro.dbt.default__get_batch_size": {"unique_id": "macro.dbt.default__get_batch_size", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_batch_size", "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.78945, "supported_languages": null}, "macro.dbt.get_seed_column_quoted_csv": {"unique_id": "macro.dbt.get_seed_column_quoted_csv", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.789919, "supported_languages": null}, "macro.dbt.load_csv_rows": {"unique_id": "macro.dbt.load_csv_rows", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.790105, "supported_languages": null}, "macro.dbt.default__load_csv_rows": {"unique_id": "macro.dbt.default__load_csv_rows", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n\n {% set batch_size = get_batch_size() %}\n\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.791332, "supported_languages": null}, "macro.dbt.generate_alias_name": {"unique_id": "macro.dbt.generate_alias_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "name": "generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_alias_name', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_alias_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.791904, "supported_languages": null}, "macro.dbt.default__generate_alias_name": {"unique_id": "macro.dbt.default__generate_alias_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "name": "default__generate_alias_name", "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name is none -%}\n\n {{ node.name }}\n\n {%- else -%}\n\n {{ custom_alias_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7922292, "supported_languages": null}, "macro.dbt.generate_schema_name": {"unique_id": "macro.dbt.generate_schema_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name=none, node=none) -%}\n {{ return(adapter.dispatch('generate_schema_name', 'dbt')(custom_schema_name, node)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7928908, "supported_languages": null}, "macro.dbt.default__generate_schema_name": {"unique_id": "macro.dbt.default__generate_schema_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.793171, "supported_languages": null}, "macro.dbt.generate_schema_name_for_env": {"unique_id": "macro.dbt.generate_schema_name_for_env", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7934568, "supported_languages": null}, "macro.dbt.generate_database_name": {"unique_id": "macro.dbt.generate_database_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "name": "generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name', 'dbt')(custom_database_name, node)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.793919, "supported_languages": null}, "macro.dbt.default__generate_database_name": {"unique_id": "macro.dbt.default__generate_database_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "name": "default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.794168, "supported_languages": null}, "macro.dbt.default__test_relationships": {"unique_id": "macro.dbt.default__test_relationships", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/relationships.sql", "original_file_path": "macros/generic_test_sql/relationships.sql", "name": "default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7945778, "supported_languages": null}, "macro.dbt.default__test_not_null": {"unique_id": "macro.dbt.default__test_not_null", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/not_null.sql", "original_file_path": "macros/generic_test_sql/not_null.sql", "name": "default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else column_name %}\n\nselect {{ column_list }}\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.794942, "supported_languages": null}, "macro.dbt.default__test_unique": {"unique_id": "macro.dbt.default__test_unique", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/unique.sql", "original_file_path": "macros/generic_test_sql/unique.sql", "name": "default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.795253, "supported_languages": null}, "macro.dbt.default__test_accepted_values": {"unique_id": "macro.dbt.default__test_accepted_values", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/accepted_values.sql", "original_file_path": "macros/generic_test_sql/accepted_values.sql", "name": "default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by {{ column_name }}\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.795897, "supported_languages": null}, "macro.dbt.statement": {"unique_id": "macro.dbt.statement", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "statement", "macro_sql": "\n{%- macro statement(name=None, fetch_result=False, auto_begin=True, language='sql') -%}\n {%- if execute: -%}\n {%- set compiled_code = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime {} for node \"{}\"'.format(language, model['unique_id'])) }}\n {{ write(compiled_code) }}\n {%- endif -%}\n {%- if language == 'sql'-%}\n {%- set res, table = adapter.execute(compiled_code, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- elif language == 'python' -%}\n {%- set res = submit_python_job(model, compiled_code) -%}\n {#-- TODO: What should table be for python models? --#}\n {%- set table = None -%}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"statement macro didn't get supported language\") %}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7973928, "supported_languages": null}, "macro.dbt.noop_statement": {"unique_id": "macro.dbt.noop_statement", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7982368, "supported_languages": null}, "macro.dbt.run_query": {"unique_id": "macro.dbt.run_query", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.798539, "supported_languages": null}, "macro.dbt.convert_datetime": {"unique_id": "macro.dbt.convert_datetime", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "convert_datetime", "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8003368, "supported_languages": null}, "macro.dbt.dates_in_range": {"unique_id": "macro.dbt.dates_in_range", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "dates_in_range", "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n Partiton start date is after the end date ({{ start_date }}, {{ end_date }})\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg, model) }}\n {% endif %}\n\n {% set date_list = [] %}\n {% for i in range(0, day_count + 1) %}\n {% set the_date = (modules.datetime.timedelta(days=i) + start_date) %}\n {% if not out_fmt %}\n {% set _ = date_list.append(the_date) %}\n {% else %}\n {% set _ = date_list.append(the_date.strftime(out_fmt)) %}\n {% endif %}\n {% endfor %}\n\n {{ return(date_list) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.801549, "supported_languages": null}, "macro.dbt.partition_range": {"unique_id": "macro.dbt.partition_range", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "partition_range", "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8023522, "supported_languages": null}, "macro.dbt.py_current_timestring": {"unique_id": "macro.dbt.py_current_timestring", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "py_current_timestring", "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.802581, "supported_languages": null}, "macro.dbt.except": {"unique_id": "macro.dbt.except", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "name": "except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.802971, "supported_languages": null}, "macro.dbt.default__except": {"unique_id": "macro.dbt.default__except", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "name": "default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.803045, "supported_languages": null}, "macro.dbt.replace": {"unique_id": "macro.dbt.replace", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "name": "replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt') (field, old_chars, new_chars)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8034172, "supported_languages": null}, "macro.dbt.default__replace": {"unique_id": "macro.dbt.default__replace", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "name": "default__replace", "macro_sql": "{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8035781, "supported_languages": null}, "macro.dbt.concat": {"unique_id": "macro.dbt.concat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "name": "concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt')(fields)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8038762, "supported_languages": null}, "macro.dbt.default__concat": {"unique_id": "macro.dbt.default__concat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "name": "default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n {{ fields|join(' || ') }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.803997, "supported_languages": null}, "macro.dbt.length": {"unique_id": "macro.dbt.length", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "name": "length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__length"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.804307, "supported_languages": null}, "macro.dbt.default__length": {"unique_id": "macro.dbt.default__length", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "name": "default__length", "macro_sql": "{% macro default__length(expression) %}\n\n length(\n {{ expression }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.804411, "supported_languages": null}, "macro.dbt.dateadd": {"unique_id": "macro.dbt.dateadd", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "name": "dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.80481, "supported_languages": null}, "macro.dbt.default__dateadd": {"unique_id": "macro.dbt.default__dateadd", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "name": "default__dateadd", "macro_sql": "{% macro default__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_date_or_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.804969, "supported_languages": null}, "macro.dbt.intersect": {"unique_id": "macro.dbt.intersect", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "name": "intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__intersect"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.805244, "supported_languages": null}, "macro.dbt.default__intersect": {"unique_id": "macro.dbt.default__intersect", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "name": "default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8053188, "supported_languages": null}, "macro.dbt.escape_single_quotes": {"unique_id": "macro.dbt.escape_single_quotes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "name": "escape_single_quotes", "macro_sql": "{% macro escape_single_quotes(expression) %}\n {{ return(adapter.dispatch('escape_single_quotes', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__escape_single_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.80563, "supported_languages": null}, "macro.dbt.default__escape_single_quotes": {"unique_id": "macro.dbt.default__escape_single_quotes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "name": "default__escape_single_quotes", "macro_sql": "{% macro default__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\",\"''\") }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8057668, "supported_languages": null}, "macro.dbt.right": {"unique_id": "macro.dbt.right", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "name": "right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt') (string_text, length_expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__right"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8061068, "supported_languages": null}, "macro.dbt.default__right": {"unique_id": "macro.dbt.default__right", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "name": "default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.806319, "supported_languages": null}, "macro.dbt.listagg": {"unique_id": "macro.dbt.listagg", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "name": "listagg", "macro_sql": "{% macro listagg(measure, delimiter_text=\"','\", order_by_clause=none, limit_num=none) -%}\n {{ return(adapter.dispatch('listagg', 'dbt') (measure, delimiter_text, order_by_clause, limit_num)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__listagg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8069792, "supported_languages": null}, "macro.dbt.default__listagg": {"unique_id": "macro.dbt.default__listagg", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "name": "default__listagg", "macro_sql": "{% macro default__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n array_slice(\n array_agg(\n {{ measure }}\n ){% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n ,0\n ,{{ limit_num }}\n ),\n {{ delimiter_text }}\n )\n {%- else %}\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.807366, "supported_languages": null}, "macro.dbt.datediff": {"unique_id": "macro.dbt.datediff", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "name": "datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt')(first_date, second_date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.807748, "supported_languages": null}, "macro.dbt.default__datediff": {"unique_id": "macro.dbt.default__datediff", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "name": "default__datediff", "macro_sql": "{% macro default__datediff(first_date, second_date, datepart) -%}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.807904, "supported_languages": null}, "macro.dbt.safe_cast": {"unique_id": "macro.dbt.safe_cast", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "name": "safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt') (field, type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.808238, "supported_languages": null}, "macro.dbt.default__safe_cast": {"unique_id": "macro.dbt.default__safe_cast", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "name": "default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.808374, "supported_languages": null}, "macro.dbt.hash": {"unique_id": "macro.dbt.hash", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "name": "hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt') (field)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8086798, "supported_languages": null}, "macro.dbt.default__hash": {"unique_id": "macro.dbt.default__hash", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "name": "default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{ field }} as {{ api.Column.translate_type('string') }}))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.808835, "supported_languages": null}, "macro.dbt.cast_bool_to_text": {"unique_id": "macro.dbt.cast_bool_to_text", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "name": "cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', 'dbt') (field) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.809123, "supported_languages": null}, "macro.dbt.default__cast_bool_to_text": {"unique_id": "macro.dbt.default__cast_bool_to_text", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "name": "default__cast_bool_to_text", "macro_sql": "{% macro default__cast_bool_to_text(field) %}\n cast({{ field }} as {{ api.Column.translate_type('string') }})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8092742, "supported_languages": null}, "macro.dbt.any_value": {"unique_id": "macro.dbt.any_value", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "name": "any_value", "macro_sql": "{% macro any_value(expression) -%}\n {{ return(adapter.dispatch('any_value', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__any_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8095648, "supported_languages": null}, "macro.dbt.default__any_value": {"unique_id": "macro.dbt.default__any_value", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "name": "default__any_value", "macro_sql": "{% macro default__any_value(expression) -%}\n\n any_value({{ expression }})\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8096662, "supported_languages": null}, "macro.dbt.position": {"unique_id": "macro.dbt.position", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "name": "position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt') (substring_text, string_text)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__position"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.81, "supported_languages": null}, "macro.dbt.default__position": {"unique_id": "macro.dbt.default__position", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "name": "default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.81013, "supported_languages": null}, "macro.dbt.string_literal": {"unique_id": "macro.dbt.string_literal", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "name": "string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt') (value)) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.810417, "supported_languages": null}, "macro.dbt.default__string_literal": {"unique_id": "macro.dbt.default__string_literal", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "name": "default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.810518, "supported_languages": null}, "macro.dbt.type_string": {"unique_id": "macro.dbt.type_string", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.811456, "supported_languages": null}, "macro.dbt.default__type_string": {"unique_id": "macro.dbt.default__type_string", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_string", "macro_sql": "{% macro default__type_string() %}\n {{ return(api.Column.translate_type(\"string\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8116019, "supported_languages": null}, "macro.dbt.type_timestamp": {"unique_id": "macro.dbt.type_timestamp", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8118231, "supported_languages": null}, "macro.dbt.default__type_timestamp": {"unique_id": "macro.dbt.default__type_timestamp", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n {{ return(api.Column.translate_type(\"timestamp\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.811973, "supported_languages": null}, "macro.dbt.type_float": {"unique_id": "macro.dbt.type_float", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8121269, "supported_languages": null}, "macro.dbt.default__type_float": {"unique_id": "macro.dbt.default__type_float", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_float", "macro_sql": "{% macro default__type_float() %}\n {{ return(api.Column.translate_type(\"float\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.812276, "supported_languages": null}, "macro.dbt.type_numeric": {"unique_id": "macro.dbt.type_numeric", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.812433, "supported_languages": null}, "macro.dbt.default__type_numeric": {"unique_id": "macro.dbt.default__type_numeric", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n {{ return(api.Column.numeric_type(\"numeric\", 28, 6)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.812611, "supported_languages": null}, "macro.dbt.type_bigint": {"unique_id": "macro.dbt.type_bigint", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.812769, "supported_languages": null}, "macro.dbt.default__type_bigint": {"unique_id": "macro.dbt.default__type_bigint", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n {{ return(api.Column.translate_type(\"bigint\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.812918, "supported_languages": null}, "macro.dbt.type_int": {"unique_id": "macro.dbt.type_int", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.813086, "supported_languages": null}, "macro.dbt.default__type_int": {"unique_id": "macro.dbt.default__type_int", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_int", "macro_sql": "{%- macro default__type_int() -%}\n {{ return(api.Column.translate_type(\"integer\")) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8132339, "supported_languages": null}, "macro.dbt.type_boolean": {"unique_id": "macro.dbt.type_boolean", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_boolean", "macro_sql": "\n\n{%- macro type_boolean() -%}\n {{ return(adapter.dispatch('type_boolean', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_boolean"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.813397, "supported_languages": null}, "macro.dbt.default__type_boolean": {"unique_id": "macro.dbt.default__type_boolean", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_boolean", "macro_sql": "{%- macro default__type_boolean() -%}\n {{ return(api.Column.translate_type(\"boolean\")) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.813535, "supported_languages": null}, "macro.dbt.array_concat": {"unique_id": "macro.dbt.array_concat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "name": "array_concat", "macro_sql": "{% macro array_concat(array_1, array_2) -%}\n {{ return(adapter.dispatch('array_concat', 'dbt')(array_1, array_2)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__array_concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.813886, "supported_languages": null}, "macro.dbt.default__array_concat": {"unique_id": "macro.dbt.default__array_concat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "name": "default__array_concat", "macro_sql": "{% macro default__array_concat(array_1, array_2) -%}\n array_cat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.814014, "supported_languages": null}, "macro.dbt.bool_or": {"unique_id": "macro.dbt.bool_or", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "name": "bool_or", "macro_sql": "{% macro bool_or(expression) -%}\n {{ return(adapter.dispatch('bool_or', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__bool_or"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.814307, "supported_languages": null}, "macro.dbt.default__bool_or": {"unique_id": "macro.dbt.default__bool_or", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "name": "default__bool_or", "macro_sql": "{% macro default__bool_or(expression) -%}\n\n bool_or({{ expression }})\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.814412, "supported_languages": null}, "macro.dbt.last_day": {"unique_id": "macro.dbt.last_day", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "name": "last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt') (date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.814789, "supported_languages": null}, "macro.dbt.default_last_day": {"unique_id": "macro.dbt.default_last_day", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "name": "default_last_day", "macro_sql": "\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd(datepart, '1', dbt.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.815061, "supported_languages": null}, "macro.dbt.default__last_day": {"unique_id": "macro.dbt.default__last_day", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "name": "default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt.default_last_day(date, datepart)}}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8152142, "supported_languages": null}, "macro.dbt.split_part": {"unique_id": "macro.dbt.split_part", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "name": "split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ return(adapter.dispatch('split_part', 'dbt') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.815809, "supported_languages": null}, "macro.dbt.default__split_part": {"unique_id": "macro.dbt.default__split_part", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "name": "default__split_part", "macro_sql": "{% macro default__split_part(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n {{ part_number }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8160331, "supported_languages": null}, "macro.dbt._split_part_negative": {"unique_id": "macro.dbt._split_part_negative", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "name": "_split_part_negative", "macro_sql": "{% macro _split_part_negative(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n length({{ string_text }})\n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 2 {{ part_number }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.816364, "supported_languages": null}, "macro.dbt.date_trunc": {"unique_id": "macro.dbt.date_trunc", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "name": "date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt') (datepart, date)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.816774, "supported_languages": null}, "macro.dbt.default__date_trunc": {"unique_id": "macro.dbt.default__date_trunc", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "name": "default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) -%}\n date_trunc('{{datepart}}', {{date}})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8169081, "supported_languages": null}, "macro.dbt.array_construct": {"unique_id": "macro.dbt.array_construct", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "name": "array_construct", "macro_sql": "{% macro array_construct(inputs=[], data_type=api.Column.translate_type('integer')) -%}\n {{ return(adapter.dispatch('array_construct', 'dbt')(inputs, data_type)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__array_construct"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.817344, "supported_languages": null}, "macro.dbt.default__array_construct": {"unique_id": "macro.dbt.default__array_construct", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "name": "default__array_construct", "macro_sql": "{% macro default__array_construct(inputs, data_type) -%}\n {% if inputs|length > 0 %}\n array[ {{ inputs|join(' , ') }} ]\n {% else %}\n array[]::{{data_type}}[]\n {% endif %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.81759, "supported_languages": null}, "macro.dbt.array_append": {"unique_id": "macro.dbt.array_append", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "name": "array_append", "macro_sql": "{% macro array_append(array, new_element) -%}\n {{ return(adapter.dispatch('array_append', 'dbt')(array, new_element)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__array_append"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.817927, "supported_languages": null}, "macro.dbt.default__array_append": {"unique_id": "macro.dbt.default__array_append", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "name": "default__array_append", "macro_sql": "{% macro default__array_append(array, new_element) -%}\n array_append({{ array }}, {{ new_element }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.81806, "supported_languages": null}, "macro.dbt.create_schema": {"unique_id": "macro.dbt.create_schema", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema', 'dbt')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.818482, "supported_languages": null}, "macro.dbt.default__create_schema": {"unique_id": "macro.dbt.default__create_schema", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.818662, "supported_languages": null}, "macro.dbt.drop_schema": {"unique_id": "macro.dbt.drop_schema", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.818824, "supported_languages": null}, "macro.dbt.default__drop_schema": {"unique_id": "macro.dbt.default__drop_schema", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.81901, "supported_languages": null}, "macro.dbt.current_timestamp": {"unique_id": "macro.dbt.current_timestamp", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "current_timestamp", "macro_sql": "{%- macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8195221, "supported_languages": null}, "macro.dbt.default__current_timestamp": {"unique_id": "macro.dbt.default__current_timestamp", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter ' + adapter.type()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.819668, "supported_languages": null}, "macro.dbt.snapshot_get_time": {"unique_id": "macro.dbt.snapshot_get_time", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "snapshot_get_time", "macro_sql": "\n\n{%- macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.819804, "supported_languages": null}, "macro.dbt.default__snapshot_get_time": {"unique_id": "macro.dbt.default__snapshot_get_time", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() %}\n {{ current_timestamp() }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8199072, "supported_languages": null}, "macro.dbt.current_timestamp_backcompat": {"unique_id": "macro.dbt.current_timestamp_backcompat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "current_timestamp_backcompat", "macro_sql": "{% macro current_timestamp_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.820079, "supported_languages": null}, "macro.dbt.default__current_timestamp_backcompat": {"unique_id": "macro.dbt.default__current_timestamp_backcompat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "default__current_timestamp_backcompat", "macro_sql": "{% macro default__current_timestamp_backcompat() %}\n current_timestamp::timestamp\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.820153, "supported_languages": null}, "macro.dbt.current_timestamp_in_utc_backcompat": {"unique_id": "macro.dbt.current_timestamp_in_utc_backcompat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "current_timestamp_in_utc_backcompat", "macro_sql": "{% macro current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_in_utc_backcompat', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__current_timestamp_in_utc_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.820311, "supported_languages": null}, "macro.dbt.default__current_timestamp_in_utc_backcompat": {"unique_id": "macro.dbt.default__current_timestamp_in_utc_backcompat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "default__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro default__current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt_bigquery.bigquery__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.820468, "supported_languages": null}, "macro.dbt.get_create_index_sql": {"unique_id": "macro.dbt.get_create_index_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.820962, "supported_languages": null}, "macro.dbt.default__get_create_index_sql": {"unique_id": "macro.dbt.default__get_create_index_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.821161, "supported_languages": null}, "macro.dbt.create_indexes": {"unique_id": "macro.dbt.create_indexes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes', 'dbt')(relation) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8213131, "supported_languages": null}, "macro.dbt.default__create_indexes": {"unique_id": "macro.dbt.default__create_indexes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.821704, "supported_languages": null}, "macro.dbt.make_intermediate_relation": {"unique_id": "macro.dbt.make_intermediate_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "make_intermediate_relation", "macro_sql": "{% macro make_intermediate_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_intermediate_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_intermediate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.824727, "supported_languages": null}, "macro.dbt.default__make_intermediate_relation": {"unique_id": "macro.dbt.default__make_intermediate_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__make_intermediate_relation", "macro_sql": "{% macro default__make_intermediate_relation(base_relation, suffix) %}\n {{ return(default__make_temp_relation(base_relation, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8248892, "supported_languages": null}, "macro.dbt.make_temp_relation": {"unique_id": "macro.dbt.make_temp_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.825099, "supported_languages": null}, "macro.dbt.default__make_temp_relation": {"unique_id": "macro.dbt.default__make_temp_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {%- set temp_identifier = base_relation.identifier ~ suffix -%}\n {%- set temp_relation = base_relation.incorporate(\n path={\"identifier\": temp_identifier}) -%}\n\n {{ return(temp_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8253849, "supported_languages": null}, "macro.dbt.make_backup_relation": {"unique_id": "macro.dbt.make_backup_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "make_backup_relation", "macro_sql": "{% macro make_backup_relation(base_relation, backup_relation_type, suffix='__dbt_backup') %}\n {{ return(adapter.dispatch('make_backup_relation', 'dbt')(base_relation, backup_relation_type, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_backup_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.825624, "supported_languages": null}, "macro.dbt.default__make_backup_relation": {"unique_id": "macro.dbt.default__make_backup_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__make_backup_relation", "macro_sql": "{% macro default__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {%- set backup_identifier = base_relation.identifier ~ suffix -%}\n {%- set backup_relation = base_relation.incorporate(\n path={\"identifier\": backup_identifier},\n type=backup_relation_type\n ) -%}\n {{ return(backup_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8259468, "supported_languages": null}, "macro.dbt.drop_relation": {"unique_id": "macro.dbt.drop_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8261461, "supported_languages": null}, "macro.dbt.default__drop_relation": {"unique_id": "macro.dbt.default__drop_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__drop_relation", "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8263512, "supported_languages": null}, "macro.dbt.truncate_relation": {"unique_id": "macro.dbt.truncate_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8265269, "supported_languages": null}, "macro.dbt.default__truncate_relation": {"unique_id": "macro.dbt.default__truncate_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.82668, "supported_languages": null}, "macro.dbt.rename_relation": {"unique_id": "macro.dbt.rename_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.826874, "supported_languages": null}, "macro.dbt.default__rename_relation": {"unique_id": "macro.dbt.default__rename_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.82714, "supported_languages": null}, "macro.dbt.get_or_create_relation": {"unique_id": "macro.dbt.get_or_create_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) -%}\n {{ return(adapter.dispatch('get_or_create_relation', 'dbt')(database, schema, identifier, type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_or_create_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8273878, "supported_languages": null}, "macro.dbt.default__get_or_create_relation": {"unique_id": "macro.dbt.default__get_or_create_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__get_or_create_relation", "macro_sql": "{% macro default__get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.827923, "supported_languages": null}, "macro.dbt.load_cached_relation": {"unique_id": "macro.dbt.load_cached_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "load_cached_relation", "macro_sql": "{% macro load_cached_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.828204, "supported_languages": null}, "macro.dbt.load_relation": {"unique_id": "macro.dbt.load_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {{ return(load_cached_relation(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.82835, "supported_languages": null}, "macro.dbt.drop_relation_if_exists": {"unique_id": "macro.dbt.drop_relation_if_exists", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.828547, "supported_languages": null}, "macro.dbt.collect_freshness": {"unique_id": "macro.dbt.collect_freshness", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness', 'dbt')(source, loaded_at_field, filter))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.829025, "supported_languages": null}, "macro.dbt.default__collect_freshness": {"unique_id": "macro.dbt.default__collect_freshness", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.82943, "supported_languages": null}, "macro.dbt.copy_grants": {"unique_id": "macro.dbt.copy_grants", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "copy_grants", "macro_sql": "{% macro copy_grants() %}\n {{ return(adapter.dispatch('copy_grants', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8310258, "supported_languages": null}, "macro.dbt.default__copy_grants": {"unique_id": "macro.dbt.default__copy_grants", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__copy_grants", "macro_sql": "{% macro default__copy_grants() %}\n {{ return(True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.831142, "supported_languages": null}, "macro.dbt.support_multiple_grantees_per_dcl_statement": {"unique_id": "macro.dbt.support_multiple_grantees_per_dcl_statement", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "support_multiple_grantees_per_dcl_statement", "macro_sql": "{% macro support_multiple_grantees_per_dcl_statement() %}\n {{ return(adapter.dispatch('support_multiple_grantees_per_dcl_statement', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.831302, "supported_languages": null}, "macro.dbt.default__support_multiple_grantees_per_dcl_statement": {"unique_id": "macro.dbt.default__support_multiple_grantees_per_dcl_statement", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__support_multiple_grantees_per_dcl_statement", "macro_sql": "\n\n{%- macro default__support_multiple_grantees_per_dcl_statement() -%}\n {{ return(True) }}\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.831412, "supported_languages": null}, "macro.dbt.should_revoke": {"unique_id": "macro.dbt.should_revoke", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "should_revoke", "macro_sql": "{% macro should_revoke(existing_relation, full_refresh_mode=True) %}\n\n {% if not existing_relation %}\n {#-- The table doesn't already exist, so no grants to copy over --#}\n {{ return(False) }}\n {% elif full_refresh_mode %}\n {#-- The object is being REPLACED -- whether grants are copied over depends on the value of user config --#}\n {{ return(copy_grants()) }}\n {% else %}\n {#-- The table is being merged/upserted/inserted -- grants will be carried over --#}\n {{ return(True) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.831743, "supported_languages": null}, "macro.dbt.get_show_grant_sql": {"unique_id": "macro.dbt.get_show_grant_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_show_grant_sql", "macro_sql": "{% macro get_show_grant_sql(relation) %}\n {{ return(adapter.dispatch(\"get_show_grant_sql\", \"dbt\")(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_show_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.831924, "supported_languages": null}, "macro.dbt.default__get_show_grant_sql": {"unique_id": "macro.dbt.default__get_show_grant_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_show_grant_sql", "macro_sql": "{% macro default__get_show_grant_sql(relation) %}\n show grants on {{ relation }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.832021, "supported_languages": null}, "macro.dbt.get_grant_sql": {"unique_id": "macro.dbt.get_grant_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_grant_sql", "macro_sql": "{% macro get_grant_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_grant_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8322508, "supported_languages": null}, "macro.dbt.default__get_grant_sql": {"unique_id": "macro.dbt.default__get_grant_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_grant_sql", "macro_sql": "\n\n{%- macro default__get_grant_sql(relation, privilege, grantees) -%}\n grant {{ privilege }} on {{ relation }} to {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.832434, "supported_languages": null}, "macro.dbt.get_revoke_sql": {"unique_id": "macro.dbt.get_revoke_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_revoke_sql", "macro_sql": "{% macro get_revoke_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_revoke_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_revoke_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.83265, "supported_languages": null}, "macro.dbt.default__get_revoke_sql": {"unique_id": "macro.dbt.default__get_revoke_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_revoke_sql", "macro_sql": "\n\n{%- macro default__get_revoke_sql(relation, privilege, grantees) -%}\n revoke {{ privilege }} on {{ relation }} from {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.83283, "supported_languages": null}, "macro.dbt.get_dcl_statement_list": {"unique_id": "macro.dbt.get_dcl_statement_list", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_dcl_statement_list", "macro_sql": "{% macro get_dcl_statement_list(relation, grant_config, get_dcl_macro) %}\n {{ return(adapter.dispatch('get_dcl_statement_list', 'dbt')(relation, grant_config, get_dcl_macro)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_dcl_statement_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8330472, "supported_languages": null}, "macro.dbt.default__get_dcl_statement_list": {"unique_id": "macro.dbt.default__get_dcl_statement_list", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_dcl_statement_list", "macro_sql": "\n\n{%- macro default__get_dcl_statement_list(relation, grant_config, get_dcl_macro) -%}\n {#\n -- Unpack grant_config into specific privileges and the set of users who need them granted/revoked.\n -- Depending on whether this database supports multiple grantees per statement, pass in the list of\n -- all grantees per privilege, or (if not) template one statement per privilege-grantee pair.\n -- `get_dcl_macro` will be either `get_grant_sql` or `get_revoke_sql`\n #}\n {%- set dcl_statements = [] -%}\n {%- for privilege, grantees in grant_config.items() %}\n {%- if support_multiple_grantees_per_dcl_statement() and grantees -%}\n {%- set dcl = get_dcl_macro(relation, privilege, grantees) -%}\n {%- do dcl_statements.append(dcl) -%}\n {%- else -%}\n {%- for grantee in grantees -%}\n {% set dcl = get_dcl_macro(relation, privilege, [grantee]) %}\n {%- do dcl_statements.append(dcl) -%}\n {% endfor -%}\n {%- endif -%}\n {%- endfor -%}\n {{ return(dcl_statements) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8337102, "supported_languages": null}, "macro.dbt.call_dcl_statements": {"unique_id": "macro.dbt.call_dcl_statements", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "call_dcl_statements", "macro_sql": "{% macro call_dcl_statements(dcl_statement_list) %}\n {{ return(adapter.dispatch(\"call_dcl_statements\", \"dbt\")(dcl_statement_list)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.833952, "supported_languages": null}, "macro.dbt.default__call_dcl_statements": {"unique_id": "macro.dbt.default__call_dcl_statements", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__call_dcl_statements", "macro_sql": "{% macro default__call_dcl_statements(dcl_statement_list) %}\n {#\n -- By default, supply all grant + revoke statements in a single semicolon-separated block,\n -- so that they're all processed together.\n\n -- Some databases do not support this. Those adapters will need to override this macro\n -- to run each statement individually.\n #}\n {% call statement('grants') %}\n {% for dcl_statement in dcl_statement_list %}\n {{ dcl_statement }};\n {% endfor %}\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.834191, "supported_languages": null}, "macro.dbt.apply_grants": {"unique_id": "macro.dbt.apply_grants", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "apply_grants", "macro_sql": "{% macro apply_grants(relation, grant_config, should_revoke) %}\n {{ return(adapter.dispatch(\"apply_grants\", \"dbt\")(relation, grant_config, should_revoke)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.834425, "supported_languages": null}, "macro.dbt.default__apply_grants": {"unique_id": "macro.dbt.default__apply_grants", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__apply_grants", "macro_sql": "{% macro default__apply_grants(relation, grant_config, should_revoke=True) %}\n {#-- If grant_config is {} or None, this is a no-op --#}\n {% if grant_config %}\n {% if should_revoke %}\n {#-- We think previous grants may have carried over --#}\n {#-- Show current grants and calculate diffs --#}\n {% set current_grants_table = run_query(get_show_grant_sql(relation)) %}\n {% set current_grants_dict = adapter.standardize_grants_dict(current_grants_table) %}\n {% set needs_granting = diff_of_two_dicts(grant_config, current_grants_dict) %}\n {% set needs_revoking = diff_of_two_dicts(current_grants_dict, grant_config) %}\n {% if not (needs_granting or needs_revoking) %}\n {{ log('On ' ~ relation ~': All grants are in place, no revocation or granting needed.')}}\n {% endif %}\n {% else %}\n {#-- We don't think there's any chance of previous grants having carried over. --#}\n {#-- Jump straight to granting what the user has configured. --#}\n {% set needs_revoking = {} %}\n {% set needs_granting = grant_config %}\n {% endif %}\n {% if needs_granting or needs_revoking %}\n {% set revoke_statement_list = get_dcl_statement_list(relation, needs_revoking, get_revoke_sql) %}\n {% set grant_statement_list = get_dcl_statement_list(relation, needs_granting, get_grant_sql) %}\n {% set dcl_statement_list = revoke_statement_list + grant_statement_list %}\n {% if dcl_statement_list %}\n {{ call_dcl_statements(dcl_statement_list) }}\n {% endif %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_grant_sql", "macro.dbt.get_dcl_statement_list", "macro.dbt.call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8356202, "supported_languages": null}, "macro.dbt.alter_column_comment": {"unique_id": "macro.dbt.alter_column_comment", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment', 'dbt')(relation, column_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.836381, "supported_languages": null}, "macro.dbt.default__alter_column_comment": {"unique_id": "macro.dbt.default__alter_column_comment", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.836545, "supported_languages": null}, "macro.dbt.alter_relation_comment": {"unique_id": "macro.dbt.alter_relation_comment", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment', 'dbt')(relation, relation_comment)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8367438, "supported_languages": null}, "macro.dbt.default__alter_relation_comment": {"unique_id": "macro.dbt.default__alter_relation_comment", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.836904, "supported_languages": null}, "macro.dbt.persist_docs": {"unique_id": "macro.dbt.persist_docs", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs', 'dbt')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.837161, "supported_languages": null}, "macro.dbt.default__persist_docs": {"unique_id": "macro.dbt.default__persist_docs", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do run_query(alter_column_comment(relation, model.columns)) %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8376231, "supported_languages": null}, "macro.dbt.get_catalog": {"unique_id": "macro.dbt.get_catalog", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8390248, "supported_languages": null}, "macro.dbt.default__get_catalog": {"unique_id": "macro.dbt.default__get_catalog", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.839276, "supported_languages": null}, "macro.dbt.information_schema_name": {"unique_id": "macro.dbt.information_schema_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.839455, "supported_languages": null}, "macro.dbt.default__information_schema_name": {"unique_id": "macro.dbt.default__information_schema_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.839602, "supported_languages": null}, "macro.dbt.list_schemas": {"unique_id": "macro.dbt.list_schemas", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8397708, "supported_languages": null}, "macro.dbt.default__list_schemas": {"unique_id": "macro.dbt.default__list_schemas", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.840009, "supported_languages": null}, "macro.dbt.check_schema_exists": {"unique_id": "macro.dbt.check_schema_exists", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists', 'dbt')(information_schema, schema)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.840224, "supported_languages": null}, "macro.dbt.default__check_schema_exists": {"unique_id": "macro.dbt.default__check_schema_exists", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.840512, "supported_languages": null}, "macro.dbt.list_relations_without_caching": {"unique_id": "macro.dbt.list_relations_without_caching", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.840699, "supported_languages": null}, "macro.dbt.default__list_relations_without_caching": {"unique_id": "macro.dbt.default__list_relations_without_caching", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.840852, "supported_languages": null}, "macro.dbt.get_columns_in_relation": {"unique_id": "macro.dbt.get_columns_in_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.842443, "supported_languages": null}, "macro.dbt.default__get_columns_in_relation": {"unique_id": "macro.dbt.default__get_columns_in_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8426602, "supported_languages": null}, "macro.dbt.sql_convert_columns_in_relation": {"unique_id": "macro.dbt.sql_convert_columns_in_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8429608, "supported_languages": null}, "macro.dbt.get_columns_in_query": {"unique_id": "macro.dbt.get_columns_in_query", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8431349, "supported_languages": null}, "macro.dbt.default__get_columns_in_query": {"unique_id": "macro.dbt.default__get_columns_in_query", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.843464, "supported_languages": null}, "macro.dbt.alter_column_type": {"unique_id": "macro.dbt.alter_column_type", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type', 'dbt')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8437, "supported_languages": null}, "macro.dbt.default__alter_column_type": {"unique_id": "macro.dbt.default__alter_column_type", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.844429, "supported_languages": null}, "macro.dbt.alter_relation_add_remove_columns": {"unique_id": "macro.dbt.alter_relation_add_remove_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "alter_relation_add_remove_columns", "macro_sql": "{% macro alter_relation_add_remove_columns(relation, add_columns = none, remove_columns = none) -%}\n {{ return(adapter.dispatch('alter_relation_add_remove_columns', 'dbt')(relation, add_columns, remove_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__alter_relation_add_remove_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.844748, "supported_languages": null}, "macro.dbt.default__alter_relation_add_remove_columns": {"unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__alter_relation_add_remove_columns", "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation }}\n\n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n\n {% for column in remove_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.845564, "supported_languages": null}, "macro.dbt.build_ref_function": {"unique_id": "macro.dbt.build_ref_function", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "build_ref_function", "macro_sql": "{% macro build_ref_function(model) %}\n\n {%- set ref_dict = {} -%}\n {%- for _ref in model.refs -%}\n {%- set resolved = ref(*_ref) -%}\n {%- do ref_dict.update({_ref | join(\".\"): resolved.quote(database=False, schema=False, identifier=False) | string}) -%}\n {%- endfor -%}\n\ndef ref(*args,dbt_load_df_function):\n refs = {{ ref_dict | tojson }}\n key = \".\".join(args)\n return dbt_load_df_function(refs[key])\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.847101, "supported_languages": null}, "macro.dbt.build_source_function": {"unique_id": "macro.dbt.build_source_function", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "build_source_function", "macro_sql": "{% macro build_source_function(model) %}\n\n {%- set source_dict = {} -%}\n {%- for _source in model.sources -%}\n {%- set resolved = source(*_source) -%}\n {%- do source_dict.update({_source | join(\".\"): resolved.quote(database=False, schema=False, identifier=False) | string}) -%}\n {%- endfor -%}\n\ndef source(*args, dbt_load_df_function):\n sources = {{ source_dict | tojson }}\n key = \".\".join(args)\n return dbt_load_df_function(sources[key])\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.847569, "supported_languages": null}, "macro.dbt.build_config_dict": {"unique_id": "macro.dbt.build_config_dict", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "build_config_dict", "macro_sql": "{% macro build_config_dict(model) %}\n {%- set config_dict = {} -%}\n {%- for key in model.config.config_keys_used -%}\n {# weird type testing with enum, would be much easier to write this logic in Python! #}\n {%- if key == 'language' -%}\n {%- set value = 'python' -%}\n {%- endif -%}\n {%- set value = model.config[key] -%}\n {%- do config_dict.update({key: value}) -%}\n {%- endfor -%}\nconfig_dict = {{ config_dict }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.848029, "supported_languages": null}, "macro.dbt.py_script_postfix": {"unique_id": "macro.dbt.py_script_postfix", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "py_script_postfix", "macro_sql": "{% macro py_script_postfix(model) %}\n# This part is user provided model code\n# you will need to copy the next section to run the code\n# COMMAND ----------\n# this part is dbt logic for get ref work, do not modify\n\n{{ build_ref_function(model ) }}\n{{ build_source_function(model ) }}\n{{ build_config_dict(model) }}\n\nclass config:\n def __init__(self, *args, **kwargs):\n pass\n\n @staticmethod\n def get(key, default=None):\n return config_dict.get(key, default)\n\nclass this:\n \"\"\"dbt.this() or dbt.this.identifier\"\"\"\n database = '{{ this.database }}'\n schema = '{{ this.schema }}'\n identifier = '{{ this.identifier }}'\n def __repr__(self):\n return '{{ this }}'\n\n\nclass dbtObj:\n def __init__(self, load_df_function) -> None:\n self.source = lambda *args: source(*args, dbt_load_df_function=load_df_function)\n self.ref = lambda *args: ref(*args, dbt_load_df_function=load_df_function)\n self.config = config\n self.this = this()\n self.is_incremental = {{ is_incremental() }}\n\n# COMMAND ----------\n{{py_script_comment()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.build_ref_function", "macro.dbt.build_source_function", "macro.dbt.build_config_dict", "macro.dbt.is_incremental", "macro.dbt.py_script_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.848438, "supported_languages": null}, "macro.dbt.py_script_comment": {"unique_id": "macro.dbt.py_script_comment", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "py_script_comment", "macro_sql": "{%macro py_script_comment()%}\n{%endmacro%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.84851, "supported_languages": null}, "macro.dbt.test_unique": {"unique_id": "macro.dbt.test_unique", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.849094, "supported_languages": null}, "macro.dbt.test_not_null": {"unique_id": "macro.dbt.test_not_null", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8493178, "supported_languages": null}, "macro.dbt.test_accepted_values": {"unique_id": "macro.dbt.test_accepted_values", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values', 'dbt') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.849591, "supported_languages": null}, "macro.dbt.test_relationships": {"unique_id": "macro.dbt.test_relationships", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships', 'dbt') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8498611, "supported_languages": null}, "macro.dbt_utils.xdb_deprecation_warning_without_replacement": {"unique_id": "macro.dbt_utils.xdb_deprecation_warning_without_replacement", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/deprecated/xdb_deprecation_warning.sql", "original_file_path": "macros/cross_db_utils/deprecated/xdb_deprecation_warning.sql", "name": "xdb_deprecation_warning_without_replacement", "macro_sql": "{% macro xdb_deprecation_warning_without_replacement(macro, package, model) %}\n {%- set error_message = \"Warning: the `\" ~ macro ~\"` macro is deprecated and will be removed in a future version of the package, once equivalent functionality is implemented in dbt Core. The \" ~ package ~ \".\" ~ model ~ \" model triggered this warning.\" -%}\n {%- do exceptions.warn(error_message) -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.850243, "supported_languages": null}, "macro.dbt_utils.get_url_host": {"unique_id": "macro.dbt_utils.get_url_host", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "name": "get_url_host", "macro_sql": "{% macro get_url_host(field) -%}\n {{ return(adapter.dispatch('get_url_host', 'dbt_utils')(field)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_host"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.850635, "supported_languages": null}, "macro.dbt_utils.default__get_url_host": {"unique_id": "macro.dbt_utils.default__get_url_host", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "name": "default__get_url_host", "macro_sql": "{% macro default__get_url_host(field) -%}\n\n{%- set parsed =\n split_part(\n split_part(\n replace(\n replace(\n replace(field, \"'android-app://'\", \"''\"\n ), \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n\n-%}\n\n\n {{ dbt.safe_cast(\n parsed,\n type_string()\n )}}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.split_part", "macro.dbt.replace", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.851137, "supported_languages": null}, "macro.dbt_utils.get_url_path": {"unique_id": "macro.dbt_utils.get_url_path", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "name": "get_url_path", "macro_sql": "{% macro get_url_path(field) -%}\n {{ return(adapter.dispatch('get_url_path', 'dbt_utils')(field)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_path"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.851636, "supported_languages": null}, "macro.dbt_utils.default__get_url_path": {"unique_id": "macro.dbt_utils.default__get_url_path", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "name": "default__get_url_path", "macro_sql": "{% macro default__get_url_path(field) -%}\n\n {%- set stripped_url =\n replace(\n replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{ position(\"'/'\", stripped_url) }}, 0),\n {{ position(\"'?'\", stripped_url) }} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n split_part(\n right(\n stripped_url,\n length(stripped_url) ~ \"-\" ~ first_slash_pos\n ),\n \"'?'\", 1\n )\n -%}\n\n {{ safe_cast(\n parsed_path,\n type_string()\n )}}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.position", "macro.dbt.split_part", "macro.dbt.right", "macro.dbt.length", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.852205, "supported_languages": null}, "macro.dbt_utils.get_url_parameter": {"unique_id": "macro.dbt_utils.get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "name": "get_url_parameter", "macro_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n {{ return(adapter.dispatch('get_url_parameter', 'dbt_utils')(field, url_parameter)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.852567, "supported_languages": null}, "macro.dbt_utils.default__get_url_parameter": {"unique_id": "macro.dbt_utils.default__get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "name": "default__get_url_parameter", "macro_sql": "{% macro default__get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = split_part(split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.852862, "supported_languages": null}, "macro.dbt_utils.test_fewer_rows_than": {"unique_id": "macro.dbt_utils.test_fewer_rows_than", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "name": "test_fewer_rows_than", "macro_sql": "{% test fewer_rows_than(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_fewer_rows_than', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_fewer_rows_than"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.853903, "supported_languages": null}, "macro.dbt_utils.default__test_fewer_rows_than": {"unique_id": "macro.dbt_utils.default__test_fewer_rows_than", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "name": "default__test_fewer_rows_than", "macro_sql": "{% macro default__test_fewer_rows_than(model, compare_model, group_by_columns) %}\n\n{{ config(fail_calc = 'sum(coalesce(row_count_delta, 0))') }}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in equal_rowcount. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_fewer_rows_than'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_our_model \n from {{ model }}\n {{ groupby_gb_cols }}\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_comparison_model \n from {{ compare_model }}\n {{ groupby_gb_cols }}\n\n),\ncounts as (\n\n select\n\n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_our_model,\n count_comparison_model\n from a\n full join b on \n a.id_dbtutils_test_fewer_rows_than = b.id_dbtutils_test_fewer_rows_than\n {{ join_gb_cols }}\n\n),\nfinal as (\n\n select *,\n case\n -- fail the test if we have more rows than the reference model and return the row count delta\n when count_our_model > count_comparison_model then (count_our_model - count_comparison_model)\n -- fail the test if they are the same number\n when count_our_model = count_comparison_model then 1\n -- pass the test if the delta is positive (i.e. return the number 0)\n else 0\n end as row_count_delta\n from counts\n\n)\n\nselect * from final\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8550599, "supported_languages": null}, "macro.dbt_utils.test_equal_rowcount": {"unique_id": "macro.dbt_utils.test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "name": "test_equal_rowcount", "macro_sql": "{% test equal_rowcount(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_equal_rowcount', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_equal_rowcount"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8560839, "supported_languages": null}, "macro.dbt_utils.default__test_equal_rowcount": {"unique_id": "macro.dbt_utils.default__test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "name": "default__test_equal_rowcount", "macro_sql": "{% macro default__test_equal_rowcount(model, compare_model, group_by_columns) %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = 'sum(coalesce(diff_count, 0))') }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(', ') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in fewer_rows_than. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_equal_rowcount'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_a \n from {{ model }}\n {{groupby_gb_cols}}\n\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_b \n from {{ compare_model }}\n {{groupby_gb_cols}}\n\n),\nfinal as (\n\n select\n \n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_a,\n count_b,\n abs(count_a - count_b) as diff_count\n\n from a\n full join b\n on\n a.id_dbtutils_test_equal_rowcount = b.id_dbtutils_test_equal_rowcount\n {{join_gb_cols}}\n\n\n)\n\nselect * from final\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.857192, "supported_languages": null}, "macro.dbt_utils.test_relationships_where": {"unique_id": "macro.dbt_utils.test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "name": "test_relationships_where", "macro_sql": "{% test relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n {{ return(adapter.dispatch('test_relationships_where', 'dbt_utils')(model, column_name, to, field, from_condition, to_condition)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_relationships_where"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8578959, "supported_languages": null}, "macro.dbt_utils.default__test_relationships_where": {"unique_id": "macro.dbt_utils.default__test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "name": "default__test_relationships_where", "macro_sql": "{% macro default__test_relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n\nwith left_table as (\n\n select\n {{column_name}} as id\n\n from {{model}}\n\n where {{column_name}} is not null\n and {{from_condition}}\n\n),\n\nright_table as (\n\n select\n {{field}} as id\n\n from {{to}}\n\n where {{field}} is not null\n and {{to_condition}}\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.858222, "supported_languages": null}, "macro.dbt_utils.test_recency": {"unique_id": "macro.dbt_utils.test_recency", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "name": "test_recency", "macro_sql": "{% test recency(model, field, datepart, interval, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_recency', 'dbt_utils')(model, field, datepart, interval, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_recency"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8588412, "supported_languages": null}, "macro.dbt_utils.default__test_recency": {"unique_id": "macro.dbt_utils.default__test_recency", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "name": "default__test_recency", "macro_sql": "{% macro default__test_recency(model, field, datepart, interval, group_by_columns) %}\n\n{% set threshold = dateadd(datepart, interval * -1, current_timestamp_backcompat()) %}\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nwith recency as (\n\n select \n\n {{ select_gb_cols }}\n max({{field}}) as most_recent\n\n from {{ model }}\n\n {{ groupby_gb_cols }}\n\n)\n\nselect\n\n {{ select_gb_cols }}\n most_recent,\n {{ threshold }} as threshold\n\nfrom recency\nwhere most_recent < {{ threshold }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.859479, "supported_languages": null}, "macro.dbt_utils.test_not_constant": {"unique_id": "macro.dbt_utils.test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "name": "test_not_constant", "macro_sql": "{% test not_constant(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_constant', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_constant"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8599749, "supported_languages": null}, "macro.dbt_utils.default__test_not_constant": {"unique_id": "macro.dbt_utils.default__test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "name": "default__test_not_constant", "macro_sql": "{% macro default__test_not_constant(model, column_name, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nselect\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count(distinct {{ column_name }}) as filler_column\n\nfrom {{ model }}\n\n {{groupby_gb_cols}}\n\nhaving count(distinct {{ column_name }}) = 1\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.860474, "supported_languages": null}, "macro.dbt_utils.test_accepted_range": {"unique_id": "macro.dbt_utils.test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "name": "test_accepted_range", "macro_sql": "{% test accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n {{ return(adapter.dispatch('test_accepted_range', 'dbt_utils')(model, column_name, min_value, max_value, inclusive)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_accepted_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8611772, "supported_languages": null}, "macro.dbt_utils.default__test_accepted_range": {"unique_id": "macro.dbt_utils.default__test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "name": "default__test_accepted_range", "macro_sql": "{% macro default__test_accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n\nwith meet_condition as(\n select *\n from {{ model }}\n),\n\nvalidation_errors as (\n select *\n from meet_condition\n where\n -- never true, defaults to an empty result set. Exists to ensure any combo of the `or` clauses below succeeds\n 1 = 2\n\n {%- if min_value is not none %}\n -- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} > {{- \"=\" if inclusive }} {{ min_value }}\n {%- endif %}\n\n {%- if max_value is not none %}\n -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} < {{- \"=\" if inclusive }} {{ max_value }}\n {%- endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.861645, "supported_languages": null}, "macro.dbt_utils.test_not_accepted_values": {"unique_id": "macro.dbt_utils.test_not_accepted_values", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "name": "test_not_accepted_values", "macro_sql": "{% test not_accepted_values(model, column_name, values, quote=True) %}\n {{ return(adapter.dispatch('test_not_accepted_values', 'dbt_utils')(model, column_name, values, quote)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8622332, "supported_languages": null}, "macro.dbt_utils.default__test_not_accepted_values": {"unique_id": "macro.dbt_utils.default__test_not_accepted_values", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "name": "default__test_not_accepted_values", "macro_sql": "{% macro default__test_not_accepted_values(model, column_name, values, quote=True) %}\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.862705, "supported_languages": null}, "macro.dbt_utils.test_at_least_one": {"unique_id": "macro.dbt_utils.test_at_least_one", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "name": "test_at_least_one", "macro_sql": "{% test at_least_one(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_at_least_one', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_at_least_one"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8632078, "supported_languages": null}, "macro.dbt_utils.default__test_at_least_one": {"unique_id": "macro.dbt_utils.default__test_at_least_one", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "name": "default__test_at_least_one", "macro_sql": "{% macro default__test_at_least_one(model, column_name, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nselect *\nfrom (\n select\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count({{ column_name }}) as filler_column\n\n from {{ model }}\n\n {{groupby_gb_cols}}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.86365, "supported_languages": null}, "macro.dbt_utils.test_unique_combination_of_columns": {"unique_id": "macro.dbt_utils.test_unique_combination_of_columns", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "name": "test_unique_combination_of_columns", "macro_sql": "{% test unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n {{ return(adapter.dispatch('test_unique_combination_of_columns', 'dbt_utils')(model, combination_of_columns, quote_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_combination_of_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.864301, "supported_languages": null}, "macro.dbt_utils.default__test_unique_combination_of_columns": {"unique_id": "macro.dbt_utils.default__test_unique_combination_of_columns", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "name": "default__test_unique_combination_of_columns", "macro_sql": "{% macro default__test_unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n\n{% if not quote_columns %}\n {%- set column_list=combination_of_columns %}\n{% elif quote_columns %}\n {%- set column_list=[] %}\n {% for column in combination_of_columns -%}\n {% set column_list = column_list.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set columns_csv=column_list | join(', ') %}\n\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.864922, "supported_languages": null}, "macro.dbt_utils.test_cardinality_equality": {"unique_id": "macro.dbt_utils.test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "name": "test_cardinality_equality", "macro_sql": "{% test cardinality_equality(model, column_name, to, field) %}\n {{ return(adapter.dispatch('test_cardinality_equality', 'dbt_utils')(model, column_name, to, field)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_cardinality_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.865514, "supported_languages": null}, "macro.dbt_utils.default__test_cardinality_equality": {"unique_id": "macro.dbt_utils.default__test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "name": "default__test_cardinality_equality", "macro_sql": "{% macro default__test_cardinality_equality(model, column_name, to, field) %}\n\n{# T-SQL does not let you use numbers as aliases for columns #}\n{# Thus, no \"GROUP BY 1\" #}\n\nwith table_a as (\nselect\n {{ column_name }},\n count(*) as num_rows\nfrom {{ model }}\ngroup by {{ column_name }}\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by {{ field }}\n),\n\nexcept_a as (\n select *\n from table_a\n {{ except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ except() }}\n select *\n from table_a\n),\n\nunioned as (\n select *\n from except_a\n union all\n select *\n from except_b\n)\n\nselect *\nfrom unioned\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8658261, "supported_languages": null}, "macro.dbt_utils.test_expression_is_true": {"unique_id": "macro.dbt_utils.test_expression_is_true", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "name": "test_expression_is_true", "macro_sql": "{% test expression_is_true(model, expression, column_name=None, condition='1=1') %}\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n {{ return(adapter.dispatch('test_expression_is_true', 'dbt_utils')(model, expression, column_name, condition)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.866348, "supported_languages": null}, "macro.dbt_utils.default__test_expression_is_true": {"unique_id": "macro.dbt_utils.default__test_expression_is_true", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "name": "default__test_expression_is_true", "macro_sql": "{% macro default__test_expression_is_true(model, expression, column_name, condition) %}\n\n{% set column_list = '*' if should_store_failures() else \"1\" %}\n\nwith meet_condition as (\n select * from {{ model }} where {{ condition }}\n)\n\nselect\n {{ column_list }}\nfrom meet_condition\n{% if column_name is none %}\nwhere not({{ expression }})\n{%- else %}\nwhere not({{ column_name }} {{ expression }})\n{%- endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.866724, "supported_languages": null}, "macro.dbt_utils.test_not_null_proportion": {"unique_id": "macro.dbt_utils.test_not_null_proportion", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "name": "test_not_null_proportion", "macro_sql": "{% macro test_not_null_proportion(model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_null_proportion', 'dbt_utils')(model, group_by_columns, **kwargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_proportion"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.867383, "supported_languages": null}, "macro.dbt_utils.default__test_not_null_proportion": {"unique_id": "macro.dbt_utils.default__test_not_null_proportion", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "name": "default__test_not_null_proportion", "macro_sql": "{% macro default__test_not_null_proportion(model, group_by_columns) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n{% set at_least = kwargs.get('at_least', kwargs.get('arg')) %}\n{% set at_most = kwargs.get('at_most', kwargs.get('arg', 1)) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith validation as (\n select\n {{select_gb_cols}}\n sum(case when {{ column_name }} is null then 0 else 1 end) / cast(count(*) as numeric) as not_null_proportion\n from {{ model }}\n {{groupby_gb_cols}}\n),\nvalidation_errors as (\n select\n {{select_gb_cols}}\n not_null_proportion\n from validation\n where not_null_proportion < {{ at_least }} or not_null_proportion > {{ at_most }}\n)\nselect\n *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.868204, "supported_languages": null}, "macro.dbt_utils.test_sequential_values": {"unique_id": "macro.dbt_utils.test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "name": "test_sequential_values", "macro_sql": "{% test sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n {{ return(adapter.dispatch('test_sequential_values', 'dbt_utils')(model, column_name, interval, datepart, group_by_columns)) }}\n\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_sequential_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.869205, "supported_languages": null}, "macro.dbt_utils.default__test_sequential_values": {"unique_id": "macro.dbt_utils.default__test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "name": "default__test_sequential_values", "macro_sql": "{% macro default__test_sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n{% set previous_column_name = \"previous_\" ~ dbt_utils.slugify(column_name) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(',') + ', ' %}\n {% set partition_gb_cols = 'partition by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith windowed as (\n\n select\n {{ select_gb_cols }}\n {{ column_name }},\n lag({{ column_name }}) over (\n {{partition_gb_cols}}\n order by {{ column_name }}\n ) as {{ previous_column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ type_timestamp() }})= cast({{ dateadd(datepart, interval, previous_column_name) }} as {{ type_timestamp() }}))\n {% else %}\n where not({{ column_name }} = {{ previous_column_name }} + {{ interval }})\n {% endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.slugify", "macro.dbt.type_timestamp", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.870076, "supported_languages": null}, "macro.dbt_utils.test_equality": {"unique_id": "macro.dbt_utils.test_equality", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "name": "test_equality", "macro_sql": "{% test equality(model, compare_model, compare_columns=None) %}\n {{ return(adapter.dispatch('test_equality', 'dbt_utils')(model, compare_model, compare_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.870859, "supported_languages": null}, "macro.dbt_utils.default__test_equality": {"unique_id": "macro.dbt_utils.default__test_equality", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "name": "default__test_equality", "macro_sql": "{% macro default__test_equality(model, compare_model, compare_columns=None) %}\n\n{% set set_diff %}\n count(*) + coalesce(abs(\n sum(case when which_diff = 'a_minus_b' then 1 else 0 end) -\n sum(case when which_diff = 'b_minus_a' then 1 else 0 end)\n ), 0)\n{% endset %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = set_diff) }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n-- setup\n{%- do dbt_utils._is_relation(model, 'test_equality') -%}\n\n{#-\nIf the compare_cols arg is provided, we can run this test without querying the\ninformation schema\u00a0\u2014 this allows the model to be an ephemeral model\n-#}\n\n{%- if not compare_columns -%}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set compare_columns = adapter.get_columns_in_relation(model) | map(attribute='quoted') -%}\n{%- endif -%}\n\n{% set compare_cols_csv = compare_columns | join(', ') %}\n\nwith a as (\n\n select * from {{ model }}\n\n),\n\nb as (\n\n select * from {{ compare_model }}\n\n),\n\na_minus_b as (\n\n select {{compare_cols_csv}} from a\n {{ except() }}\n select {{compare_cols_csv}} from b\n\n),\n\nb_minus_a as (\n\n select {{compare_cols_csv}} from b\n {{ except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select 'a_minus_b' as which_diff, a_minus_b.* from a_minus_b\n union all\n select 'b_minus_a' as which_diff, b_minus_a.* from b_minus_a\n\n)\n\nselect * from unioned\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.871711, "supported_languages": null}, "macro.dbt_utils.test_not_empty_string": {"unique_id": "macro.dbt_utils.test_not_empty_string", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "name": "test_not_empty_string", "macro_sql": "{% test not_empty_string(model, column_name, trim_whitespace=true) %}\n\n {{ return(adapter.dispatch('test_not_empty_string', 'dbt_utils')(model, column_name, trim_whitespace)) }}\n\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_empty_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8722649, "supported_languages": null}, "macro.dbt_utils.default__test_not_empty_string": {"unique_id": "macro.dbt_utils.default__test_not_empty_string", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "name": "default__test_not_empty_string", "macro_sql": "{% macro default__test_not_empty_string(model, column_name, trim_whitespace=true) %}\n\n with\n \n all_values as (\n\n select \n\n\n {% if trim_whitespace == true -%}\n\n trim({{ column_name }}) as {{ column_name }}\n\n {%- else -%}\n\n {{ column_name }}\n\n {%- endif %}\n \n from {{ model }}\n\n ),\n\n errors as (\n\n select * from all_values\n where {{ column_name }} = ''\n\n )\n\n select * from errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8725471, "supported_languages": null}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "name": "test_mutually_exclusive_ranges", "macro_sql": "{% test mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', 'dbt_utils')(model, lower_bound_column, upper_bound_column, partition_by, gaps, zero_length_range_allowed)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_mutually_exclusive_ranges"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8757892, "supported_languages": null}, "macro.dbt_utils.default__test_mutually_exclusive_ranges": {"unique_id": "macro.dbt_utils.default__test_mutually_exclusive_ranges", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "name": "default__test_mutually_exclusive_ranges", "macro_sql": "{% macro default__test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n{% if gaps == 'not_allowed' %}\n {% set allow_gaps_operator='=' %}\n {% set allow_gaps_operator_in_words='equal_to' %}\n{% elif gaps == 'allowed' %}\n {% set allow_gaps_operator='<=' %}\n {% set allow_gaps_operator_in_words='less_than_or_equal_to' %}\n{% elif gaps == 'required' %}\n {% set allow_gaps_operator='<' %}\n {% set allow_gaps_operator_in_words='less_than' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '\" ~ gaps ~\"'.'\"\n ) }}\n{% endif %}\n{% if not zero_length_range_allowed %}\n {% set allow_zero_length_operator='<' %}\n {% set allow_zero_length_operator_in_words='less_than' %}\n{% elif zero_length_range_allowed %}\n {% set allow_zero_length_operator='<=' %}\n {% set allow_zero_length_operator_in_words='less_than_or_equal_to' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`zero_length_range_allowed` argument for mutually_exclusive_ranges test must be one of [true, false] Got: '\" ~ zero_length_range_allowed ~\"'.'\"\n ) }}\n{% endif %}\n\n{% set partition_clause=\"partition by \" ~ partition_by if partition_by else '' %}\n\nwith window_functions as (\n\n select\n {% if partition_by %}\n {{ partition_by }} as partition_by_col,\n {% endif %}\n {{ lower_bound_column }} as lower_bound,\n {{ upper_bound_column }} as upper_bound,\n\n lead({{ lower_bound_column }}) over (\n {{ partition_clause }}\n order by {{ lower_bound_column }}, {{ upper_bound_column }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_bound_column }} desc, {{ upper_bound_column }} desc\n ) = 1 as is_last_record\n\n from {{ model }}\n\n),\n\ncalc as (\n -- We want to return records where one of our assumptions fails, so we'll use\n -- the `not` function with `and` statements so we can write our assumptions more cleanly\n select\n *,\n\n -- For each record: lower_bound should be < upper_bound.\n -- Coalesce it to return an error on the null case (implicit assumption\n -- these columns are not_null)\n coalesce(\n lower_bound {{ allow_zero_length_operator }} upper_bound,\n false\n ) as lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect * from validation_errors\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.877408, "supported_languages": null}, "macro.dbt_utils.pretty_log_format": {"unique_id": "macro.dbt_utils.pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "name": "pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n {{ return(adapter.dispatch('pretty_log_format', 'dbt_utils')(message)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.877815, "supported_languages": null}, "macro.dbt_utils.default__pretty_log_format": {"unique_id": "macro.dbt_utils.default__pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "name": "default__pretty_log_format", "macro_sql": "{% macro default__pretty_log_format(message) %}\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.877989, "supported_languages": null}, "macro.dbt_utils._is_relation": {"unique_id": "macro.dbt_utils._is_relation", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/_is_relation.sql", "original_file_path": "macros/jinja_helpers/_is_relation.sql", "name": "_is_relation", "macro_sql": "{% macro _is_relation(obj, macro) %}\n {%- if not (obj is mapping and obj.get('metadata', {}).get('type', '').endswith('Relation')) -%}\n {%- do exceptions.raise_compiler_error(\"Macro \" ~ macro ~ \" expected a Relation but received the value: \" ~ obj) -%}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8785121, "supported_languages": null}, "macro.dbt_utils.pretty_time": {"unique_id": "macro.dbt_utils.pretty_time", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "name": "pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n {{ return(adapter.dispatch('pretty_time', 'dbt_utils')(format)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.878845, "supported_languages": null}, "macro.dbt_utils.default__pretty_time": {"unique_id": "macro.dbt_utils.default__pretty_time", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "name": "default__pretty_time", "macro_sql": "{% macro default__pretty_time(format='%H:%M:%S') %}\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8790421, "supported_languages": null}, "macro.dbt_utils.log_info": {"unique_id": "macro.dbt_utils.log_info", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "name": "log_info", "macro_sql": "{% macro log_info(message) %}\n {{ return(adapter.dispatch('log_info', 'dbt_utils')(message)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__log_info"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.879354, "supported_languages": null}, "macro.dbt_utils.default__log_info": {"unique_id": "macro.dbt_utils.default__log_info", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "name": "default__log_info", "macro_sql": "{% macro default__log_info(message) %}\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.879522, "supported_languages": null}, "macro.dbt_utils.slugify": {"unique_id": "macro.dbt_utils.slugify", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/slugify.sql", "original_file_path": "macros/jinja_helpers/slugify.sql", "name": "slugify", "macro_sql": "{% macro slugify(string) %}\n\n{#- Lower case the string -#}\n{% set string = string | lower %}\n{#- Replace spaces and dashes with underscores -#}\n{% set string = modules.re.sub('[ -]+', '_', string) %}\n{#- Only take letters, numbers, and underscores -#}\n{% set string = modules.re.sub('[^a-z0-9_]+', '', string) %}\n\n{{ return(string) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.880039, "supported_languages": null}, "macro.dbt_utils._is_ephemeral": {"unique_id": "macro.dbt_utils._is_ephemeral", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/_is_ephemeral.sql", "original_file_path": "macros/jinja_helpers/_is_ephemeral.sql", "name": "_is_ephemeral", "macro_sql": "{% macro _is_ephemeral(obj, macro) %}\n {%- if obj.is_cte -%}\n {% set ephemeral_prefix = api.Relation.add_ephemeral_prefix('') %}\n {% if obj.name.startswith(ephemeral_prefix) %}\n {% set model_name = obj.name[(ephemeral_prefix|length):] %}\n {% else %}\n {% set model_name = obj.name %}\n {%- endif -%}\n {% set error_message %}\nThe `{{ macro }}` macro cannot be used with ephemeral models, as it relies on the information schema.\n\n`{{ model_name }}` is an ephemeral model. Consider making it a view or table instead.\n {% endset %}\n {%- do exceptions.raise_compiler_error(error_message) -%}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8808901, "supported_languages": null}, "macro.dbt_utils.get_intervals_between": {"unique_id": "macro.dbt_utils.get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_utils')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.881589, "supported_languages": null}, "macro.dbt_utils.default__get_intervals_between": {"unique_id": "macro.dbt_utils.default__get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.882171, "supported_languages": null}, "macro.dbt_utils.date_spine": {"unique_id": "macro.dbt_utils.date_spine", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_utils')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.882401, "supported_languages": null}, "macro.dbt_utils.default__date_spine": {"unique_id": "macro.dbt_utils.default__date_spine", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{dbt_utils.generate_series(\n dbt_utils.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n),\n\nall_periods as (\n\n select (\n {{\n dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.generate_series", "macro.dbt_utils.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.882752, "supported_languages": null}, "macro.dbt_utils.nullcheck_table": {"unique_id": "macro.dbt_utils.nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "name": "nullcheck_table", "macro_sql": "{% macro nullcheck_table(relation) %}\n {{ return(adapter.dispatch('nullcheck_table', 'dbt_utils')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.883142, "supported_languages": null}, "macro.dbt_utils.default__nullcheck_table": {"unique_id": "macro.dbt_utils.default__nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "name": "default__nullcheck_table", "macro_sql": "{% macro default__nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(relation, 'nullcheck_table') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'nullcheck_table') -%}\n {% set cols = adapter.get_columns_in_relation(relation) %}\n\n select {{ dbt_utils.nullcheck(cols) }}\n from {{relation}}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.883498, "supported_languages": null}, "macro.dbt_utils.get_relations_by_pattern": {"unique_id": "macro.dbt_utils.get_relations_by_pattern", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "name": "get_relations_by_pattern", "macro_sql": "{% macro get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_pattern', 'dbt_utils')(schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.884325, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_pattern": {"unique_id": "macro.dbt_utils.default__get_relations_by_pattern", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "name": "default__get_relations_by_pattern", "macro_sql": "{% macro default__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8852842, "supported_languages": null}, "macro.dbt_utils.get_powers_of_two": {"unique_id": "macro.dbt_utils.get_powers_of_two", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8862028, "supported_languages": null}, "macro.dbt_utils.default__get_powers_of_two": {"unique_id": "macro.dbt_utils.default__get_powers_of_two", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.886629, "supported_languages": null}, "macro.dbt_utils.generate_series": {"unique_id": "macro.dbt_utils.generate_series", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.886816, "supported_languages": null}, "macro.dbt_utils.default__generate_series": {"unique_id": "macro.dbt_utils.default__generate_series", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_utils.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8873138, "supported_languages": null}, "macro.dbt_utils.get_relations_by_prefix": {"unique_id": "macro.dbt_utils.get_relations_by_prefix", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "name": "get_relations_by_prefix", "macro_sql": "{% macro get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_prefix', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.888022, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_prefix": {"unique_id": "macro.dbt_utils.default__get_relations_by_prefix", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "name": "default__get_relations_by_prefix", "macro_sql": "{% macro default__get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_prefix_sql(schema, prefix, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.888832, "supported_languages": null}, "macro.dbt_utils.get_tables_by_prefix_sql": {"unique_id": "macro.dbt_utils.get_tables_by_prefix_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "name": "get_tables_by_prefix_sql", "macro_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_prefix_sql', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8892941, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_prefix_sql": {"unique_id": "macro.dbt_utils.default__get_tables_by_prefix_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "name": "default__get_tables_by_prefix_sql", "macro_sql": "{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(\n schema_pattern = schema,\n table_pattern = prefix ~ '%',\n exclude = exclude,\n database = database\n ) }}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.889586, "supported_languages": null}, "macro.dbt_utils.star": {"unique_id": "macro.dbt_utils.star", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "name": "star", "macro_sql": "{% macro star(from, relation_alias=False, except=[], prefix='', suffix='') -%}\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, prefix, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8903198, "supported_languages": null}, "macro.dbt_utils.default__star": {"unique_id": "macro.dbt_utils.default__star", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "name": "default__star", "macro_sql": "{% macro default__star(from, relation_alias=False, except=[], prefix='', suffix='') -%}\n {%- do dbt_utils._is_relation(from, 'star') -%}\n {%- do dbt_utils._is_ephemeral(from, 'star') -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return('*') }}\n {%- endif -%}\n\n {% set cols = dbt_utils.get_filtered_columns_in_relation(from, except) %}\n\n {%- if cols|length <= 0 -%}\n {{- return('*') -}}\n {%- else -%}\n {%- for col in cols %}\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}{{ adapter.quote(col)|trim }} {%- if prefix!='' or suffix!='' %} as {{ adapter.quote(prefix ~ col ~ suffix)|trim }} {%- endif -%}\n {%- if not loop.last %},{{ '\\n ' }}{% endif %}\n {%- endfor -%}\n {% endif %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.891268, "supported_languages": null}, "macro.dbt_utils.unpivot": {"unique_id": "macro.dbt_utils.unpivot", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "name": "unpivot", "macro_sql": "{% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value') -%}\n {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.892538, "supported_languages": null}, "macro.dbt_utils.default__unpivot": {"unique_id": "macro.dbt_utils.default__unpivot", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "name": "default__unpivot", "macro_sql": "{% macro default__unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value') -%}\n\n {% if not relation %}\n {{ exceptions.raise_compiler_error(\"Error: argument `relation` is required for `unpivot` macro.\") }}\n {% endif %}\n\n {%- set exclude = exclude if exclude is not none else [] %}\n {%- set remove = remove if remove is not none else [] %}\n\n {%- set include_cols = [] %}\n\n {%- set table_columns = {} %}\n\n {%- do table_columns.update({relation: []}) %}\n\n {%- do dbt_utils._is_relation(relation, 'unpivot') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'unpivot') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) %}\n\n {%- for col in cols -%}\n {%- if col.column.lower() not in remove|map('lower') and col.column.lower() not in exclude|map('lower') -%}\n {% do include_cols.append(col) %}\n {%- endif %}\n {%- endfor %}\n\n\n {%- for col in include_cols -%}\n select\n {%- for exclude_col in exclude %}\n {{ exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ type_string() }}) as {{ field_name }},\n cast( {% if col.data_type == 'boolean' %}\n {{ cast_bool_to_text(col.column) }}\n {% else %}\n {{ col.column }}\n {% endif %}\n as {{ cast_to }}) as {{ value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_string", "macro.dbt.cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.89451, "supported_languages": null}, "macro.dbt_utils.union_relations": {"unique_id": "macro.dbt_utils.union_relations", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "name": "union_relations", "macro_sql": "{%- macro union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n {{ return(adapter.dispatch('union_relations', 'dbt_utils')(relations, column_override, include, exclude, source_column_name, where)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.897519, "supported_languages": null}, "macro.dbt_utils.default__union_relations": {"unique_id": "macro.dbt_utils.default__union_relations", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "name": "default__union_relations", "macro_sql": "\n\n{%- macro default__union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n cast({{ string_literal(relation) }} as {{ type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ relation }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9008808, "supported_languages": null}, "macro.dbt_utils.group_by": {"unique_id": "macro.dbt_utils.group_by", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "name": "group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_utils')(n)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.901247, "supported_languages": null}, "macro.dbt_utils.default__group_by": {"unique_id": "macro.dbt_utils.default__group_by", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "name": "default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }} \n {%- endfor -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.901493, "supported_languages": null}, "macro.dbt_utils.deduplicate": {"unique_id": "macro.dbt_utils.deduplicate", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "deduplicate", "macro_sql": "{%- macro deduplicate(relation, partition_by, order_by) -%}\n {{ return(adapter.dispatch('deduplicate', 'dbt_utils')(relation, partition_by, order_by)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.902269, "supported_languages": null}, "macro.dbt_utils.default__deduplicate": {"unique_id": "macro.dbt_utils.default__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "default__deduplicate", "macro_sql": "\n\n{%- macro default__deduplicate(relation, partition_by, order_by) -%}\n\n with row_numbered as (\n select\n _inner.*,\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) as rn\n from {{ relation }} as _inner\n )\n\n select\n distinct data.*\n from {{ relation }} as data\n {#\n -- Not all DBs will support natural joins but the ones that do include:\n -- Oracle, MySQL, SQLite, Redshift, Teradata, Materialize, Databricks\n -- Apache Spark, SingleStore, Vertica\n -- Those that do not appear to support natural joins include:\n -- SQLServer, Trino, Presto, Rockset, Athena\n #}\n natural join row_numbered\n where row_numbered.rn = 1\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9024792, "supported_languages": null}, "macro.dbt_utils.redshift__deduplicate": {"unique_id": "macro.dbt_utils.redshift__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "redshift__deduplicate", "macro_sql": "{% macro redshift__deduplicate(relation, partition_by, order_by) -%}\n\n {{ return(dbt_utils.default__deduplicate(relation, partition_by, order_by=order_by)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.902677, "supported_languages": null}, "macro.dbt_utils.postgres__deduplicate": {"unique_id": "macro.dbt_utils.postgres__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "postgres__deduplicate", "macro_sql": "\n{%- macro postgres__deduplicate(relation, partition_by, order_by) -%}\n\n select\n distinct on ({{ partition_by }}) *\n from {{ relation }}\n order by {{ partition_by }}{{ ',' ~ order_by }}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.902865, "supported_languages": null}, "macro.dbt_utils.snowflake__deduplicate": {"unique_id": "macro.dbt_utils.snowflake__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "snowflake__deduplicate", "macro_sql": "\n{%- macro snowflake__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.903027, "supported_languages": null}, "macro.dbt_utils.bigquery__deduplicate": {"unique_id": "macro.dbt_utils.bigquery__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "bigquery__deduplicate", "macro_sql": "\n{%- macro bigquery__deduplicate(relation, partition_by, order_by) -%}\n\n select unique.*\n from (\n select\n array_agg (\n original\n order by {{ order_by }}\n limit 1\n )[offset(0)] unique\n from {{ relation }} original\n group by {{ partition_by }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.903193, "supported_languages": null}, "macro.dbt_utils.surrogate_key": {"unique_id": "macro.dbt_utils.surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "name": "surrogate_key", "macro_sql": "{%- macro surrogate_key(field_list) -%}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('surrogate_key', 'dbt_utils')(field_list, *varargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9036312, "supported_languages": null}, "macro.dbt_utils.default__surrogate_key": {"unique_id": "macro.dbt_utils.default__surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "name": "default__surrogate_key", "macro_sql": "\n\n{%- macro default__surrogate_key(field_list) -%}\n\n{%- set error_message = '\nWarning: `dbt_utils.surrogate_key` has been replaced by \\\n`dbt_utils.generate_surrogate_key`. The new macro treats null values \\\ndifferently to empty strings. To restore the behaviour of the original \\\nmacro, add a variable scoped to the dbt_utils package called \\\n`surrogate_key_treat_nulls_as_empty_strings` to your \\\ndbt_project.yml file with a value of True. \\\nThe {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9039848, "supported_languages": null}, "macro.dbt_utils.safe_add": {"unique_id": "macro.dbt_utils.safe_add", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "name": "safe_add", "macro_sql": "{%- macro safe_add(field_list) -%}\n {{ return(adapter.dispatch('safe_add', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__safe_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9045918, "supported_languages": null}, "macro.dbt_utils.default__safe_add": {"unique_id": "macro.dbt_utils.default__safe_add", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "name": "default__safe_add", "macro_sql": "\n\n{%- macro default__safe_add(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_add` macro now takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.warn(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9051762, "supported_languages": null}, "macro.dbt_utils.nullcheck": {"unique_id": "macro.dbt_utils.nullcheck", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "name": "nullcheck", "macro_sql": "{% macro nullcheck(cols) %}\n {{ return(adapter.dispatch('nullcheck', 'dbt_utils')(cols)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9056, "supported_languages": null}, "macro.dbt_utils.default__nullcheck": {"unique_id": "macro.dbt_utils.default__nullcheck", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "name": "default__nullcheck", "macro_sql": "{% macro default__nullcheck(cols) %}\n{%- for col in cols %}\n\n {% if col.is_string() -%}\n\n nullif({{col.name}},'') as {{col.name}}\n\n {%- else -%}\n\n {{col.name}}\n\n {%- endif -%}\n\n{%- if not loop.last -%} , {%- endif -%}\n\n{%- endfor -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9059331, "supported_languages": null}, "macro.dbt_utils.get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "get_tables_by_pattern_sql", "macro_sql": "{% macro get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_pattern_sql', 'dbt_utils')\n (schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.907543, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.default__get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "default__get_tables_by_pattern_sql", "macro_sql": "{% macro default__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.907915, "supported_languages": null}, "macro.dbt_utils.bigquery__get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.bigquery__get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "bigquery__get_tables_by_pattern_sql", "macro_sql": "{% macro bigquery__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% if '%' in schema_pattern %}\n {% set schemata=dbt_utils._bigquery__get_matching_schemata(schema_pattern, database) %}\n {% else %}\n {% set schemata=[schema_pattern] %}\n {% endif %}\n\n {% set sql %}\n {% for schema in schemata %}\n select distinct\n table_schema,\n table_name,\n {{ dbt_utils.get_table_types_sql() }}\n\n from {{ adapter.quote(database) }}.{{ schema }}.INFORMATION_SCHEMA.TABLES\n where lower(table_name) like lower ('{{ table_pattern }}')\n and lower(table_name) not like lower ('{{ exclude }}')\n\n {% if not loop.last %} union all {% endif %}\n\n {% endfor %}\n {% endset %}\n\n {{ return(sql) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._bigquery__get_matching_schemata", "macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.908704, "supported_languages": null}, "macro.dbt_utils._bigquery__get_matching_schemata": {"unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "_bigquery__get_matching_schemata", "macro_sql": "{% macro _bigquery__get_matching_schemata(schema_pattern, database) %}\n {% if execute %}\n\n {% set sql %}\n select schema_name from {{ adapter.quote(database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like lower('{{ schema_pattern }}')\n {% endset %}\n\n {% set results=run_query(sql) %}\n\n {% set schemata=results.columns['schema_name'].values() %}\n\n {{ return(schemata) }}\n\n {% else %}\n\n {{ return([]) }}\n\n {% endif %}\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.909206, "supported_languages": null}, "macro.dbt_utils.get_column_values": {"unique_id": "macro.dbt_utils.get_column_values", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "name": "get_column_values", "macro_sql": "{% macro get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {{ return(adapter.dispatch('get_column_values', 'dbt_utils')(table, column, order_by, max_records, default, where)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_column_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9103029, "supported_languages": null}, "macro.dbt_utils.default__get_column_values": {"unique_id": "macro.dbt_utils.default__get_column_values", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "name": "default__get_column_values", "macro_sql": "{% macro default__get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {% set default = [] if not default %}\n {{ return(default) }}\n {% endif %}\n\n {%- do dbt_utils._is_ephemeral(table, 'get_column_values') -%}\n\n {# Not all relations are tables. Renaming for internal clarity without breaking functionality for anyone using named arguments #}\n {# TODO: Change the method signature in a future 0.x.0 release #}\n {%- set target_relation = table -%}\n\n {# adapter.load_relation is a convenience wrapper to avoid building a Relation when we already have one #}\n {% set relation_exists = (load_relation(target_relation)) is not none %}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not relation_exists and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ target_relation ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not relation_exists and default is not none -%}\n\n {{ log(\"Relation \" ~ target_relation ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n\n {% if where is not none %}\n where {{ where }}\n {% endif %}\n\n group by {{ column }}\n order by {{ order_by }}\n\n {% if max_records is not none %}\n limit {{ max_records }}\n {% endif %}\n\n {% endif %}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_column_values') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values) }}\n {%- else -%}\n {{ return(default) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_ephemeral", "macro.dbt.load_relation", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.911798, "supported_languages": null}, "macro.dbt_utils.pivot": {"unique_id": "macro.dbt_utils.pivot", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "name": "pivot", "macro_sql": "{% macro pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {{ return(adapter.dispatch('pivot', 'dbt_utils')(column, values, alias, agg, cmp, prefix, suffix, then_value, else_value, quote_identifiers, distinct)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.912878, "supported_languages": null}, "macro.dbt_utils.default__pivot": {"unique_id": "macro.dbt_utils.default__pivot", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "name": "default__pivot", "macro_sql": "{% macro default__pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {% for value in values %}\n {{ agg }}(\n {% if distinct %} distinct {% endif %}\n case\n when {{ column }} {{ cmp }} '{{ escape_single_quotes(value) }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ value ~ suffix) }}\n {% else %}\n as {{ dbt_utils.slugify(prefix ~ value ~ suffix) }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.escape_single_quotes", "macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.913687, "supported_languages": null}, "macro.dbt_utils.get_filtered_columns_in_relation": {"unique_id": "macro.dbt_utils.get_filtered_columns_in_relation", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "name": "get_filtered_columns_in_relation", "macro_sql": "{% macro get_filtered_columns_in_relation(from, except=[]) -%}\n {{ return(adapter.dispatch('get_filtered_columns_in_relation', 'dbt_utils')(from, except)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.914192, "supported_languages": null}, "macro.dbt_utils.default__get_filtered_columns_in_relation": {"unique_id": "macro.dbt_utils.default__get_filtered_columns_in_relation", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "name": "default__get_filtered_columns_in_relation", "macro_sql": "{% macro default__get_filtered_columns_in_relation(from, except=[]) -%}\n {%- do dbt_utils._is_relation(from, 'get_filtered_columns_in_relation') -%}\n {%- do dbt_utils._is_ephemeral(from, 'get_filtered_columns_in_relation') -%}\n\n {# -- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return('') }}\n {% endif %}\n\n {%- set include_cols = [] %}\n {%- set cols = adapter.get_columns_in_relation(from) -%}\n {%- set except = except | map(\"lower\") | list %}\n {%- for col in cols -%}\n {%- if col.column|lower not in except -%}\n {% do include_cols.append(col.column) %}\n {%- endif %}\n {%- endfor %}\n\n {{ return(include_cols) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9149, "supported_languages": null}, "macro.dbt_utils.width_bucket": {"unique_id": "macro.dbt_utils.width_bucket", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "name": "width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ return(adapter.dispatch('width_bucket', 'dbt_utils') (expr, min_value, max_value, num_buckets)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__width_bucket"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.916281, "supported_languages": null}, "macro.dbt_utils.default__width_bucket": {"unique_id": "macro.dbt_utils.default__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "name": "default__width_bucket", "macro_sql": "{% macro default__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is eaxtly at the bucket egde\n case\n when\n mod(\n {{ dbt.safe_cast(expr, type_numeric() ) }},\n {{ dbt.safe_cast(bin_size, type_numeric() ) }}\n ) = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.916712, "supported_languages": null}, "macro.dbt_utils.redshift__width_bucket": {"unique_id": "macro.dbt_utils.redshift__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "name": "redshift__width_bucket", "macro_sql": "{% macro redshift__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is exactly at the bucket edge\n case\n when\n {{ dbt.safe_cast(expr, type_numeric() ) }} %\n {{ dbt.safe_cast(bin_size, type_numeric() ) }}\n = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.917154, "supported_languages": null}, "macro.dbt_utils.snowflake__width_bucket": {"unique_id": "macro.dbt_utils.snowflake__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "name": "snowflake__width_bucket", "macro_sql": "{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.917347, "supported_languages": null}, "macro.dbt_utils.get_query_results_as_dict": {"unique_id": "macro.dbt_utils.get_query_results_as_dict", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "name": "get_query_results_as_dict", "macro_sql": "{% macro get_query_results_as_dict(query) %}\n {{ return(adapter.dispatch('get_query_results_as_dict', 'dbt_utils')(query)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_query_results_as_dict"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9177759, "supported_languages": null}, "macro.dbt_utils.default__get_query_results_as_dict": {"unique_id": "macro.dbt_utils.default__get_query_results_as_dict", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "name": "default__get_query_results_as_dict", "macro_sql": "{% macro default__get_query_results_as_dict(query) %}\n\n{# This macro returns a dictionary of the form {column_name: (tuple_of_results)} #}\n\n {%- call statement('get_query_results', fetch_result=True,auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {% set sql_results={} %}\n\n {%- if execute -%}\n {% set sql_results_table = load_result('get_query_results').table.columns %}\n {% for column_name, column in sql_results_table.items() %}\n {% do sql_results.update({column_name: column.values()}) %}\n {% endfor %}\n {%- endif -%}\n\n {{ return(sql_results) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.918365, "supported_languages": null}, "macro.dbt_utils.generate_surrogate_key": {"unique_id": "macro.dbt_utils.generate_surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "name": "generate_surrogate_key", "macro_sql": "{%- macro generate_surrogate_key(field_list) -%}\n {{ return(adapter.dispatch('generate_surrogate_key', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__generate_surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.918856, "supported_languages": null}, "macro.dbt_utils.default__generate_surrogate_key": {"unique_id": "macro.dbt_utils.default__generate_surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "name": "default__generate_surrogate_key", "macro_sql": "\n\n{%- macro default__generate_surrogate_key(field_list) -%}\n\n{% if var('surrogate_key_treat_nulls_as_empty_strings', False) %}\n {% set default_null_value = \"\" %}\n{% else %}\n {% set default_null_value = '_dbt_utils_surrogate_key_null_'%}\n{% endif %}\n\n{%- set fields = [] -%}\n\n{%- for field in field_list -%}\n\n {%- do fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ type_string() ~ \"), '\" ~ default_null_value ~\"')\"\n ) -%}\n\n {%- if not loop.last %}\n {%- do fields.append(\"'-'\") -%}\n {%- endif -%}\n\n{%- endfor -%}\n\n{{ hash(concat(fields)) }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.hash", "macro.dbt.concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.919489, "supported_languages": null}, "macro.dbt_utils.get_table_types_sql": {"unique_id": "macro.dbt_utils.get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "name": "get_table_types_sql", "macro_sql": "{%- macro get_table_types_sql() -%}\n {{ return(adapter.dispatch('get_table_types_sql', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.919935, "supported_languages": null}, "macro.dbt_utils.default__get_table_types_sql": {"unique_id": "macro.dbt_utils.default__get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "name": "default__get_table_types_sql", "macro_sql": "{% macro default__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.92008, "supported_languages": null}, "macro.dbt_utils.postgres__get_table_types_sql": {"unique_id": "macro.dbt_utils.postgres__get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "name": "postgres__get_table_types_sql", "macro_sql": "{% macro postgres__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'FOREIGN' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.920226, "supported_languages": null}, "macro.dbt_utils.degrees_to_radians": {"unique_id": "macro.dbt_utils.degrees_to_radians", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "degrees_to_radians", "macro_sql": "{% macro degrees_to_radians(degrees) -%}\n acos(-1) * {{degrees}} / 180\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.921268, "supported_languages": null}, "macro.dbt_utils.haversine_distance": {"unique_id": "macro.dbt_utils.haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "haversine_distance", "macro_sql": "{% macro haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n {{ return(adapter.dispatch('haversine_distance', 'dbt_utils')(lat1,lon1,lat2,lon2,unit)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.921655, "supported_languages": null}, "macro.dbt_utils.default__haversine_distance": {"unique_id": "macro.dbt_utils.default__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n\n 2 * 3961 * asin(sqrt(power((sin(radians(({{ lat2 }} - {{ lat1 }}) / 2))), 2) +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n power((sin(radians(({{ lon2 }} - {{ lon1 }}) / 2))), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9222121, "supported_languages": null}, "macro.dbt_utils.bigquery__haversine_distance": {"unique_id": "macro.dbt_utils.bigquery__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "bigquery__haversine_distance", "macro_sql": "{% macro bigquery__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{% set radians_lat1 = dbt_utils.degrees_to_radians(lat1) %}\n{% set radians_lat2 = dbt_utils.degrees_to_radians(lat2) %}\n{% set radians_lon1 = dbt_utils.degrees_to_radians(lon1) %}\n{% set radians_lon2 = dbt_utils.degrees_to_radians(lon2) %}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n 2 * 3961 * asin(sqrt(power(sin(({{ radians_lat2 }} - {{ radians_lat1 }}) / 2), 2) +\n cos({{ radians_lat1 }}) * cos({{ radians_lat2 }}) *\n power(sin(({{ radians_lon2 }} - {{ radians_lon1 }}) / 2), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.degrees_to_radians"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.923002, "supported_languages": null}, "macro.fivetran_utils.enabled_vars": {"unique_id": "macro.fivetran_utils.enabled_vars", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/enabled_vars.sql", "original_file_path": "macros/enabled_vars.sql", "name": "enabled_vars", "macro_sql": "{% macro enabled_vars(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, True) == False %}\n {{ return(False) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(True) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9234781, "supported_languages": null}, "macro.fivetran_utils.percentile": {"unique_id": "macro.fivetran_utils.percentile", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "percentile", "macro_sql": "{% macro percentile(percentile_field, partition_field, percent) -%}\n\n{{ adapter.dispatch('percentile', 'fivetran_utils') (percentile_field, partition_field, percent) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__percentile"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9243991, "supported_languages": null}, "macro.fivetran_utils.default__percentile": {"unique_id": "macro.fivetran_utils.default__percentile", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "default__percentile", "macro_sql": "{% macro default__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.924562, "supported_languages": null}, "macro.fivetran_utils.redshift__percentile": {"unique_id": "macro.fivetran_utils.redshift__percentile", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "redshift__percentile", "macro_sql": "{% macro redshift__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.924722, "supported_languages": null}, "macro.fivetran_utils.bigquery__percentile": {"unique_id": "macro.fivetran_utils.bigquery__percentile", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "bigquery__percentile", "macro_sql": "{% macro bigquery__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.924882, "supported_languages": null}, "macro.fivetran_utils.postgres__percentile": {"unique_id": "macro.fivetran_utils.postgres__percentile", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "postgres__percentile", "macro_sql": "{% macro postgres__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n /* have to group by partition field */\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.925023, "supported_languages": null}, "macro.fivetran_utils.spark__percentile": {"unique_id": "macro.fivetran_utils.spark__percentile", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "spark__percentile", "macro_sql": "{% macro spark__percentile(percentile_field, partition_field, percent) %}\n\n percentile( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9251761, "supported_languages": null}, "macro.fivetran_utils.pivot_json_extract": {"unique_id": "macro.fivetran_utils.pivot_json_extract", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/pivot_json_extract.sql", "original_file_path": "macros/pivot_json_extract.sql", "name": "pivot_json_extract", "macro_sql": "{% macro pivot_json_extract(string, list_of_properties) %}\n\n{%- for property in list_of_properties -%}\n\nreplace( {{ fivetran_utils.json_extract(string, property) }}, '\"', '') as {{ property | replace(' ', '_') | lower }}\n\n{%- if not loop.last -%},{%- endif %}\n{% endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.925647, "supported_languages": null}, "macro.fivetran_utils.persist_pass_through_columns": {"unique_id": "macro.fivetran_utils.persist_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/persist_pass_through_columns.sql", "original_file_path": "macros/persist_pass_through_columns.sql", "name": "persist_pass_through_columns", "macro_sql": "{% macro persist_pass_through_columns(pass_through_variable, identifier=none, transform='') %}\n\n{% if var(pass_through_variable, none) %}\n {% for field in var(pass_through_variable) %}\n , {{ transform ~ '(' ~ (identifier ~ '.' if identifier else '') ~ (field.alias if field.alias else field.name) ~ ')' }} as {{ field.alias if field.alias else field.name }}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.926322, "supported_languages": null}, "macro.fivetran_utils.json_parse": {"unique_id": "macro.fivetran_utils.json_parse", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "json_parse", "macro_sql": "{% macro json_parse(string, string_path) -%}\n\n{{ adapter.dispatch('json_parse', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__json_parse"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.927418, "supported_languages": null}, "macro.fivetran_utils.default__json_parse": {"unique_id": "macro.fivetran_utils.default__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "default__json_parse", "macro_sql": "{% macro default__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.927666, "supported_languages": null}, "macro.fivetran_utils.redshift__json_parse": {"unique_id": "macro.fivetran_utils.redshift__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "redshift__json_parse", "macro_sql": "{% macro redshift__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.927916, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_parse": {"unique_id": "macro.fivetran_utils.bigquery__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "bigquery__json_parse", "macro_sql": "{% macro bigquery__json_parse(string, string_path) %}\n\n \n json_extract_scalar({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9281678, "supported_languages": null}, "macro.fivetran_utils.postgres__json_parse": {"unique_id": "macro.fivetran_utils.postgres__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "postgres__json_parse", "macro_sql": "{% macro postgres__json_parse(string, string_path) %}\n\n {{string}}::json #>> '{ {%- for s in string_path -%}{{ s }}{%- if not loop.last -%},{%- endif -%}{%- endfor -%} }'\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.92841, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_parse": {"unique_id": "macro.fivetran_utils.snowflake__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "snowflake__json_parse", "macro_sql": "{% macro snowflake__json_parse(string, string_path) %}\n\n parse_json( {{string}} ) {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.928689, "supported_languages": null}, "macro.fivetran_utils.spark__json_parse": {"unique_id": "macro.fivetran_utils.spark__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "spark__json_parse", "macro_sql": "{% macro spark__json_parse(string, string_path) %}\n\n {{string}} : {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.928942, "supported_languages": null}, "macro.fivetran_utils.max_bool": {"unique_id": "macro.fivetran_utils.max_bool", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "max_bool", "macro_sql": "{% macro max_bool(boolean_field) -%}\n\n{{ adapter.dispatch('max_bool', 'fivetran_utils') (boolean_field) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__max_bool"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9293709, "supported_languages": null}, "macro.fivetran_utils.default__max_bool": {"unique_id": "macro.fivetran_utils.default__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "default__max_bool", "macro_sql": "{% macro default__max_bool(boolean_field) %}\n\n bool_or( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.929476, "supported_languages": null}, "macro.fivetran_utils.snowflake__max_bool": {"unique_id": "macro.fivetran_utils.snowflake__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "snowflake__max_bool", "macro_sql": "{% macro snowflake__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.929661, "supported_languages": null}, "macro.fivetran_utils.bigquery__max_bool": {"unique_id": "macro.fivetran_utils.bigquery__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "bigquery__max_bool", "macro_sql": "{% macro bigquery__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.929763, "supported_languages": null}, "macro.fivetran_utils.calculated_fields": {"unique_id": "macro.fivetran_utils.calculated_fields", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/calculated_fields.sql", "original_file_path": "macros/calculated_fields.sql", "name": "calculated_fields", "macro_sql": "{% macro calculated_fields(variable) -%}\n\n{% if var(variable, none) %}\n {% for field in var(variable) %}\n , {{ field.transform_sql }} as {{ field.name }} \n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.930179, "supported_languages": null}, "macro.fivetran_utils.seed_data_helper": {"unique_id": "macro.fivetran_utils.seed_data_helper", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/seed_data_helper.sql", "original_file_path": "macros/seed_data_helper.sql", "name": "seed_data_helper", "macro_sql": "{% macro seed_data_helper(seed_name, warehouses) %}\n\n{% if target.type in warehouses %}\n {% for w in warehouses %}\n {% if target.type == w %}\n {{ return(ref(seed_name ~ \"_\" ~ w ~ \"\")) }}\n {% endif %}\n {% endfor %}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9308002, "supported_languages": null}, "macro.fivetran_utils.fill_pass_through_columns": {"unique_id": "macro.fivetran_utils.fill_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/fill_pass_through_columns.sql", "original_file_path": "macros/fill_pass_through_columns.sql", "name": "fill_pass_through_columns", "macro_sql": "{% macro fill_pass_through_columns(pass_through_variable) %}\n\n{% if var(pass_through_variable) %}\n {% for field in var(pass_through_variable) %}\n {% if field.transform_sql %}\n , {{ field.transform_sql }} as {{ field.alias if field.alias else field.name }}\n {% else %}\n , {{ field.alias if field.alias else field.name }}\n {% endif %}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.931445, "supported_languages": null}, "macro.fivetran_utils.string_agg": {"unique_id": "macro.fivetran_utils.string_agg", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "string_agg", "macro_sql": "{% macro string_agg(field_to_agg, delimiter) -%}\n\n{{ adapter.dispatch('string_agg', 'fivetran_utils') (field_to_agg, delimiter) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__string_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.931967, "supported_languages": null}, "macro.fivetran_utils.default__string_agg": {"unique_id": "macro.fivetran_utils.default__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "default__string_agg", "macro_sql": "{% macro default__string_agg(field_to_agg, delimiter) %}\n string_agg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.932096, "supported_languages": null}, "macro.fivetran_utils.snowflake__string_agg": {"unique_id": "macro.fivetran_utils.snowflake__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "snowflake__string_agg", "macro_sql": "{% macro snowflake__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.932223, "supported_languages": null}, "macro.fivetran_utils.redshift__string_agg": {"unique_id": "macro.fivetran_utils.redshift__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "redshift__string_agg", "macro_sql": "{% macro redshift__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9323468, "supported_languages": null}, "macro.fivetran_utils.spark__string_agg": {"unique_id": "macro.fivetran_utils.spark__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "spark__string_agg", "macro_sql": "{% macro spark__string_agg(field_to_agg, delimiter) %}\n -- collect set will remove duplicates\n replace(replace(replace(cast( collect_set({{ field_to_agg }}) as string), '[', ''), ']', ''), ', ', {{ delimiter }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9324741, "supported_languages": null}, "macro.fivetran_utils.timestamp_diff": {"unique_id": "macro.fivetran_utils.timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "timestamp_diff", "macro_sql": "{% macro timestamp_diff(first_date, second_date, datepart) %}\n {{ adapter.dispatch('timestamp_diff', 'fivetran_utils')(first_date, second_date, datepart) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__timestamp_diff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.935201, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_diff": {"unique_id": "macro.fivetran_utils.default__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "default__timestamp_diff", "macro_sql": "{% macro default__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.935371, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_diff": {"unique_id": "macro.fivetran_utils.redshift__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "redshift__timestamp_diff", "macro_sql": "{% macro redshift__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.935529, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_diff": {"unique_id": "macro.fivetran_utils.bigquery__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "bigquery__timestamp_diff", "macro_sql": "{% macro bigquery__timestamp_diff(first_date, second_date, datepart) %}\n\n timestamp_diff(\n {{second_date}},\n {{first_date}},\n {{datepart}}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9356852, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_diff": {"unique_id": "macro.fivetran_utils.postgres__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "postgres__timestamp_diff", "macro_sql": "{% macro postgres__timestamp_diff(first_date, second_date, datepart) %}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ dbt.datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.937407, "supported_languages": null}, "macro.fivetran_utils.try_cast": {"unique_id": "macro.fivetran_utils.try_cast", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "try_cast", "macro_sql": "{% macro try_cast(field, type) %}\n {{ adapter.dispatch('try_cast', 'fivetran_utils') (field, type) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__try_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.938296, "supported_languages": null}, "macro.fivetran_utils.default__safe_cast": {"unique_id": "macro.fivetran_utils.default__safe_cast", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.938432, "supported_languages": null}, "macro.fivetran_utils.redshift__try_cast": {"unique_id": "macro.fivetran_utils.redshift__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "redshift__try_cast", "macro_sql": "{% macro redshift__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when trim({{field}}) ~ '^(0|[1-9][0-9]*)$' then trim({{field}})\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.938695, "supported_languages": null}, "macro.fivetran_utils.postgres__try_cast": {"unique_id": "macro.fivetran_utils.postgres__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "postgres__try_cast", "macro_sql": "{% macro postgres__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar)) ~ '^(0|[1-9][0-9]*)$' \n then replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar))\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9389691, "supported_languages": null}, "macro.fivetran_utils.snowflake__try_cast": {"unique_id": "macro.fivetran_utils.snowflake__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "snowflake__try_cast", "macro_sql": "{% macro snowflake__try_cast(field, type) %}\n try_cast(cast({{field}} as varchar) as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.939094, "supported_languages": null}, "macro.fivetran_utils.bigquery__try_cast": {"unique_id": "macro.fivetran_utils.bigquery__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "bigquery__try_cast", "macro_sql": "{% macro bigquery__try_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9392169, "supported_languages": null}, "macro.fivetran_utils.spark__try_cast": {"unique_id": "macro.fivetran_utils.spark__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "spark__try_cast", "macro_sql": "{% macro spark__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9393349, "supported_languages": null}, "macro.fivetran_utils.source_relation": {"unique_id": "macro.fivetran_utils.source_relation", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "name": "source_relation", "macro_sql": "{% macro source_relation(union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('source_relation', 'fivetran_utils') (union_schema_variable, union_database_variable) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.939851, "supported_languages": null}, "macro.fivetran_utils.default__source_relation": {"unique_id": "macro.fivetran_utils.default__source_relation", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "name": "default__source_relation", "macro_sql": "{% macro default__source_relation(union_schema_variable, union_database_variable) %}\n\n{% if var(union_schema_variable, none) %}\n, case\n {% for schema in var(union_schema_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%.{{ schema|lower }}.%' then '{{ schema|lower }}'\n {% endfor %}\n end as source_relation\n{% elif var(union_database_variable, none) %}\n, case\n {% for database in var(union_database_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%{{ database|lower }}.%' then '{{ database|lower }}'\n {% endfor %}\n end as source_relation\n{% else %}\n, cast('' as {{ dbt.type_string() }}) as source_relation\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.940431, "supported_languages": null}, "macro.fivetran_utils.first_value": {"unique_id": "macro.fivetran_utils.first_value", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "first_value", "macro_sql": "{% macro first_value(first_value_field, partition_field, order_by_field, order=\"asc\") -%}\n\n{{ adapter.dispatch('first_value', 'fivetran_utils') (first_value_field, partition_field, order_by_field, order) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__first_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.940958, "supported_languages": null}, "macro.fivetran_utils.default__first_value": {"unique_id": "macro.fivetran_utils.default__first_value", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "default__first_value", "macro_sql": "{% macro default__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.941153, "supported_languages": null}, "macro.fivetran_utils.redshift__first_value": {"unique_id": "macro.fivetran_utils.redshift__first_value", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "redshift__first_value", "macro_sql": "{% macro redshift__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} , {{ partition_field }} rows unbounded preceding )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9413671, "supported_languages": null}, "macro.fivetran_utils.add_dbt_source_relation": {"unique_id": "macro.fivetran_utils.add_dbt_source_relation", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/add_dbt_source_relation.sql", "original_file_path": "macros/add_dbt_source_relation.sql", "name": "add_dbt_source_relation", "macro_sql": "{% macro add_dbt_source_relation() %}\n\n{% if var('union_schemas', none) or var('union_databases', none) %}\n, _dbt_source_relation\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.941675, "supported_languages": null}, "macro.fivetran_utils.add_pass_through_columns": {"unique_id": "macro.fivetran_utils.add_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/add_pass_through_columns.sql", "original_file_path": "macros/add_pass_through_columns.sql", "name": "add_pass_through_columns", "macro_sql": "{% macro add_pass_through_columns(base_columns, pass_through_var) %}\n\n {% if pass_through_var %}\n\n {% for column in pass_through_var %}\n\n {% if column.alias %}\n\n {% do base_columns.append({ \"name\": column.name, \"alias\": column.alias, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column.name, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n \n {% endif %}\n\n {% endfor %}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.942527, "supported_languages": null}, "macro.fivetran_utils.union_relations": {"unique_id": "macro.fivetran_utils.union_relations", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "name": "union_relations", "macro_sql": "{%- macro union_relations(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n {%- set source_column_name = source_column_name if source_column_name is not none else '_dbt_source_relation' -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt_utils.string_literal(relation) }} as {{ dbt_utils.type_string() }}) as {{ source_column_name }},\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ aliases[loop.index0] if aliases else relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.946688, "supported_languages": null}, "macro.fivetran_utils.union_tables": {"unique_id": "macro.fivetran_utils.union_tables", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "name": "union_tables", "macro_sql": "{%- macro union_tables(tables, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_table') -%}\n\n {%- do exceptions.warn(\"Warning: the `union_tables` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use the `union_relations` macro instead\") -%}\n\n {{ return(dbt_utils.union_relations(tables, column_override, include, exclude, source_column_name)) }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.947063, "supported_languages": null}, "macro.fivetran_utils.snowflake_seed_data": {"unique_id": "macro.fivetran_utils.snowflake_seed_data", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/snowflake_seed_data.sql", "original_file_path": "macros/snowflake_seed_data.sql", "name": "snowflake_seed_data", "macro_sql": "{% macro snowflake_seed_data(seed_name) %}\n\n{% if target.type == 'snowflake' %}\n{{ return(ref(seed_name ~ '_snowflake')) }}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9475808, "supported_languages": null}, "macro.fivetran_utils.fill_staging_columns": {"unique_id": "macro.fivetran_utils.fill_staging_columns", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "name": "fill_staging_columns", "macro_sql": "{% macro fill_staging_columns(source_columns, staging_columns) -%}\n\n{%- set source_column_names = source_columns|map(attribute='name')|map('lower')|list -%}\n\n{%- for column in staging_columns %}\n {% if column.name|lower in source_column_names -%}\n {{ fivetran_utils.quote_column(column) }} as \n {%- if 'alias' in column %} {{ column.alias }} {% else %} {{ fivetran_utils.quote_column(column) }} {%- endif -%}\n {%- else -%}\n cast(null as {{ column.datatype }})\n {%- if 'alias' in column %} as {{ column.alias }} {% else %} as {{ fivetran_utils.quote_column(column) }} {% endif -%}\n {%- endif -%}\n {%- if not loop.last -%} , {% endif -%}\n{% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.quote_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.94913, "supported_languages": null}, "macro.fivetran_utils.quote_column": {"unique_id": "macro.fivetran_utils.quote_column", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "name": "quote_column", "macro_sql": "{% macro quote_column(column) %}\n {% if 'quote' in column %}\n {% if column.quote %}\n {% if target.type in ('bigquery', 'spark') %}\n `{{ column.name }}`\n {% elif target.type == 'snowflake' %}\n \"{{ column.name | upper }}\"\n {% else %}\n \"{{ column.name }}\"\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9496598, "supported_languages": null}, "macro.fivetran_utils.json_extract": {"unique_id": "macro.fivetran_utils.json_extract", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "json_extract", "macro_sql": "{% macro json_extract(string, string_path) -%}\n\n{{ adapter.dispatch('json_extract', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.950256, "supported_languages": null}, "macro.fivetran_utils.default__json_extract": {"unique_id": "macro.fivetran_utils.default__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "default__json_extract", "macro_sql": "{% macro default__json_extract(string, string_path) %}\n\n json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} )\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.950419, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_extract": {"unique_id": "macro.fivetran_utils.snowflake__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "snowflake__json_extract", "macro_sql": "{% macro snowflake__json_extract(string, string_path) %}\n\n json_extract_path_text(try_parse_json( {{string}} ), {{ \"'\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.950575, "supported_languages": null}, "macro.fivetran_utils.redshift__json_extract": {"unique_id": "macro.fivetran_utils.redshift__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "redshift__json_extract", "macro_sql": "{% macro redshift__json_extract(string, string_path) %}\n\n case when is_valid_json( {{string}} ) then json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} ) else null end\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.950742, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_extract": {"unique_id": "macro.fivetran_utils.bigquery__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "bigquery__json_extract", "macro_sql": "{% macro bigquery__json_extract(string, string_path) %}\n\n json_extract_scalar({{string}}, {{ \"'$.\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.950899, "supported_languages": null}, "macro.fivetran_utils.postgres__json_extract": {"unique_id": "macro.fivetran_utils.postgres__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "postgres__json_extract", "macro_sql": "{% macro postgres__json_extract(string, string_path) %}\n\n {{string}}::json->>{{\"'\" ~ string_path ~ \"'\" }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9510558, "supported_languages": null}, "macro.fivetran_utils.collect_freshness": {"unique_id": "macro.fivetran_utils.collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "name": "collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness')(source, loaded_at_field, filter))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.951861, "supported_languages": null}, "macro.fivetran_utils.default__collect_freshness": {"unique_id": "macro.fivetran_utils.default__collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "name": "default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n\n {%- set enabled_array = [] -%}\n {% for node in graph.sources.values() %}\n {% if node.identifier == source.identifier %}\n {% if (node.meta['is_enabled'] | default(true)) %}\n {%- do enabled_array.append(1) -%}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% set is_enabled = (enabled_array != []) %}\n\n select\n {% if is_enabled %}\n max({{ loaded_at_field }})\n {% else %} \n {{ current_timestamp() }} {% endif %} as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n\n {% if is_enabled %}\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endif %}\n\n {% endcall %}\n {{ return(load_result('collect_freshness').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.952857, "supported_languages": null}, "macro.fivetran_utils.timestamp_add": {"unique_id": "macro.fivetran_utils.timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "timestamp_add", "macro_sql": "{% macro timestamp_add(datepart, interval, from_timestamp) -%}\n\n{{ adapter.dispatch('timestamp_add', 'fivetran_utils') (datepart, interval, from_timestamp) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__timestamp_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.953598, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_add": {"unique_id": "macro.fivetran_utils.default__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "default__timestamp_add", "macro_sql": "{% macro default__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestampadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.953761, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_add": {"unique_id": "macro.fivetran_utils.bigquery__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "bigquery__timestamp_add", "macro_sql": "{% macro bigquery__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestamp_add({{ from_timestamp }}, interval {{ interval }} {{ datepart }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.953912, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_add": {"unique_id": "macro.fivetran_utils.redshift__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "redshift__timestamp_add", "macro_sql": "{% macro redshift__timestamp_add(datepart, interval, from_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9540749, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_add": {"unique_id": "macro.fivetran_utils.postgres__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "postgres__timestamp_add", "macro_sql": "{% macro postgres__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ from_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9542348, "supported_languages": null}, "macro.fivetran_utils.spark__timestamp_add": {"unique_id": "macro.fivetran_utils.spark__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "spark__timestamp_add", "macro_sql": "{% macro spark__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ dbt.dateadd(datepart, interval, from_timestamp) }}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.954407, "supported_languages": null}, "macro.fivetran_utils.ceiling": {"unique_id": "macro.fivetran_utils.ceiling", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "ceiling", "macro_sql": "{% macro ceiling(num) -%}\n\n{{ adapter.dispatch('ceiling', 'fivetran_utils') (num) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__ceiling"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.954719, "supported_languages": null}, "macro.fivetran_utils.default__ceiling": {"unique_id": "macro.fivetran_utils.default__ceiling", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "default__ceiling", "macro_sql": "{% macro default__ceiling(num) %}\n ceiling({{ num }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.954825, "supported_languages": null}, "macro.fivetran_utils.snowflake__ceiling": {"unique_id": "macro.fivetran_utils.snowflake__ceiling", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "snowflake__ceiling", "macro_sql": "{% macro snowflake__ceiling(num) %}\n ceil({{ num }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.955004, "supported_languages": null}, "macro.fivetran_utils.remove_prefix_from_columns": {"unique_id": "macro.fivetran_utils.remove_prefix_from_columns", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/remove_prefix_from_columns.sql", "original_file_path": "macros/remove_prefix_from_columns.sql", "name": "remove_prefix_from_columns", "macro_sql": "{% macro remove_prefix_from_columns(columns, prefix='', exclude=[]) %}\n\n {%- for col in columns if col.name not in exclude -%}\n {%- if col.name[:prefix|length]|lower == prefix -%}\n {{ col.name }} as {{ col.name[prefix|length:] }}\n {%- else -%}\n {{ col.name }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {% endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.955692, "supported_languages": null}, "macro.fivetran_utils.union_data": {"unique_id": "macro.fivetran_utils.union_data", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "name": "union_data", "macro_sql": "{% macro union_data(table_identifier, database_variable, schema_variable, default_database, default_schema, default_variable, union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('union_data', 'fivetran_utils') (\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__union_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9570408, "supported_languages": null}, "macro.fivetran_utils.default__union_data": {"unique_id": "macro.fivetran_utils.default__union_data", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "name": "default__union_data", "macro_sql": "{% macro default__union_data(\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) %}\n\n{% if var(union_schema_variable, none) %}\n\n {% set relations = [] %}\n \n {% if var(union_schema_variable) is string %}\n {% set trimmed = var(union_schema_variable)|trim('[')|trim(']') %}\n {% set schemas = trimmed.split(',')|map('trim',\" \")|map('trim','\"')|map('trim',\"'\") %}\n {% else %}\n {% set schemas = var(union_schema_variable) %}\n {% endif %}\n\n {% for schema in var(union_schema_variable) %}\n {% set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else var(database_variable, default_database),\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else schema,\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n \n {% set relation_exists=relation is not none %}\n\n {% if relation_exists %}\n\n {% do relations.append(relation) %}\n \n {% endif %}\n\n {% endfor %}\n\n {{ dbt_utils.union_relations(relations) }}\n\n{% elif var(union_database_variable, none) %}\n\n {% set relations = [] %}\n\n {% for database in var(union_database_variable) %}\n\n {% set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else database,\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else var(schema_variable, default_schema),\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n\n {% set relation_exists=relation is not none %}\n\n {% if relation_exists %}\n\n {% do relations.append(relation) %}\n \n {% endif %}\n\n {% endfor %}\n\n {{ dbt_utils.union_relations(relations) }}\n\n{% else %}\n\n select * \n from {{ var(default_variable) }}\n\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.959337, "supported_languages": null}, "macro.fivetran_utils.dummy_coalesce_value": {"unique_id": "macro.fivetran_utils.dummy_coalesce_value", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/dummy_coalesce_value.sql", "original_file_path": "macros/dummy_coalesce_value.sql", "name": "dummy_coalesce_value", "macro_sql": "{% macro dummy_coalesce_value(column) %}\n\n{% set coalesce_value = {\n 'STRING': \"'DUMMY_STRING'\",\n 'BOOLEAN': 'null',\n 'INT': 999999999,\n 'FLOAT': 999999999.99,\n 'TIMESTAMP': 'cast(\"2099-12-31\" as timestamp)',\n 'DATE': 'cast(\"2099-12-31\" as date)',\n} %}\n\n{% if column.is_float() %}\n{{ return(coalesce_value['FLOAT']) }}\n\n{% elif column.is_numeric() %}\n{{ return(coalesce_value['INT']) }}\n\n{% elif column.is_string() %}\n{{ return(coalesce_value['STRING']) }}\n\n{% elif column.data_type|lower == 'boolean' %}\n{{ return(coalesce_value['BOOLEAN']) }}\n\n{% elif 'timestamp' in column.data_type|lower %}\n{{ return(coalesce_value['TIMESTAMP']) }}\n\n{% elif 'date' in column.data_type|lower %}\n{{ return(coalesce_value['DATE']) }}\n\n{% elif 'int' in column.data_type|lower %}\n{{ return(coalesce_value['INT']) }}\n\n{% endif %}\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.960752, "supported_languages": null}, "macro.fivetran_utils.array_agg": {"unique_id": "macro.fivetran_utils.array_agg", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "array_agg", "macro_sql": "{% macro array_agg(field_to_agg) -%}\n\n{{ adapter.dispatch('array_agg', 'fivetran_utils') (field_to_agg) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__array_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.961099, "supported_languages": null}, "macro.fivetran_utils.default__array_agg": {"unique_id": "macro.fivetran_utils.default__array_agg", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "default__array_agg", "macro_sql": "{% macro default__array_agg(field_to_agg) %}\n array_agg({{ field_to_agg }})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.961208, "supported_languages": null}, "macro.fivetran_utils.redshift__array_agg": {"unique_id": "macro.fivetran_utils.redshift__array_agg", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "redshift__array_agg", "macro_sql": "{% macro redshift__array_agg(field_to_agg) %}\n listagg({{ field_to_agg }}, ',')\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.961382, "supported_languages": null}, "macro.fivetran_utils.empty_variable_warning": {"unique_id": "macro.fivetran_utils.empty_variable_warning", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/empty_variable_warning.sql", "original_file_path": "macros/empty_variable_warning.sql", "name": "empty_variable_warning", "macro_sql": "{% macro empty_variable_warning(variable, downstream_model) %}\n\n{% if not var(variable) %}\n{{ log(\n \"\"\"\n Warning: You have passed an empty list to the \"\"\" ~ variable ~ \"\"\".\n As a result, you won't see the history of any columns in the \"\"\" ~ downstream_model ~ \"\"\" model.\n \"\"\",\n info=True\n) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9619179, "supported_languages": null}, "macro.fivetran_utils.enabled_vars_one_true": {"unique_id": "macro.fivetran_utils.enabled_vars_one_true", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/enabled_vars_one_true.sql", "original_file_path": "macros/enabled_vars_one_true.sql", "name": "enabled_vars_one_true", "macro_sql": "{% macro enabled_vars_one_true(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, False) == True %}\n {{ return(True) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(False) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.962392, "supported_languages": null}, "macro.github_source.get_issue_columns": {"unique_id": "macro.github_source.get_issue_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_columns.sql", "original_file_path": "macros/get_issue_columns.sql", "name": "get_issue_columns", "macro_sql": "{% macro get_issue_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"body\", \"datatype\": dbt.type_string()},\n {\"name\": \"closed_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"locked\", \"datatype\": \"boolean\"},\n {\"name\": \"milestone_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"number\", \"datatype\": dbt.type_int()},\n {\"name\": \"pull_request\", \"datatype\": \"boolean\"},\n {\"name\": \"repository_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"state\", \"datatype\": dbt.type_string()},\n {\"name\": \"title\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"user_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9639559, "supported_languages": null}, "macro.github_source.get_issue_comment_columns": {"unique_id": "macro.github_source.get_issue_comment_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_comment_columns.sql", "original_file_path": "macros/get_issue_comment_columns.sql", "name": "get_issue_comment_columns", "macro_sql": "{% macro get_issue_comment_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"body\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"user_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.964865, "supported_languages": null}, "macro.github_source.get_repository_columns": {"unique_id": "macro.github_source.get_repository_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_repository_columns.sql", "original_file_path": "macros/get_repository_columns.sql", "name": "get_repository_columns", "macro_sql": "{% macro get_repository_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"archived\", \"datatype\": \"boolean\"},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"default_branch\", \"datatype\": dbt.type_string()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"fork\", \"datatype\": \"boolean\"},\n {\"name\": \"full_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"homepage\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"language\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"owner_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"private\", \"datatype\": \"boolean\"}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9663, "supported_languages": null}, "macro.github_source.get_issue_merged_columns": {"unique_id": "macro.github_source.get_issue_merged_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_merged_columns.sql", "original_file_path": "macros/get_issue_merged_columns.sql", "name": "get_issue_merged_columns", "macro_sql": "{% macro get_issue_merged_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"actor_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"commit_sha\", \"datatype\": dbt.type_string()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"merged_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9670131, "supported_languages": null}, "macro.github_source.get_pull_request_review_columns": {"unique_id": "macro.github_source.get_pull_request_review_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_pull_request_review_columns.sql", "original_file_path": "macros/get_pull_request_review_columns.sql", "name": "get_pull_request_review_columns", "macro_sql": "{% macro get_pull_request_review_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"body\", \"datatype\": dbt.type_string()},\n {\"name\": \"commit_sha\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"pull_request_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"state\", \"datatype\": dbt.type_string()},\n {\"name\": \"submitted_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"user_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.968013, "supported_languages": null}, "macro.github_source.get_team_columns": {"unique_id": "macro.github_source.get_team_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_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_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"org_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"parent_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"privacy\", \"datatype\": dbt.type_string()},\n {\"name\": \"slug\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9690208, "supported_languages": null}, "macro.github_source.get_issue_assignee_columns": {"unique_id": "macro.github_source.get_issue_assignee_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_assignee_columns.sql", "original_file_path": "macros/get_issue_assignee_columns.sql", "name": "get_issue_assignee_columns", "macro_sql": "{% macro get_issue_assignee_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"user_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.969611, "supported_languages": null}, "macro.github_source.get_user_columns": {"unique_id": "macro.github_source.get_user_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_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\": \"company\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"login\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.970243, "supported_languages": null}, "macro.github_source.get_label_columns": {"unique_id": "macro.github_source.get_label_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_label_columns.sql", "original_file_path": "macros/get_label_columns.sql", "name": "get_label_columns", "macro_sql": "{% macro get_label_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"color\", \"datatype\": dbt.type_string()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"is_default\", \"datatype\": \"boolean\"},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"url\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.971116, "supported_languages": null}, "macro.github_source.get_pull_request_columns": {"unique_id": "macro.github_source.get_pull_request_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_pull_request_columns.sql", "original_file_path": "macros/get_pull_request_columns.sql", "name": "get_pull_request_columns", "macro_sql": "{% macro get_pull_request_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"base_label\", \"datatype\": dbt.type_string()},\n {\"name\": \"base_ref\", \"datatype\": dbt.type_string()},\n {\"name\": \"base_repo_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"base_sha\", \"datatype\": dbt.type_string()},\n {\"name\": \"base_user_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"head_label\", \"datatype\": dbt.type_string()},\n {\"name\": \"head_ref\", \"datatype\": dbt.type_string()},\n {\"name\": \"head_repo_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"head_sha\", \"datatype\": dbt.type_string()},\n {\"name\": \"head_user_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"merge_commit_sha\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9727612, "supported_languages": null}, "macro.github_source.get_requested_reviewer_history_columns": {"unique_id": "macro.github_source.get_requested_reviewer_history_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_requested_reviewer_history_columns.sql", "original_file_path": "macros/get_requested_reviewer_history_columns.sql", "name": "get_requested_reviewer_history_columns", "macro_sql": "{% macro get_requested_reviewer_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"actor_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"pull_request_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"removed\", \"datatype\": \"boolean\"},\n {\"name\": \"requested_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.973564, "supported_languages": null}, "macro.github_source.get_issue_closed_history_columns": {"unique_id": "macro.github_source.get_issue_closed_history_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_closed_history_columns.sql", "original_file_path": "macros/get_issue_closed_history_columns.sql", "name": "get_issue_closed_history_columns", "macro_sql": "{% macro get_issue_closed_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"actor_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"closed\", \"datatype\": \"boolean\"},\n {\"name\": \"commit_sha\", \"datatype\": dbt.type_string()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9743528, "supported_languages": null}, "macro.github_source.get_repo_team_columns": {"unique_id": "macro.github_source.get_repo_team_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_repo_team_columns.sql", "original_file_path": "macros/get_repo_team_columns.sql", "name": "get_repo_team_columns", "macro_sql": "{% macro get_repo_team_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"permission\", \"datatype\": dbt.type_string()},\n {\"name\": \"repository_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"team_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.974963, "supported_languages": null}, "macro.github_source.get_issue_label_columns": {"unique_id": "macro.github_source.get_issue_label_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_label_columns.sql", "original_file_path": "macros/get_issue_label_columns.sql", "name": "get_issue_label_columns", "macro_sql": "{% macro get_issue_label_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"label_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.975481, "supported_languages": null}}, "docs": {"dbt.__overview__": {"unique_id": "dbt.__overview__", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "overview.md", "original_file_path": "docs/overview.md", "name": "__overview__", "block_contents": "### Welcome!\n\nWelcome to the auto-generated documentation for your dbt project!\n\n### Navigation\n\nYou can use the `Project` and `Database` navigation tabs on the left side of the window to explore the models\nin your project.\n\n#### Project Tab\nThe `Project` tab mirrors the directory structure of your dbt project. In this tab, you can see all of the\nmodels defined in your dbt project, as well as models imported from dbt packages.\n\n#### Database Tab\nThe `Database` tab also exposes your models, but in a format that looks more like a database explorer. This view\nshows relations (tables and views) grouped into database schemas. Note that ephemeral models are _not_ shown\nin this interface, as they do not exist in the database.\n\n### Graph Exploration\nYou can click the blue icon on the bottom-right corner of the page to view the lineage graph of your models.\n\nOn model pages, you'll see the immediate parents and children of the model you're exploring. By clicking the `Expand`\nbutton at the top-right of this lineage pane, you'll be able to see all of the models that are used to build,\nor are built from, the model you're exploring.\n\nOnce expanded, you'll be able to use the `--select` and `--exclude` model selection syntax to filter the\nmodels in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax).\n\nNote that you can also right-click on models to interactively filter and explore the graph.\n\n---\n\n### More information\n\n- [What is dbt](https://docs.getdbt.com/docs/introduction)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [dbt Community](https://www.getdbt.com/community/) for questions and discussion"}}, "exposures": {}, "metrics": {}, "selectors": {}, "disabled": {}, "parent_map": {"seed.github_integration_tests.github_pull_request_review_data": [], "seed.github_integration_tests.github_label_data": [], "seed.github_integration_tests.github_repository_data": [], "seed.github_integration_tests.github_issue_merged_data": [], "seed.github_integration_tests.github_issue_data": [], "seed.github_integration_tests.github_repo_team_data": [], "seed.github_integration_tests.github_requested_reviewer_history_data": [], "seed.github_integration_tests.github_issue_label_data": [], "seed.github_integration_tests.github_issue_comment_data": [], "seed.github_integration_tests.github_issue_assignee_data": [], "seed.github_integration_tests.github_issue_closed_history_data": [], "seed.github_integration_tests.github_pull_request_data": [], "seed.github_integration_tests.github_team_data": [], "seed.github_integration_tests.github_user_data": [], "model.github.github__weekly_metrics": ["model.github.github__daily_metrics"], "model.github.github__monthly_metrics": ["model.github.github__daily_metrics"], "model.github.github__quarterly_metrics": ["model.github.github__daily_metrics"], "model.github.github__pull_requests": ["model.github.int_github__issue_joined"], "model.github.github__daily_metrics": ["model.github.github__issues", "model.github.github__pull_requests"], "model.github.github__issues": ["model.github.int_github__issue_joined"], "model.github.int_github__pull_request_times": ["model.github_source.stg_github__issue", "model.github_source.stg_github__issue_merged", "model.github_source.stg_github__pull_request", "model.github_source.stg_github__pull_request_review", "model.github_source.stg_github__requested_reviewer_history"], "model.github.int_github__pull_request_reviewers": ["model.github_source.stg_github__pull_request_review", "model.github_source.stg_github__user"], "model.github.int_github__issue_label_joined": ["model.github_source.stg_github__issue_label", "model.github_source.stg_github__label"], "model.github.int_github__issue_joined": ["model.github.int_github__issue_assignees", "model.github.int_github__issue_comments", "model.github.int_github__issue_labels", "model.github.int_github__issue_open_length", "model.github.int_github__pull_request_reviewers", "model.github.int_github__pull_request_times", "model.github.int_github__repository_teams", "model.github_source.stg_github__issue", "model.github_source.stg_github__pull_request", "model.github_source.stg_github__user"], "model.github.int_github__issue_labels": ["model.github.int_github__issue_label_joined"], "model.github.int_github__issue_assignees": ["model.github_source.stg_github__issue_assignee", "model.github_source.stg_github__user"], "model.github.int_github__issue_comments": ["model.github_source.stg_github__issue_comment"], "model.github.int_github__issue_open_length": ["model.github_source.stg_github__issue", "model.github_source.stg_github__issue_closed_history"], "model.github.int_github__repository_teams": ["model.github_source.stg_github__repo_team", "model.github_source.stg_github__repository", "model.github_source.stg_github__team"], "model.github_source.stg_github__issue_comment": ["model.github_source.stg_github__issue_comment_tmp", "model.github_source.stg_github__issue_comment_tmp"], "model.github_source.stg_github__requested_reviewer_history": ["model.github_source.stg_github__requested_reviewer_history_tmp", "model.github_source.stg_github__requested_reviewer_history_tmp"], "model.github_source.stg_github__issue_label": ["model.github_source.stg_github__issue_label_tmp", "model.github_source.stg_github__issue_label_tmp"], "model.github_source.stg_github__issue_merged": ["model.github_source.stg_github__issue_merged_tmp", "model.github_source.stg_github__issue_merged_tmp"], "model.github_source.stg_github__issue_closed_history": ["model.github_source.stg_github__issue_closed_history_tmp", "model.github_source.stg_github__issue_closed_history_tmp"], "model.github_source.stg_github__issue_assignee": ["model.github_source.stg_github__issue_assignee_tmp", "model.github_source.stg_github__issue_assignee_tmp"], "model.github_source.stg_github__repository": ["model.github_source.stg_github__repository_tmp", "model.github_source.stg_github__repository_tmp"], "model.github_source.stg_github__user": ["model.github_source.stg_github__user_tmp", "model.github_source.stg_github__user_tmp"], "model.github_source.stg_github__pull_request_review": ["model.github_source.stg_github__pull_request_review_tmp", "model.github_source.stg_github__pull_request_review_tmp"], "model.github_source.stg_github__repo_team": ["model.github_source.stg_github__repo_team_tmp", "model.github_source.stg_github__repo_team_tmp"], "model.github_source.stg_github__label": ["model.github_source.stg_github__label_tmp", "model.github_source.stg_github__label_tmp"], "model.github_source.stg_github__issue": ["model.github_source.stg_github__issue_tmp", "model.github_source.stg_github__issue_tmp"], "model.github_source.stg_github__team": ["model.github_source.stg_github__team_tmp", "model.github_source.stg_github__team_tmp"], "model.github_source.stg_github__pull_request": ["model.github_source.stg_github__pull_request_tmp", "model.github_source.stg_github__pull_request_tmp"], "model.github_source.stg_github__repository_tmp": ["seed.github_integration_tests.github_repository_data"], "model.github_source.stg_github__label_tmp": ["seed.github_integration_tests.github_label_data"], "model.github_source.stg_github__requested_reviewer_history_tmp": ["seed.github_integration_tests.github_requested_reviewer_history_data"], "model.github_source.stg_github__issue_comment_tmp": ["seed.github_integration_tests.github_issue_comment_data"], "model.github_source.stg_github__pull_request_review_tmp": ["seed.github_integration_tests.github_pull_request_review_data"], "model.github_source.stg_github__issue_label_tmp": ["seed.github_integration_tests.github_issue_label_data"], "model.github_source.stg_github__team_tmp": ["seed.github_integration_tests.github_team_data"], "model.github_source.stg_github__pull_request_tmp": ["seed.github_integration_tests.github_pull_request_data"], "model.github_source.stg_github__issue_merged_tmp": ["seed.github_integration_tests.github_issue_merged_data"], "model.github_source.stg_github__user_tmp": ["seed.github_integration_tests.github_user_data"], "model.github_source.stg_github__issue_closed_history_tmp": ["seed.github_integration_tests.github_issue_closed_history_data"], "model.github_source.stg_github__issue_assignee_tmp": ["seed.github_integration_tests.github_issue_assignee_data"], "model.github_source.stg_github__issue_tmp": ["seed.github_integration_tests.github_issue_data"], "model.github_source.stg_github__repo_team_tmp": ["seed.github_integration_tests.github_repo_team_data"], "test.github.unique_github__issues_issue_id.6723b9b1db": ["model.github.github__issues"], "test.github.not_null_github__issues_issue_id.fed0631e25": ["model.github.github__issues"], "test.github.unique_github__pull_requests_issue_id.ce23997907": ["model.github.github__pull_requests"], "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f": ["model.github.github__pull_requests"], "test.github.unique_github__daily_metrics_day.f98cab9456": ["model.github.github__daily_metrics"], "test.github.not_null_github__daily_metrics_day.647e494434": ["model.github.github__daily_metrics"], "test.github.unique_github__weekly_metrics_week.6794858a8e": ["model.github.github__weekly_metrics"], "test.github.not_null_github__weekly_metrics_week.4b0b928243": ["model.github.github__weekly_metrics"], "test.github.unique_github__monthly_metrics_month.3076284fbb": ["model.github.github__monthly_metrics"], "test.github.not_null_github__monthly_metrics_month.9e4fba84df": ["model.github.github__monthly_metrics"], "test.github.unique_github__quarterly_metrics_quarter.9165a921c1": ["model.github.github__quarterly_metrics"], "test.github.not_null_github__quarterly_metrics_quarter.92394d46dc": ["model.github.github__quarterly_metrics"], "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4": ["model.github_source.stg_github__issue_assignee"], "test.github_source.not_null_stg_github__label_label_id.9f07379974": ["model.github_source.stg_github__label"], "test.github_source.unique_stg_github__label_label_id.74d3c21466": ["model.github_source.stg_github__label"], "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d": ["model.github_source.stg_github__issue_closed_history"], "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a": ["model.github_source.stg_github__issue_comment"], "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f": ["model.github_source.stg_github__issue_comment"], "test.github_source.unique_stg_github__issue_issue_id.84891aeece": ["model.github_source.stg_github__issue"], "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7": ["model.github_source.stg_github__issue"], "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508": ["model.github_source.stg_github__pull_request_review"], "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790": ["model.github_source.stg_github__pull_request_review"], "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa": ["model.github_source.stg_github__pull_request"], "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71": ["model.github_source.stg_github__pull_request"], "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503": ["model.github_source.stg_github__repo_team"], "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c": ["model.github_source.stg_github__repo_team"], "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d": ["model.github_source.stg_github__repository"], "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f": ["model.github_source.stg_github__repository"], "test.github_source.unique_stg_github__team_team_id.94e9716ab4": ["model.github_source.stg_github__team"], "test.github_source.not_null_stg_github__team_team_id.440aefe7a7": ["model.github_source.stg_github__team"], "test.github_source.unique_stg_github__user_user_id.5c1a00cd90": ["model.github_source.stg_github__user"], "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b": ["model.github_source.stg_github__user"], "source.github_source.github.issue_assignee": [], "source.github_source.github.label": [], "source.github_source.github.issue_closed_history": [], "source.github_source.github.issue_label": [], "source.github_source.github.issue_comment": [], "source.github_source.github.issue_merged": [], "source.github_source.github.issue": [], "source.github_source.github.pull_request_review": [], "source.github_source.github.pull_request": [], "source.github_source.github.repo_team": [], "source.github_source.github.repository": [], "source.github_source.github.requested_reviewer_history": [], "source.github_source.github.team": [], "source.github_source.github.user": []}, "child_map": {"seed.github_integration_tests.github_pull_request_review_data": ["model.github_source.stg_github__pull_request_review_tmp"], "seed.github_integration_tests.github_label_data": ["model.github_source.stg_github__label_tmp"], "seed.github_integration_tests.github_repository_data": ["model.github_source.stg_github__repository_tmp"], "seed.github_integration_tests.github_issue_merged_data": ["model.github_source.stg_github__issue_merged_tmp"], "seed.github_integration_tests.github_issue_data": ["model.github_source.stg_github__issue_tmp"], "seed.github_integration_tests.github_repo_team_data": ["model.github_source.stg_github__repo_team_tmp"], "seed.github_integration_tests.github_requested_reviewer_history_data": ["model.github_source.stg_github__requested_reviewer_history_tmp"], "seed.github_integration_tests.github_issue_label_data": ["model.github_source.stg_github__issue_label_tmp"], "seed.github_integration_tests.github_issue_comment_data": ["model.github_source.stg_github__issue_comment_tmp"], "seed.github_integration_tests.github_issue_assignee_data": ["model.github_source.stg_github__issue_assignee_tmp"], "seed.github_integration_tests.github_issue_closed_history_data": ["model.github_source.stg_github__issue_closed_history_tmp"], "seed.github_integration_tests.github_pull_request_data": ["model.github_source.stg_github__pull_request_tmp"], "seed.github_integration_tests.github_team_data": ["model.github_source.stg_github__team_tmp"], "seed.github_integration_tests.github_user_data": ["model.github_source.stg_github__user_tmp"], "model.github.github__weekly_metrics": ["test.github.not_null_github__weekly_metrics_week.4b0b928243", "test.github.unique_github__weekly_metrics_week.6794858a8e"], "model.github.github__monthly_metrics": ["test.github.not_null_github__monthly_metrics_month.9e4fba84df", "test.github.unique_github__monthly_metrics_month.3076284fbb"], "model.github.github__quarterly_metrics": ["test.github.not_null_github__quarterly_metrics_quarter.92394d46dc", "test.github.unique_github__quarterly_metrics_quarter.9165a921c1"], "model.github.github__pull_requests": ["model.github.github__daily_metrics", "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f", "test.github.unique_github__pull_requests_issue_id.ce23997907"], "model.github.github__daily_metrics": ["model.github.github__monthly_metrics", "model.github.github__quarterly_metrics", "model.github.github__weekly_metrics", "test.github.not_null_github__daily_metrics_day.647e494434", "test.github.unique_github__daily_metrics_day.f98cab9456"], "model.github.github__issues": ["model.github.github__daily_metrics", "test.github.not_null_github__issues_issue_id.fed0631e25", "test.github.unique_github__issues_issue_id.6723b9b1db"], "model.github.int_github__pull_request_times": ["model.github.int_github__issue_joined"], "model.github.int_github__pull_request_reviewers": ["model.github.int_github__issue_joined"], "model.github.int_github__issue_label_joined": ["model.github.int_github__issue_labels"], "model.github.int_github__issue_joined": ["model.github.github__issues", "model.github.github__pull_requests"], "model.github.int_github__issue_labels": ["model.github.int_github__issue_joined"], "model.github.int_github__issue_assignees": ["model.github.int_github__issue_joined"], "model.github.int_github__issue_comments": ["model.github.int_github__issue_joined"], "model.github.int_github__issue_open_length": ["model.github.int_github__issue_joined"], "model.github.int_github__repository_teams": ["model.github.int_github__issue_joined"], "model.github_source.stg_github__issue_comment": ["model.github.int_github__issue_comments", "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f", "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a"], "model.github_source.stg_github__requested_reviewer_history": ["model.github.int_github__pull_request_times"], "model.github_source.stg_github__issue_label": ["model.github.int_github__issue_label_joined"], "model.github_source.stg_github__issue_merged": ["model.github.int_github__pull_request_times"], "model.github_source.stg_github__issue_closed_history": ["model.github.int_github__issue_open_length", "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d"], "model.github_source.stg_github__issue_assignee": ["model.github.int_github__issue_assignees", "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4"], "model.github_source.stg_github__repository": ["model.github.int_github__repository_teams", "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f", "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d"], "model.github_source.stg_github__user": ["model.github.int_github__issue_assignees", "model.github.int_github__issue_joined", "model.github.int_github__pull_request_reviewers", "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b", "test.github_source.unique_stg_github__user_user_id.5c1a00cd90"], "model.github_source.stg_github__pull_request_review": ["model.github.int_github__pull_request_reviewers", "model.github.int_github__pull_request_times", "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790", "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508"], "model.github_source.stg_github__repo_team": ["model.github.int_github__repository_teams", "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503", "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c"], "model.github_source.stg_github__label": ["model.github.int_github__issue_label_joined", "test.github_source.not_null_stg_github__label_label_id.9f07379974", "test.github_source.unique_stg_github__label_label_id.74d3c21466"], "model.github_source.stg_github__issue": ["model.github.int_github__issue_joined", "model.github.int_github__issue_open_length", "model.github.int_github__pull_request_times", "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7", "test.github_source.unique_stg_github__issue_issue_id.84891aeece"], "model.github_source.stg_github__team": ["model.github.int_github__repository_teams", "test.github_source.not_null_stg_github__team_team_id.440aefe7a7", "test.github_source.unique_stg_github__team_team_id.94e9716ab4"], "model.github_source.stg_github__pull_request": ["model.github.int_github__issue_joined", "model.github.int_github__pull_request_times", "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71", "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa"], "model.github_source.stg_github__repository_tmp": ["model.github_source.stg_github__repository", "model.github_source.stg_github__repository"], "model.github_source.stg_github__label_tmp": ["model.github_source.stg_github__label", "model.github_source.stg_github__label"], "model.github_source.stg_github__requested_reviewer_history_tmp": ["model.github_source.stg_github__requested_reviewer_history", "model.github_source.stg_github__requested_reviewer_history"], "model.github_source.stg_github__issue_comment_tmp": ["model.github_source.stg_github__issue_comment", "model.github_source.stg_github__issue_comment"], "model.github_source.stg_github__pull_request_review_tmp": ["model.github_source.stg_github__pull_request_review", "model.github_source.stg_github__pull_request_review"], "model.github_source.stg_github__issue_label_tmp": ["model.github_source.stg_github__issue_label", "model.github_source.stg_github__issue_label"], "model.github_source.stg_github__team_tmp": ["model.github_source.stg_github__team", "model.github_source.stg_github__team"], "model.github_source.stg_github__pull_request_tmp": ["model.github_source.stg_github__pull_request", "model.github_source.stg_github__pull_request"], "model.github_source.stg_github__issue_merged_tmp": ["model.github_source.stg_github__issue_merged", "model.github_source.stg_github__issue_merged"], "model.github_source.stg_github__user_tmp": ["model.github_source.stg_github__user", "model.github_source.stg_github__user"], "model.github_source.stg_github__issue_closed_history_tmp": ["model.github_source.stg_github__issue_closed_history", "model.github_source.stg_github__issue_closed_history"], "model.github_source.stg_github__issue_assignee_tmp": ["model.github_source.stg_github__issue_assignee", "model.github_source.stg_github__issue_assignee"], "model.github_source.stg_github__issue_tmp": ["model.github_source.stg_github__issue", "model.github_source.stg_github__issue"], "model.github_source.stg_github__repo_team_tmp": ["model.github_source.stg_github__repo_team", "model.github_source.stg_github__repo_team"], "test.github.unique_github__issues_issue_id.6723b9b1db": [], "test.github.not_null_github__issues_issue_id.fed0631e25": [], "test.github.unique_github__pull_requests_issue_id.ce23997907": [], "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f": [], "test.github.unique_github__daily_metrics_day.f98cab9456": [], "test.github.not_null_github__daily_metrics_day.647e494434": [], "test.github.unique_github__weekly_metrics_week.6794858a8e": [], "test.github.not_null_github__weekly_metrics_week.4b0b928243": [], "test.github.unique_github__monthly_metrics_month.3076284fbb": [], "test.github.not_null_github__monthly_metrics_month.9e4fba84df": [], "test.github.unique_github__quarterly_metrics_quarter.9165a921c1": [], "test.github.not_null_github__quarterly_metrics_quarter.92394d46dc": [], "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4": [], "test.github_source.not_null_stg_github__label_label_id.9f07379974": [], "test.github_source.unique_stg_github__label_label_id.74d3c21466": [], "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d": [], "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a": [], "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f": [], "test.github_source.unique_stg_github__issue_issue_id.84891aeece": [], "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7": [], "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508": [], "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790": [], "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa": [], "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71": [], "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503": [], "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c": [], "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d": [], "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f": [], "test.github_source.unique_stg_github__team_team_id.94e9716ab4": [], "test.github_source.not_null_stg_github__team_team_id.440aefe7a7": [], "test.github_source.unique_stg_github__user_user_id.5c1a00cd90": [], "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b": [], "source.github_source.github.issue_assignee": [], "source.github_source.github.label": [], "source.github_source.github.issue_closed_history": [], "source.github_source.github.issue_label": [], "source.github_source.github.issue_comment": [], "source.github_source.github.issue_merged": [], "source.github_source.github.issue": [], "source.github_source.github.pull_request_review": [], "source.github_source.github.pull_request": [], "source.github_source.github.repo_team": [], "source.github_source.github.repository": [], "source.github_source.github.requested_reviewer_history": [], "source.github_source.github.team": [], "source.github_source.github.user": []}} \ No newline at end of file diff --git a/docs/run_results.json b/docs/run_results.json new file mode 100644 index 0000000..411daed --- /dev/null +++ b/docs/run_results.json @@ -0,0 +1 @@ +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v4.json", "dbt_version": "1.3.0", "generated_at": "2022-10-26T19:31:50.516072Z", "invocation_id": "56400515-88f7-4836-88ef-853ef5bcc0a5", "env": {}}, "results": [{"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.066418Z", "completed_at": "2022-10-26T19:31:45.069292Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.069476Z", "completed_at": "2022-10-26T19:31:45.069504Z"}], "thread_id": "Thread-1", "execution_time": 0.003910064697265625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_assignee_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.070549Z", "completed_at": "2022-10-26T19:31:45.072124Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.072273Z", "completed_at": "2022-10-26T19:31:45.072279Z"}], "thread_id": "Thread-1", "execution_time": 0.0024938583374023438, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_closed_history_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.073310Z", "completed_at": "2022-10-26T19:31:45.077886Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.078055Z", "completed_at": "2022-10-26T19:31:45.078063Z"}], "thread_id": "Thread-1", "execution_time": 0.005511760711669922, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_comment_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.079220Z", "completed_at": "2022-10-26T19:31:45.080693Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.080835Z", "completed_at": "2022-10-26T19:31:45.080841Z"}], "thread_id": "Thread-1", "execution_time": 0.002401113510131836, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.081720Z", "completed_at": "2022-10-26T19:31:45.082968Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.083101Z", "completed_at": "2022-10-26T19:31:45.083106Z"}], "thread_id": "Thread-1", "execution_time": 0.001962900161743164, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_label_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.084019Z", "completed_at": "2022-10-26T19:31:45.085165Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.085298Z", "completed_at": "2022-10-26T19:31:45.085302Z"}], "thread_id": "Thread-1", "execution_time": 0.0019409656524658203, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_merged_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.086109Z", "completed_at": "2022-10-26T19:31:45.087263Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.087381Z", "completed_at": "2022-10-26T19:31:45.087385Z"}], "thread_id": "Thread-1", "execution_time": 0.0018391609191894531, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_label_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.088119Z", "completed_at": "2022-10-26T19:31:45.089260Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.089381Z", "completed_at": "2022-10-26T19:31:45.089385Z"}], "thread_id": "Thread-1", "execution_time": 0.0017900466918945312, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_pull_request_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.090094Z", "completed_at": "2022-10-26T19:31:45.092300Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.092507Z", "completed_at": "2022-10-26T19:31:45.092512Z"}], "thread_id": "Thread-1", "execution_time": 0.002965211868286133, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_pull_request_review_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.093310Z", "completed_at": "2022-10-26T19:31:45.094460Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.094583Z", "completed_at": "2022-10-26T19:31:45.094587Z"}], "thread_id": "Thread-1", "execution_time": 0.0018031597137451172, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_repo_team_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.095312Z", "completed_at": "2022-10-26T19:31:45.096420Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.096530Z", "completed_at": "2022-10-26T19:31:45.096534Z"}], "thread_id": "Thread-1", "execution_time": 0.0017201900482177734, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_repository_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.097214Z", "completed_at": "2022-10-26T19:31:45.098235Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.098346Z", "completed_at": "2022-10-26T19:31:45.098349Z"}], "thread_id": "Thread-1", "execution_time": 0.0016078948974609375, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_requested_reviewer_history_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.099043Z", "completed_at": "2022-10-26T19:31:45.100095Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.100206Z", "completed_at": "2022-10-26T19:31:45.100209Z"}], "thread_id": "Thread-1", "execution_time": 0.0016582012176513672, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_team_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.100908Z", "completed_at": "2022-10-26T19:31:45.101952Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.102069Z", "completed_at": "2022-10-26T19:31:45.102072Z"}], "thread_id": "Thread-1", "execution_time": 0.0017001628875732422, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_user_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.102897Z", "completed_at": "2022-10-26T19:31:45.105657Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.105787Z", "completed_at": "2022-10-26T19:31:45.105792Z"}], "thread_id": "Thread-1", "execution_time": 0.0033669471740722656, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_assignee_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.106520Z", "completed_at": "2022-10-26T19:31:45.109287Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.109420Z", "completed_at": "2022-10-26T19:31:45.109424Z"}], "thread_id": "Thread-1", "execution_time": 0.0034461021423339844, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_closed_history_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.110103Z", "completed_at": "2022-10-26T19:31:45.111985Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.112104Z", "completed_at": "2022-10-26T19:31:45.112108Z"}], "thread_id": "Thread-1", "execution_time": 0.0024499893188476562, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_comment_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.112757Z", "completed_at": "2022-10-26T19:31:45.114648Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.114771Z", "completed_at": "2022-10-26T19:31:45.114774Z"}], "thread_id": "Thread-1", "execution_time": 0.0024569034576416016, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.115439Z", "completed_at": "2022-10-26T19:31:45.117529Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.117653Z", "completed_at": "2022-10-26T19:31:45.117658Z"}], "thread_id": "Thread-1", "execution_time": 0.0026788711547851562, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_label_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.118346Z", "completed_at": "2022-10-26T19:31:45.120259Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.120382Z", "completed_at": "2022-10-26T19:31:45.120385Z"}], "thread_id": "Thread-1", "execution_time": 0.0024831295013427734, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_merged_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.121047Z", "completed_at": "2022-10-26T19:31:45.122932Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.123050Z", "completed_at": "2022-10-26T19:31:45.123054Z"}], "thread_id": "Thread-1", "execution_time": 0.0024492740631103516, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__label_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.123697Z", "completed_at": "2022-10-26T19:31:45.126219Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.126338Z", "completed_at": "2022-10-26T19:31:45.126341Z"}], "thread_id": "Thread-1", "execution_time": 0.0030786991119384766, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__pull_request_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.127005Z", "completed_at": "2022-10-26T19:31:45.128941Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.129064Z", "completed_at": "2022-10-26T19:31:45.129068Z"}], "thread_id": "Thread-1", "execution_time": 0.00251007080078125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__pull_request_review_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.129736Z", "completed_at": "2022-10-26T19:31:45.131844Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.131966Z", "completed_at": "2022-10-26T19:31:45.131970Z"}], "thread_id": "Thread-1", "execution_time": 0.0026700496673583984, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__repo_team_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.132616Z", "completed_at": "2022-10-26T19:31:45.134522Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.134645Z", "completed_at": "2022-10-26T19:31:45.134649Z"}], "thread_id": "Thread-1", "execution_time": 0.002470254898071289, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__repository_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.135298Z", "completed_at": "2022-10-26T19:31:45.137180Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.137300Z", "completed_at": "2022-10-26T19:31:45.137303Z"}], "thread_id": "Thread-1", "execution_time": 0.002438068389892578, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__requested_reviewer_history_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.137943Z", "completed_at": "2022-10-26T19:31:45.139863Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.139981Z", "completed_at": "2022-10-26T19:31:45.139985Z"}], "thread_id": "Thread-1", "execution_time": 0.002476930618286133, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__team_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.140632Z", "completed_at": "2022-10-26T19:31:45.143171Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.143289Z", "completed_at": "2022-10-26T19:31:45.143293Z"}], "thread_id": "Thread-1", "execution_time": 0.003100156784057617, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__user_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.144022Z", "completed_at": "2022-10-26T19:31:45.517016Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.517301Z", "completed_at": "2022-10-26T19:31:45.517316Z"}], "thread_id": "Thread-1", "execution_time": 0.37406277656555176, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_assignee"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.518923Z", "completed_at": "2022-10-26T19:31:45.960547Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.960864Z", "completed_at": "2022-10-26T19:31:45.960882Z"}], "thread_id": "Thread-1", "execution_time": 0.4431490898132324, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_closed_history"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.962802Z", "completed_at": "2022-10-26T19:31:46.345425Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:46.345833Z", "completed_at": "2022-10-26T19:31:46.345852Z"}], "thread_id": "Thread-1", "execution_time": 0.3844490051269531, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_comment"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:46.347787Z", "completed_at": "2022-10-26T19:31:46.724916Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:46.725081Z", "completed_at": "2022-10-26T19:31:46.725089Z"}], "thread_id": "Thread-1", "execution_time": 0.3783400058746338, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:46.726150Z", "completed_at": "2022-10-26T19:31:47.099172Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:47.099497Z", "completed_at": "2022-10-26T19:31:47.099516Z"}], "thread_id": "Thread-1", "execution_time": 0.3743109703063965, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_label"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:47.101183Z", "completed_at": "2022-10-26T19:31:47.442838Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:47.443091Z", "completed_at": "2022-10-26T19:31:47.443106Z"}], "thread_id": "Thread-1", "execution_time": 0.3428840637207031, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_merged"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:47.444501Z", "completed_at": "2022-10-26T19:31:47.821629Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:47.821877Z", "completed_at": "2022-10-26T19:31:47.821893Z"}], "thread_id": "Thread-1", "execution_time": 0.3782830238342285, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__label"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:47.823433Z", "completed_at": "2022-10-26T19:31:48.111140Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:48.111470Z", "completed_at": "2022-10-26T19:31:48.111488Z"}], "thread_id": "Thread-1", "execution_time": 0.2890939712524414, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__pull_request"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:48.113218Z", "completed_at": "2022-10-26T19:31:48.476494Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:48.476723Z", "completed_at": "2022-10-26T19:31:48.476740Z"}], "thread_id": "Thread-1", "execution_time": 0.3645648956298828, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__pull_request_review"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:48.478068Z", "completed_at": "2022-10-26T19:31:48.865560Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:48.865935Z", "completed_at": "2022-10-26T19:31:48.865955Z"}], "thread_id": "Thread-1", "execution_time": 0.3889122009277344, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__repo_team"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:48.868175Z", "completed_at": "2022-10-26T19:31:49.227113Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:49.227287Z", "completed_at": "2022-10-26T19:31:49.227295Z"}], "thread_id": "Thread-1", "execution_time": 0.3603048324584961, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__repository"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:49.228369Z", "completed_at": "2022-10-26T19:31:49.551590Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:49.551947Z", "completed_at": "2022-10-26T19:31:49.551965Z"}], "thread_id": "Thread-1", "execution_time": 0.3246903419494629, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__requested_reviewer_history"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:49.554066Z", "completed_at": "2022-10-26T19:31:49.915948Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:49.916270Z", "completed_at": "2022-10-26T19:31:49.916287Z"}], "thread_id": "Thread-1", "execution_time": 0.36368680000305176, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__team"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:49.918249Z", "completed_at": "2022-10-26T19:31:50.274281Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.274546Z", "completed_at": "2022-10-26T19:31:50.274562Z"}], "thread_id": "Thread-1", "execution_time": 0.3573720455169678, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__user"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.276290Z", "completed_at": "2022-10-26T19:31:50.289385Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.289553Z", "completed_at": "2022-10-26T19:31:50.289559Z"}], "thread_id": "Thread-1", "execution_time": 0.014101028442382812, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.290413Z", "completed_at": "2022-10-26T19:31:50.336841Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.336978Z", "completed_at": "2022-10-26T19:31:50.336985Z"}], "thread_id": "Thread-1", "execution_time": 0.04710721969604492, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.340320Z", "completed_at": "2022-10-26T19:31:50.344918Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.345044Z", "completed_at": "2022-10-26T19:31:50.345048Z"}], "thread_id": "Thread-1", "execution_time": 0.005175113677978516, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.345698Z", "completed_at": "2022-10-26T19:31:50.349073Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.349200Z", "completed_at": "2022-10-26T19:31:50.349203Z"}], "thread_id": "Thread-1", "execution_time": 0.003951072692871094, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.356117Z", "completed_at": "2022-10-26T19:31:50.359075Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.359234Z", "completed_at": "2022-10-26T19:31:50.359237Z"}], "thread_id": "Thread-1", "execution_time": 0.0035669803619384766, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.359908Z", "completed_at": "2022-10-26T19:31:50.362409Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.362538Z", "completed_at": "2022-10-26T19:31:50.362542Z"}], "thread_id": "Thread-1", "execution_time": 0.0030930042266845703, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__issue_issue_id.84891aeece"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.366318Z", "completed_at": "2022-10-26T19:31:50.368643Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.368763Z", "completed_at": "2022-10-26T19:31:50.368767Z"}], "thread_id": "Thread-1", "execution_time": 0.002894163131713867, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__label_label_id.9f07379974"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.369407Z", "completed_at": "2022-10-26T19:31:50.371720Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.371841Z", "completed_at": "2022-10-26T19:31:50.371845Z"}], "thread_id": "Thread-1", "execution_time": 0.0028769969940185547, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__label_label_id.74d3c21466"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.372530Z", "completed_at": "2022-10-26T19:31:50.374909Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.375037Z", "completed_at": "2022-10-26T19:31:50.375040Z"}], "thread_id": "Thread-1", "execution_time": 0.0029938220977783203, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.375688Z", "completed_at": "2022-10-26T19:31:50.378696Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.378831Z", "completed_at": "2022-10-26T19:31:50.378834Z"}], "thread_id": "Thread-1", "execution_time": 0.0035920143127441406, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.379474Z", "completed_at": "2022-10-26T19:31:50.381873Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.381998Z", "completed_at": "2022-10-26T19:31:50.382001Z"}], "thread_id": "Thread-1", "execution_time": 0.0029680728912353516, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.382638Z", "completed_at": "2022-10-26T19:31:50.384884Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.385012Z", "completed_at": "2022-10-26T19:31:50.385015Z"}], "thread_id": "Thread-1", "execution_time": 0.002820253372192383, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.385637Z", "completed_at": "2022-10-26T19:31:50.387933Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.388056Z", "completed_at": "2022-10-26T19:31:50.388059Z"}], "thread_id": "Thread-1", "execution_time": 0.002858877182006836, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.388688Z", "completed_at": "2022-10-26T19:31:50.390962Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.391078Z", "completed_at": "2022-10-26T19:31:50.391082Z"}], "thread_id": "Thread-1", "execution_time": 0.002830028533935547, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.391768Z", "completed_at": "2022-10-26T19:31:50.394131Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.394251Z", "completed_at": "2022-10-26T19:31:50.394255Z"}], "thread_id": "Thread-1", "execution_time": 0.002959728240966797, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.394891Z", "completed_at": "2022-10-26T19:31:50.397859Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.397978Z", "completed_at": "2022-10-26T19:31:50.397982Z"}], "thread_id": "Thread-1", "execution_time": 0.0035300254821777344, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.409647Z", "completed_at": "2022-10-26T19:31:50.411959Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.412082Z", "completed_at": "2022-10-26T19:31:50.412086Z"}], "thread_id": "Thread-1", "execution_time": 0.0028810501098632812, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__team_team_id.440aefe7a7"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.412716Z", "completed_at": "2022-10-26T19:31:50.414975Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.415096Z", "completed_at": "2022-10-26T19:31:50.415100Z"}], "thread_id": "Thread-1", "execution_time": 0.0028247833251953125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__team_team_id.94e9716ab4"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.423079Z", "completed_at": "2022-10-26T19:31:50.425394Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.425512Z", "completed_at": "2022-10-26T19:31:50.425516Z"}], "thread_id": "Thread-1", "execution_time": 0.0028798580169677734, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.426146Z", "completed_at": "2022-10-26T19:31:50.428396Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.428517Z", "completed_at": "2022-10-26T19:31:50.428520Z"}], "thread_id": "Thread-1", "execution_time": 0.002816915512084961, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__user_user_id.5c1a00cd90"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.452959Z", "completed_at": "2022-10-26T19:31:50.459032Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.459161Z", "completed_at": "2022-10-26T19:31:50.459166Z"}], "thread_id": "Thread-1", "execution_time": 0.006687164306640625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__issues"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.459915Z", "completed_at": "2022-10-26T19:31:50.463305Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.463447Z", "completed_at": "2022-10-26T19:31:50.463451Z"}], "thread_id": "Thread-1", "execution_time": 0.004002809524536133, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__pull_requests"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.464194Z", "completed_at": "2022-10-26T19:31:50.466627Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.466752Z", "completed_at": "2022-10-26T19:31:50.466756Z"}], "thread_id": "Thread-1", "execution_time": 0.0030107498168945312, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__issues_issue_id.fed0631e25"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.467402Z", "completed_at": "2022-10-26T19:31:50.469648Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.469771Z", "completed_at": "2022-10-26T19:31:50.469775Z"}], "thread_id": "Thread-1", "execution_time": 0.002838134765625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__issues_issue_id.6723b9b1db"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.470404Z", "completed_at": "2022-10-26T19:31:50.474713Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.474850Z", "completed_at": "2022-10-26T19:31:50.474854Z"}], "thread_id": "Thread-1", "execution_time": 0.004888057708740234, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__daily_metrics"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.475557Z", "completed_at": "2022-10-26T19:31:50.478532Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.478653Z", "completed_at": "2022-10-26T19:31:50.478657Z"}], "thread_id": "Thread-1", "execution_time": 0.0035419464111328125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.479288Z", "completed_at": "2022-10-26T19:31:50.481519Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.481638Z", "completed_at": "2022-10-26T19:31:50.481642Z"}], "thread_id": "Thread-1", "execution_time": 0.0027861595153808594, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__pull_requests_issue_id.ce23997907"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.482254Z", "completed_at": "2022-10-26T19:31:50.484260Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.484398Z", "completed_at": "2022-10-26T19:31:50.484401Z"}], "thread_id": "Thread-1", "execution_time": 0.0025832653045654297, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__monthly_metrics"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.485070Z", "completed_at": "2022-10-26T19:31:50.487034Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.487153Z", "completed_at": "2022-10-26T19:31:50.487156Z"}], "thread_id": "Thread-1", "execution_time": 0.002526998519897461, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__quarterly_metrics"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.487843Z", "completed_at": "2022-10-26T19:31:50.489836Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.489956Z", "completed_at": "2022-10-26T19:31:50.489959Z"}], "thread_id": "Thread-1", "execution_time": 0.002591848373413086, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__weekly_metrics"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.490653Z", "completed_at": "2022-10-26T19:31:50.492959Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.493078Z", "completed_at": "2022-10-26T19:31:50.493081Z"}], "thread_id": "Thread-1", "execution_time": 0.0028679370880126953, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__daily_metrics_day.647e494434"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.493700Z", "completed_at": "2022-10-26T19:31:50.496611Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.496732Z", "completed_at": "2022-10-26T19:31:50.496735Z"}], "thread_id": "Thread-1", "execution_time": 0.0034720897674560547, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__daily_metrics_day.f98cab9456"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.497360Z", "completed_at": "2022-10-26T19:31:50.499658Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.499788Z", "completed_at": "2022-10-26T19:31:50.499792Z"}], "thread_id": "Thread-1", "execution_time": 0.002870798110961914, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__monthly_metrics_month.9e4fba84df"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.500409Z", "completed_at": "2022-10-26T19:31:50.502642Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.502762Z", "completed_at": "2022-10-26T19:31:50.502766Z"}], "thread_id": "Thread-1", "execution_time": 0.0027921199798583984, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__monthly_metrics_month.3076284fbb"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.503385Z", "completed_at": "2022-10-26T19:31:50.505652Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.505770Z", "completed_at": "2022-10-26T19:31:50.505774Z"}], "thread_id": "Thread-1", "execution_time": 0.0028269290924072266, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__quarterly_metrics_quarter.92394d46dc"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.506386Z", "completed_at": "2022-10-26T19:31:50.508612Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.508741Z", "completed_at": "2022-10-26T19:31:50.508745Z"}], "thread_id": "Thread-1", "execution_time": 0.002791881561279297, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__quarterly_metrics_quarter.9165a921c1"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.509357Z", "completed_at": "2022-10-26T19:31:50.511635Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.511754Z", "completed_at": "2022-10-26T19:31:50.511758Z"}], "thread_id": "Thread-1", "execution_time": 0.002836942672729492, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__weekly_metrics_week.4b0b928243"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.512388Z", "completed_at": "2022-10-26T19:31:50.515250Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.515372Z", "completed_at": "2022-10-26T19:31:50.515375Z"}], "thread_id": "Thread-1", "execution_time": 0.0034258365631103516, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__weekly_metrics_week.6794858a8e"}], "elapsed_time": 7.2774131298065186, "args": {"write_json": true, "use_colors": true, "printer_width": 80, "version_check": true, "partial_parse": true, "static_parser": true, "profiles_dir": "/Users/catherinefritz/.dbt", "send_anonymous_usage_stats": true, "event_buffer_size": 100000, "quiet": false, "no_print": false, "compile": true, "which": "generate", "rpc_method": "docs.generate", "indirect_selection": "eager"}} \ No newline at end of file From 5eaf0d0dc263d728dccba9a582d1ed2e827fa7d3 Mon Sep 17 00:00:00 2001 From: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com> Date: Wed, 26 Oct 2022 15:20:27 -0500 Subject: [PATCH 20/30] update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3dcead9..6546cec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # dbt_github v0.6.0 ## 🚨 Breaking Changes 🚨: -[PR #26](https://github.com/fivetran/dbt_github_source/pull/26) includes the following breaking changes: +[PR #35](https://github.com/fivetran/dbt_github/pull/35) includes the following breaking changes: - Dispatch update for dbt-utils to dbt-core cross-db macros migration. Specifically `{{ dbt_utils. }}` have been updated to `{{ dbt. }}` for the below macros: - `any_value` - `bool_or` From b1f68a4fb65c19933e8427f86e99ce01d08424a0 Mon Sep 17 00:00:00 2001 From: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com> Date: Wed, 26 Oct 2022 15:27:56 -0500 Subject: [PATCH 21/30] update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cb2a94d..6d5ae7e 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,7 @@ packages: - package: dbt-labs/dbt_utils version: [">=1.0.0", "<2.0.0"] - - package: fivetran/github + - package: fivetran/github_source version: [">=0.6.0", "<0.7.0"] ``` ## Contributions From 24fa1f188852552830a6a53b6670eaf5efc32283 Mon Sep 17 00:00:00 2001 From: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com> Date: Mon, 31 Oct 2022 16:48:48 -0500 Subject: [PATCH 22/30] update readme --- README.md | 115 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 69 insertions(+), 46 deletions(-) diff --git a/README.md b/README.md index 6d5ae7e..41e94e5 100644 --- a/README.md +++ b/README.md @@ -10,30 +10,37 @@

-# GitHub ([Docs](https://dbt-github.netlify.app/)) +# Github dbt Package ([Docs](https://fivetran.github.io/dbt_github/)) +# 📣 What does this dbt package do? -This package models GitHub data from [Fivetran's connector](https://fivetran.com/docs/applications/github). It uses data in the format described by [this ERD](https://docs.google.com/presentation/d/1lx6ez7-x-s-n2JCnCi3SjG4XMmx9ysNUvaNCaWc3I_I/edit). +- Produces modeled tables that leverage Github data from [Fivetran's connector](https://fivetran.com/docs/applications/github) in the format described by [this ERD](https://fivetran.com/docs/applications/github#schemainformation) and builds off of the output from our [github source package](https://github.com/fivetran/dbt_github_source). -This package enables you to better understand your GitHub issues and pull requests. Its main focus is to enhance these two core objects with commonly used metrics. Additionally, the metrics tables let you better understand your team's velocity over time. These metrics are available on a daily, weekly, monthly and quarterly level. +- Provides insight into GitHub issues and pull requests by enhancing these core objects with commonly used metrics. +- Produces metrics tables, which increase understanding of your team's velocity over time. Metrics are available on a daily, weekly, monthly, and quarterly level. +- Generates a comprehensive data dictionary of your source and modeled github data through the [dbt docs site](https://fivetran.github.io/dbt_github/). -## Models +The following table provides a detailed list of all models materialized within this package by default. +> TIP: See more details about these models in the package's [dbt docs site](https://fivetran.github.io/dbt_github/#!/overview?g_v=1&g_e=seeds). -This package contains transformation models, designed to work simultaneously with our [GitHub source package](https://github.com/fivetran/dbt_github_source). A dependency on the source package is declared in this package's `packages.yml` file, so it will automatically download when you run `dbt deps`. The primary outputs of this package are described below. Intermediate models are used to create these output models. - -| **model** | **description** | +| **Model** | **Description** | | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [github__issues](https://github.com/fivetran/dbt_github/blob/master/models/github__issues.sql) | Each record represents a GitHub issue, enriched with data about its assignees, milestones, and time comparisons. | -| [github__pull_requests](https://github.com/fivetran/dbt_github/blob/master/models/github__pull_requests.sql) | Each record represents a GitHub pull request, enriched with data about its repository, reviewers, and durations between review requests, merges and reviews. | -| [github__daily_metrics](https://github.com/fivetran/dbt_github/blob/master/models/github__daily_metrics.sql) | Each record represents a single day, enriched with metrics about PRs and issues that were created and closed during that period. | -| [github__weekly_metrics](https://github.com/fivetran/dbt_github/blob/master/models/github__weekly_metrics.sql) | Each record represents a single week, enriched with metrics about PRs and issues that were created and closed during that period. | -| [github__monthly_metrics](https://github.com/fivetran/dbt_github/blob/master/models/github__monthly_metrics.sql) | Each record represents a single month, enriched with metrics about PRs and issues that were created and closed during that period. | -| [github__quarterly_metrics](https://github.com/fivetran/dbt_github/blob/master/models/github__quarterly_metrics.sql) | Each record represents a single quarter, enriched with metrics about PRs and issues that were created and closed during that period. | +| [github__issues](https://fivetran.github.io/dbt_github/#!/model/model.github.github__issues) | Each record represents a GitHub issue, enriched with data about its assignees, milestones, and time comparisons. | +| [github__pull_requests](https://fivetran.github.io/dbt_github/#!/model/model.github.github__pull_requests) | Each record represents a GitHub pull request, enriched with data about its repository, reviewers, and durations between review requests, merges and reviews. | +| [github__daily_metrics](https://fivetran.github.io/dbt_github/#!/model/model.github.github__daily_metrics) | Each record represents a single day, enriched with metrics about PRs and issues that were created and closed during that period. | +| [github__weekly_metrics](https://fivetran.github.io/dbt_github/#!/model/model.github.github__weekly_metrics) | Each record represents a single week, enriched with metrics about PRs and issues that were created and closed during that period. | +| [github__monthly_metrics](https://fivetran.github.io/dbt_github/#!/model/model.github.github__monthly_metrics) | Each record represents a single month, enriched with metrics about PRs and issues that were created and closed during that period. | +| [github__quarterly_metrics](https://fivetran.github.io/dbt_github/#!/model/model.github.github__quarterly_metrics) | Each record represents a single quarter, enriched with metrics about PRs and issues that were created and closed during that period. | +# 🎯 How do I use the dbt package? +## Step 1: Prerequisites +To use this dbt package, you must have the following: -## Installation Instructions -Check [dbt Hub](https://hub.getdbt.com/) for the latest installation instructions, or [read the dbt docs](https://docs.getdbt.com/docs/package-management) for more information on installing packages. +- At least one Fivetran Github connector syncing data into your destination. +- A **BigQuery**, **Snowflake**, or **Redshift*** destination. -Include in your `packages.yml` +## Step 2: Install the package +Include the following github package version in your `packages.yml` file. +> TIP: Check [dbt Hub](https://hub.getdbt.com/) for the latest installation instructions, or [read the dbt docs](https://docs.getdbt.com/docs/package-management) for more information on installing packages. ```yaml packages: @@ -41,40 +48,61 @@ packages: version: [">=0.6.0", "<0.7.0"] ``` -## Configuration -By default, this package will look for your GitHub data in the `github` schema of your [target database](https://docs.getdbt.com/docs/running-a-dbt-project/using-the-command-line-interface/configure-your-profile). If this is not where your GitHub data is (perhaps your GitHub schema is `github_fivetran`), add the following configuration to your `dbt_project.yml` file: +## Step 3: Define database and schema variables +By default, this package runs using your [destination](https://docs.getdbt.com/docs/running-a-dbt-project/using-the-command-line-interface/configure-your-profile) and the `github` schema. If this is not where your Github data is (for example, if your github schema is named `github_fivetran`), add the following configuration to your root `dbt_project.yml` file: ```yml -# dbt_project.yml - -... -config-version: 2 - vars: github_source: github_database: your_database_name github_schema: your_schema_name ``` -### Disabling Models +## Step 4: Disable models for non-existent sources Your Github connector might not sync every table that this package expects. If your syncs exclude certain tables, it is because you either don't use that functionality in Github or have actively excluded some tables from your syncs. If you do not have the `REPO_TEAM` table synced, add the following variable to your `dbt_project.yml` file: ```yml -# dbt_project.yml -config-version: 2 - vars: github__using_repo_team: false # by default this is assumed to be true ``` *Note: This package only integrates the above variable. If you'd like to disable other models, please create an [issue](https://github.com/fivetran/dbt_github/issues) specifying which ones.* -## Database support -This package has been tested on BigQuery, Snowflake and Redshift. +## (Optional) Step 5: Additional configurations + +
Expand for configurations + +### Change the build schema +By default, this package builds the Github staging models within a schema titled (`` + `_stg_github`) and your Github modeling models within a schema titled (`` + `_github`) in your destination. If this is not where you would like your Github data to be written to, add the following configuration to your root `dbt_project.yml` file: + +```yml +models: + github_source: + +schema: my_new_schema_name # leave blank for just the target_schema + github: + +schema: my_new_schema_name # leave blank for just the target_schema +``` +### Change the source table references +If an individual source table has a different name than the package expects, add the table name as it appears in your destination to the respective variable: + +> IMPORTANT: See this project's [`dbt_project.yml`](https://github.com/fivetran/dbt_github_source/blob/main/dbt_project.yml) variable declarations to see the expected names. -## Dependencies +```yml +vars: + github__identifier: your_table_name +``` +
+ +## (Optional) Step 6: Orchestrate your models with Fivetran Transformations for dbt Core™ +
Expand for more details + +Fivetran offers the ability for you to orchestrate your dbt project through [Fivetran Transformations for dbt Core™](https://fivetran.com/docs/transformations/dbt). Learn how to set up your project for orchestration through Fivetran in our [Transformations for dbt Core setup guides](https://fivetran.com/docs/transformations/dbt#setupguide). + +
+ +# 🔍 Does this package have dependencies? This dbt package is dependent on the following dbt packages. Please be aware that these dependencies are installed by default within this package. For more information on the following packages, refer to the [dbt hub](https://hub.getdbt.com/) site. > IMPORTANT: If you have any of these dependent packages in your own `packages.yml` file, we highly recommend that you remove them from your root `packages.yml` to avoid package version conflicts. @@ -89,21 +117,16 @@ packages: - package: fivetran/github_source version: [">=0.6.0", "<0.7.0"] ``` +# 🙌 How is this package maintained and can I contribute? +## Package Maintenance +The Fivetran team maintaining this package _only_ maintains the latest version of the package. We highly recommend you stay consistent with the [latest version](https://hub.getdbt.com/fivetran/github/latest/) of the package and refer to the [CHANGELOG](https://github.com/fivetran/dbt_github/blob/main/CHANGELOG.md) and release notes for more information on changes across versions. + ## Contributions +A small team of analytics engineers at Fivetran develops these dbt packages. However, the packages are made better by community contributions! + +We highly encourage and welcome contributions to this package. Check out [this dbt Discourse article](https://discourse.getdbt.com/t/contributing-to-a-dbt-package/657) on the best workflow for contributing to a package! -Additional contributions to this package are very welcome! Please create issues -or open PRs against `main`. Check out -[this post](https://discourse.getdbt.com/t/contributing-to-a-dbt-package/657) -on the best workflow for contributing to a package. - -## Resources: -- Provide [feedback](https://www.surveymonkey.com/r/DQ7K7WW) on our existing dbt packages or what you'd like to see next -- Find all of Fivetran's pre-built dbt packages in our [dbt hub](https://hub.getdbt.com/fivetran/) -- Learn more about Fivetran [in the Fivetran docs](https://fivetran.com/docs) -- Learn how to orchestrate your models with [Fivetran Transformations for dbt Core™](https://fivetran.com/docs/transformations/dbt) -- Check out [Fivetran's blog](https://fivetran.com/blog) -- Learn more about dbt [in the dbt docs](https://docs.getdbt.com/docs/introduction) -- Check out [Discourse](https://discourse.getdbt.com/) for commonly asked questions and answers -- Join the [chat](http://slack.getdbt.com/) on Slack for live discussions and support -- Find [dbt events](https://events.getdbt.com) near you -- Check out [the dbt blog](https://blog.getdbt.com/) for the latest news on dbt's development and best practices +# 🏪 Are there any resources available? +- If you have questions or want to reach out for help, please refer to the [GitHub Issue](https://github.com/fivetran/dbt_github/issues/new/choose) section to find the right avenue of support for you. +- If you would like to provide feedback to the dbt package team at Fivetran or would like to request a new dbt package, fill out our [Feedback Form](https://www.surveymonkey.com/r/DQ7K7WW). +- Have questions or want to just say hi? Book a time during our office hours [on Calendly](https://calendly.com/fivetran-solutions-team/fivetran-solutions-team-office-hours) or email us at solutions@fivetran.com. \ No newline at end of file From 744c813fe0df7561d1738ee305d2c013374a8661 Mon Sep 17 00:00:00 2001 From: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com> Date: Mon, 31 Oct 2022 19:41:10 -0500 Subject: [PATCH 23/30] regen docs --- docs/catalog.json | 2 +- docs/manifest.json | 2 +- docs/run_results.json | 2 +- integration_tests/dbt_project.yml | 28 ++++++++++++++-------------- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/docs/catalog.json b/docs/catalog.json index 94f5bb3..d50ae98 100644 --- a/docs/catalog.json +++ b/docs/catalog.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "1.3.0", "generated_at": "2022-10-26T19:31:54.439013Z", "invocation_id": "56400515-88f7-4836-88ef-853ef5bcc0a5", "env": {}}, "nodes": {"model.github_source.stg_github__pull_request_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__pull_request_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "base_label": {"type": "STRING", "index": 3, "name": "base_label", "comment": null}, "base_ref": {"type": "STRING", "index": 4, "name": "base_ref", "comment": null}, "base_repo_id": {"type": "INT64", "index": 5, "name": "base_repo_id", "comment": null}, "base_sha": {"type": "STRING", "index": 6, "name": "base_sha", "comment": null}, "base_user_id": {"type": "INT64", "index": 7, "name": "base_user_id", "comment": null}, "head_label": {"type": "STRING", "index": 8, "name": "head_label", "comment": null}, "head_ref": {"type": "STRING", "index": 9, "name": "head_ref", "comment": null}, "head_repo_id": {"type": "INT64", "index": 10, "name": "head_repo_id", "comment": null}, "head_sha": {"type": "STRING", "index": 11, "name": "head_sha", "comment": null}, "head_user_id": {"type": "INT64", "index": 12, "name": "head_user_id", "comment": null}, "issue_id": {"type": "INT64", "index": 13, "name": "issue_id", "comment": null}, "merge_commit_sha": {"type": "STRING", "index": 14, "name": "merge_commit_sha", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__pull_request_tmp"}, "model.github_source.stg_github__label": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__label", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"label_id": {"type": "INT64", "index": 1, "name": "label_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "color": {"type": "STRING", "index": 3, "name": "color", "comment": null}, "description": {"type": "STRING", "index": 4, "name": "description", "comment": null}, "is_default": {"type": "BOOL", "index": 5, "name": "is_default", "comment": null}, "label": {"type": "STRING", "index": 6, "name": "label", "comment": null}, "url": {"type": "STRING", "index": 7, "name": "url", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 15.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2016.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__label"}, "seed.github_integration_tests.github_repo_team_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_repo_team_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"repository_id": {"type": "INT64", "index": 1, "name": "repository_id", "comment": null}, "team_id": {"type": "INT64", "index": 2, "name": "team_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "permission": {"type": "STRING", "index": 4, "name": "permission", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 8.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 464.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_repo_team_data"}, "model.github_source.stg_github__pull_request_review_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__pull_request_review_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "commit_sha": {"type": "STRING", "index": 4, "name": "commit_sha", "comment": null}, "pull_request_id": {"type": "INT64", "index": 5, "name": "pull_request_id", "comment": null}, "state": {"type": "STRING", "index": 6, "name": "state", "comment": null}, "submitted_at": {"type": "TIMESTAMP", "index": 7, "name": "submitted_at", "comment": null}, "user_id": {"type": "INT64", "index": 8, "name": "user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__pull_request_review_tmp"}, "model.github_source.stg_github__issue_label_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__issue_label_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "label_id": {"type": "INT64", "index": 2, "name": "label_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_label_tmp"}, "seed.github_integration_tests.github_issue_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "closed_at": {"type": "TIMESTAMP", "index": 4, "name": "closed_at", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 5, "name": "created_at", "comment": null}, "locked": {"type": "BOOL", "index": 6, "name": "locked", "comment": null}, "milestone_id": {"type": "INT64", "index": 7, "name": "milestone_id", "comment": null}, "number": {"type": "INT64", "index": 8, "name": "number", "comment": null}, "pull_request": {"type": "BOOL", "index": 9, "name": "pull_request", "comment": null}, "repository_id": {"type": "INT64", "index": 10, "name": "repository_id", "comment": null}, "state": {"type": "STRING", "index": 11, "name": "state", "comment": null}, "title": {"type": "STRING", "index": 12, "name": "title", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 13, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 14, "name": "user_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 197.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 40530.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_data"}, "model.github_source.stg_github__issue_assignee_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__issue_assignee_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "user_id": {"type": "INT64", "index": 2, "name": "user_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_assignee_tmp"}, "model.github_source.stg_github__repository_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__repository_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "archived": {"type": "BOOL", "index": 3, "name": "archived", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "default_branch": {"type": "STRING", "index": 5, "name": "default_branch", "comment": null}, "description": {"type": "STRING", "index": 6, "name": "description", "comment": null}, "fork": {"type": "BOOL", "index": 7, "name": "fork", "comment": null}, "full_name": {"type": "STRING", "index": 8, "name": "full_name", "comment": null}, "homepage": {"type": "INT64", "index": 9, "name": "homepage", "comment": null}, "language": {"type": "STRING", "index": 10, "name": "language", "comment": null}, "name": {"type": "STRING", "index": 11, "name": "name", "comment": null}, "owner_id": {"type": "INT64", "index": 12, "name": "owner_id", "comment": null}, "private": {"type": "BOOL", "index": 13, "name": "private", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__repository_tmp"}, "model.github_source.stg_github__pull_request_review": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__pull_request_review", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"pull_request_review_id": {"type": "INT64", "index": 1, "name": "pull_request_review_id", "comment": null}, "pull_request_id": {"type": "INT64", "index": 2, "name": "pull_request_id", "comment": null}, "submitted_at": {"type": "TIMESTAMP", "index": 3, "name": "submitted_at", "comment": null}, "state": {"type": "STRING", "index": 4, "name": "state", "comment": null}, "user_id": {"type": "INT64", "index": 5, "name": "user_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 114.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 4835.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__pull_request_review"}, "model.github.github__monthly_metrics": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github__monthly_metrics", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"month": {"type": "TIMESTAMP", "index": 1, "name": "month", "comment": null}, "number_issues_opened": {"type": "INT64", "index": 2, "name": "number_issues_opened", "comment": null}, "number_issues_closed": {"type": "INT64", "index": 3, "name": "number_issues_closed", "comment": null}, "avg_days_issue_open": {"type": "FLOAT64", "index": 4, "name": "avg_days_issue_open", "comment": null}, "longest_days_issue_open": {"type": "FLOAT64", "index": 5, "name": "longest_days_issue_open", "comment": null}, "number_prs_opened": {"type": "INT64", "index": 6, "name": "number_prs_opened", "comment": null}, "number_prs_merged": {"type": "INT64", "index": 7, "name": "number_prs_merged", "comment": null}, "number_prs_closed_without_merge": {"type": "INT64", "index": 8, "name": "number_prs_closed_without_merge", "comment": null}, "avg_days_pr_open": {"type": "FLOAT64", "index": 9, "name": "avg_days_pr_open", "comment": null}, "longest_days_pr_open": {"type": "FLOAT64", "index": 10, "name": "longest_days_pr_open", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 25.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1888.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__monthly_metrics"}, "seed.github_integration_tests.github_issue_comment_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_comment_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "created_at": {"type": "DATETIME", "index": 4, "name": "created_at", "comment": null}, "issue_id": {"type": "INT64", "index": 5, "name": "issue_id", "comment": null}, "updated_at": {"type": "DATETIME", "index": 6, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 7, "name": "user_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 43.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 4902.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_comment_data"}, "seed.github_integration_tests.github_issue_label_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_label_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "label_id": {"type": "INT64", "index": 2, "name": "label_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 46.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1104.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_label_data"}, "model.github_source.stg_github__label_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__label_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "color": {"type": "STRING", "index": 3, "name": "color", "comment": null}, "description": {"type": "STRING", "index": 4, "name": "description", "comment": null}, "is_default": {"type": "BOOL", "index": 5, "name": "is_default", "comment": null}, "name": {"type": "STRING", "index": 6, "name": "name", "comment": null}, "url": {"type": "STRING", "index": 7, "name": "url", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__label_tmp"}, "model.github_source.stg_github__pull_request": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__pull_request", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"pull_request_id": {"type": "INT64", "index": 1, "name": "pull_request_id", "comment": null}, "issue_id": {"type": "INT64", "index": 2, "name": "issue_id", "comment": null}, "head_repo_id": {"type": "INT64", "index": 3, "name": "head_repo_id", "comment": null}, "head_user_id": {"type": "INT64", "index": 4, "name": "head_user_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 167.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 5320.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__pull_request"}, "model.github_source.stg_github__issue_merged_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__issue_merged_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"commit_sha": {"type": "STRING", "index": 1, "name": "commit_sha", "comment": null}, "issue_id": {"type": "INT64", "index": 2, "name": "issue_id", "comment": null}, "merged_at": {"type": "TIMESTAMP", "index": 3, "name": "merged_at", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 5, "name": "actor_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_merged_tmp"}, "seed.github_integration_tests.github_requested_reviewer_history_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_requested_reviewer_history_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"created_at": {"type": "TIMESTAMP", "index": 1, "name": "created_at", "comment": null}, "pull_request_id": {"type": "INT64", "index": 2, "name": "pull_request_id", "comment": null}, "requested_id": {"type": "INT64", "index": 3, "name": "requested_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 5, "name": "actor_id", "comment": null}, "removed": {"type": "BOOL", "index": 6, "name": "removed", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 41.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1681.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_requested_reviewer_history_data"}, "model.github_source.stg_github__issue_closed_history_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__issue_closed_history_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 2, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 4, "name": "actor_id", "comment": null}, "closed": {"type": "BOOL", "index": 5, "name": "closed", "comment": null}, "commit_sha": {"type": "INT64", "index": 6, "name": "commit_sha", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_closed_history_tmp"}, "model.github_source.stg_github__issue_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__issue_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "closed_at": {"type": "TIMESTAMP", "index": 4, "name": "closed_at", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 5, "name": "created_at", "comment": null}, "locked": {"type": "BOOL", "index": 6, "name": "locked", "comment": null}, "milestone_id": {"type": "INT64", "index": 7, "name": "milestone_id", "comment": null}, "number": {"type": "INT64", "index": 8, "name": "number", "comment": null}, "pull_request": {"type": "BOOL", "index": 9, "name": "pull_request", "comment": null}, "repository_id": {"type": "INT64", "index": 10, "name": "repository_id", "comment": null}, "state": {"type": "STRING", "index": 11, "name": "state", "comment": null}, "title": {"type": "STRING", "index": 12, "name": "title", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 13, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 14, "name": "user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_tmp"}, "model.github_source.stg_github__user_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__user_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "bio": {"type": "STRING", "index": 3, "name": "bio", "comment": null}, "blog": {"type": "STRING", "index": 4, "name": "blog", "comment": null}, "company": {"type": "STRING", "index": 5, "name": "company", "comment": null}, "created_at": {"type": "DATETIME", "index": 6, "name": "created_at", "comment": null}, "hireable": {"type": "BOOL", "index": 7, "name": "hireable", "comment": null}, "location": {"type": "STRING", "index": 8, "name": "location", "comment": null}, "login": {"type": "STRING", "index": 9, "name": "login", "comment": null}, "name": {"type": "STRING", "index": 10, "name": "name", "comment": null}, "site_admin": {"type": "BOOL", "index": 11, "name": "site_admin", "comment": null}, "type": {"type": "STRING", "index": 12, "name": "type", "comment": null}, "updated_at": {"type": "DATETIME", "index": 13, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__user_tmp"}, "model.github_source.stg_github__issue": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__issue", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "body": {"type": "STRING", "index": 2, "name": "body", "comment": null}, "closed_at": {"type": "TIMESTAMP", "index": 3, "name": "closed_at", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "is_locked": {"type": "BOOL", "index": 5, "name": "is_locked", "comment": null}, "milestone_id": {"type": "INT64", "index": 6, "name": "milestone_id", "comment": null}, "issue_number": {"type": "INT64", "index": 7, "name": "issue_number", "comment": null}, "is_pull_request": {"type": "BOOL", "index": 8, "name": "is_pull_request", "comment": null}, "repository_id": {"type": "INT64", "index": 9, "name": "repository_id", "comment": null}, "state": {"type": "STRING", "index": 10, "name": "state", "comment": null}, "title": {"type": "STRING", "index": 11, "name": "title", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 12, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 13, "name": "user_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 197.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 38954.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue"}, "seed.github_integration_tests.github_pull_request_review_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_pull_request_review_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "commit_sha": {"type": "STRING", "index": 4, "name": "commit_sha", "comment": null}, "pull_request_id": {"type": "INT64", "index": 5, "name": "pull_request_id", "comment": null}, "state": {"type": "STRING", "index": 6, "name": "state", "comment": null}, "submitted_at": {"type": "TIMESTAMP", "index": 7, "name": "submitted_at", "comment": null}, "user_id": {"type": "INT64", "index": 8, "name": "user_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 114.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 18059.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_pull_request_review_data"}, "model.github_source.stg_github__team": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__team", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"team_id": {"type": "INT64", "index": 1, "name": "team_id", "comment": null}, "description": {"type": "STRING", "index": 2, "name": "description", "comment": null}, "name": {"type": "STRING", "index": 3, "name": "name", "comment": null}, "parent_id": {"type": "INT64", "index": 4, "name": "parent_id", "comment": null}, "privacy": {"type": "STRING", "index": 5, "name": "privacy", "comment": null}, "slug": {"type": "STRING", "index": 6, "name": "slug", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 19.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2042.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__team"}, "model.github.github__quarterly_metrics": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github__quarterly_metrics", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"quarter": {"type": "TIMESTAMP", "index": 1, "name": "quarter", "comment": null}, "number_issues_opened": {"type": "INT64", "index": 2, "name": "number_issues_opened", "comment": null}, "number_issues_closed": {"type": "INT64", "index": 3, "name": "number_issues_closed", "comment": null}, "avg_days_issue_open": {"type": "FLOAT64", "index": 4, "name": "avg_days_issue_open", "comment": null}, "longest_days_issue_open": {"type": "FLOAT64", "index": 5, "name": "longest_days_issue_open", "comment": null}, "number_prs_opened": {"type": "INT64", "index": 6, "name": "number_prs_opened", "comment": null}, "number_prs_merged": {"type": "INT64", "index": 7, "name": "number_prs_merged", "comment": null}, "number_prs_closed_without_merge": {"type": "INT64", "index": 8, "name": "number_prs_closed_without_merge", "comment": null}, "avg_days_pr_open": {"type": "FLOAT64", "index": 9, "name": "avg_days_pr_open", "comment": null}, "longest_days_pr_open": {"type": "FLOAT64", "index": 10, "name": "longest_days_pr_open", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 9.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 720.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__quarterly_metrics"}, "seed.github_integration_tests.github_issue_closed_history_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_closed_history_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 2, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 4, "name": "actor_id", "comment": null}, "closed": {"type": "BOOL", "index": 5, "name": "closed", "comment": null}, "commit_sha": {"type": "INT64", "index": 6, "name": "commit_sha", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 171.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 5643.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_closed_history_data"}, "model.github_source.stg_github__team_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__team_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "description": {"type": "STRING", "index": 3, "name": "description", "comment": null}, "name": {"type": "STRING", "index": 4, "name": "name", "comment": null}, "org_id": {"type": "INT64", "index": 5, "name": "org_id", "comment": null}, "parent_id": {"type": "INT64", "index": 6, "name": "parent_id", "comment": null}, "privacy": {"type": "STRING", "index": 7, "name": "privacy", "comment": null}, "slug": {"type": "STRING", "index": 8, "name": "slug", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__team_tmp"}, "model.github.github__weekly_metrics": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github__weekly_metrics", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"week": {"type": "TIMESTAMP", "index": 1, "name": "week", "comment": null}, "number_issues_opened": {"type": "INT64", "index": 2, "name": "number_issues_opened", "comment": null}, "number_issues_closed": {"type": "INT64", "index": 3, "name": "number_issues_closed", "comment": null}, "avg_days_issue_open": {"type": "FLOAT64", "index": 4, "name": "avg_days_issue_open", "comment": null}, "longest_days_issue_open": {"type": "FLOAT64", "index": 5, "name": "longest_days_issue_open", "comment": null}, "number_prs_opened": {"type": "INT64", "index": 6, "name": "number_prs_opened", "comment": null}, "number_prs_merged": {"type": "INT64", "index": 7, "name": "number_prs_merged", "comment": null}, "number_prs_closed_without_merge": {"type": "INT64", "index": 8, "name": "number_prs_closed_without_merge", "comment": null}, "avg_days_pr_open": {"type": "FLOAT64", "index": 9, "name": "avg_days_pr_open", "comment": null}, "longest_days_pr_open": {"type": "FLOAT64", "index": 10, "name": "longest_days_pr_open", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 102.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 6672.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__weekly_metrics"}, "model.github_source.stg_github__issue_comment": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__issue_comment", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_comment_id": {"type": "INT64", "index": 1, "name": "issue_comment_id", "comment": null}, "issue_id": {"type": "INT64", "index": 2, "name": "issue_id", "comment": null}, "user_id": {"type": "INT64", "index": 3, "name": "user_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 43.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1032.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_comment"}, "seed.github_integration_tests.github_pull_request_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_pull_request_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "base_label": {"type": "STRING", "index": 3, "name": "base_label", "comment": null}, "base_ref": {"type": "STRING", "index": 4, "name": "base_ref", "comment": null}, "base_repo_id": {"type": "INT64", "index": 5, "name": "base_repo_id", "comment": null}, "base_sha": {"type": "STRING", "index": 6, "name": "base_sha", "comment": null}, "base_user_id": {"type": "INT64", "index": 7, "name": "base_user_id", "comment": null}, "head_label": {"type": "STRING", "index": 8, "name": "head_label", "comment": null}, "head_ref": {"type": "STRING", "index": 9, "name": "head_ref", "comment": null}, "head_repo_id": {"type": "INT64", "index": 10, "name": "head_repo_id", "comment": null}, "head_sha": {"type": "STRING", "index": 11, "name": "head_sha", "comment": null}, "head_user_id": {"type": "INT64", "index": 12, "name": "head_user_id", "comment": null}, "issue_id": {"type": "INT64", "index": 13, "name": "issue_id", "comment": null}, "merge_commit_sha": {"type": "STRING", "index": 14, "name": "merge_commit_sha", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 167.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 56627.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_pull_request_data"}, "model.github_source.stg_github__requested_reviewer_history": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__requested_reviewer_history", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"pull_request_id": {"type": "INT64", "index": 1, "name": "pull_request_id", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 2, "name": "created_at", "comment": null}, "requested_id": {"type": "INT64", "index": 3, "name": "requested_id", "comment": null}, "removed": {"type": "BOOL", "index": 4, "name": "removed", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 41.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1025.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__requested_reviewer_history"}, "seed.github_integration_tests.github_repository_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_repository_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "archived": {"type": "BOOL", "index": 3, "name": "archived", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "default_branch": {"type": "STRING", "index": 5, "name": "default_branch", "comment": null}, "description": {"type": "STRING", "index": 6, "name": "description", "comment": null}, "fork": {"type": "BOOL", "index": 7, "name": "fork", "comment": null}, "full_name": {"type": "STRING", "index": 8, "name": "full_name", "comment": null}, "homepage": {"type": "INT64", "index": 9, "name": "homepage", "comment": null}, "language": {"type": "STRING", "index": 10, "name": "language", "comment": null}, "name": {"type": "STRING", "index": 11, "name": "name", "comment": null}, "owner_id": {"type": "INT64", "index": 12, "name": "owner_id", "comment": null}, "private": {"type": "BOOL", "index": 13, "name": "private", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 24.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 5793.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_repository_data"}, "model.github_source.stg_github__repository": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__repository", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"repository_id": {"type": "INT64", "index": 1, "name": "repository_id", "comment": null}, "full_name": {"type": "STRING", "index": 2, "name": "full_name", "comment": null}, "is_private": {"type": "BOOL", "index": 3, "name": "is_private", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 24.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1800.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__repository"}, "model.github.github__issues": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github__issues", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "body": {"type": "STRING", "index": 2, "name": "body", "comment": null}, "closed_at": {"type": "TIMESTAMP", "index": 3, "name": "closed_at", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "is_locked": {"type": "BOOL", "index": 5, "name": "is_locked", "comment": null}, "milestone_id": {"type": "INT64", "index": 6, "name": "milestone_id", "comment": null}, "issue_number": {"type": "INT64", "index": 7, "name": "issue_number", "comment": null}, "is_pull_request": {"type": "BOOL", "index": 8, "name": "is_pull_request", "comment": null}, "repository_id": {"type": "INT64", "index": 9, "name": "repository_id", "comment": null}, "state": {"type": "STRING", "index": 10, "name": "state", "comment": null}, "title": {"type": "STRING", "index": 11, "name": "title", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 12, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 13, "name": "user_id", "comment": null}, "url_link": {"type": "STRING", "index": 14, "name": "url_link", "comment": null}, "days_issue_open": {"type": "FLOAT64", "index": 15, "name": "days_issue_open", "comment": null}, "number_of_times_reopened": {"type": "INT64", "index": 16, "name": "number_of_times_reopened", "comment": null}, "labels": {"type": "STRING", "index": 17, "name": "labels", "comment": null}, "number_of_comments": {"type": "INT64", "index": 18, "name": "number_of_comments", "comment": null}, "repository": {"type": "STRING", "index": 19, "name": "repository", "comment": null}, "repository_team_names": {"type": "STRING", "index": 20, "name": "repository_team_names", "comment": null}, "assignees": {"type": "STRING", "index": 21, "name": "assignees", "comment": null}, "creator_login_name": {"type": "STRING", "index": 22, "name": "creator_login_name", "comment": null}, "creator_name": {"type": "STRING", "index": 23, "name": "creator_name", "comment": null}, "creator_company": {"type": "STRING", "index": 24, "name": "creator_company", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 30.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 16053.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__issues"}, "model.github_source.stg_github__issue_comment_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__issue_comment_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "created_at": {"type": "DATETIME", "index": 4, "name": "created_at", "comment": null}, "issue_id": {"type": "INT64", "index": 5, "name": "issue_id", "comment": null}, "updated_at": {"type": "DATETIME", "index": 6, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 7, "name": "user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_comment_tmp"}, "model.github_source.stg_github__issue_label": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__issue_label", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "label_id": {"type": "INT64", "index": 2, "name": "label_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 46.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 736.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_label"}, "model.github_source.stg_github__repo_team_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__repo_team_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"repository_id": {"type": "INT64", "index": 1, "name": "repository_id", "comment": null}, "team_id": {"type": "INT64", "index": 2, "name": "team_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "permission": {"type": "STRING", "index": 4, "name": "permission", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__repo_team_tmp"}, "model.github_source.stg_github__user": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__user", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"user_id": {"type": "INT64", "index": 1, "name": "user_id", "comment": null}, "login_name": {"type": "STRING", "index": 2, "name": "login_name", "comment": null}, "name": {"type": "STRING", "index": 3, "name": "name", "comment": null}, "company": {"type": "STRING", "index": 4, "name": "company", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 17.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 3502.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__user"}, "seed.github_integration_tests.github_label_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_label_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "color": {"type": "STRING", "index": 3, "name": "color", "comment": null}, "description": {"type": "STRING", "index": 4, "name": "description", "comment": null}, "is_default": {"type": "BOOL", "index": 5, "name": "is_default", "comment": null}, "name": {"type": "STRING", "index": 6, "name": "name", "comment": null}, "url": {"type": "STRING", "index": 7, "name": "url", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 15.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2016.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_label_data"}, "seed.github_integration_tests.github_team_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_team_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "description": {"type": "STRING", "index": 3, "name": "description", "comment": null}, "name": {"type": "STRING", "index": 4, "name": "name", "comment": null}, "org_id": {"type": "INT64", "index": 5, "name": "org_id", "comment": null}, "parent_id": {"type": "INT64", "index": 6, "name": "parent_id", "comment": null}, "privacy": {"type": "STRING", "index": 7, "name": "privacy", "comment": null}, "slug": {"type": "STRING", "index": 8, "name": "slug", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 19.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2346.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_team_data"}, "model.github_source.stg_github__issue_closed_history": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__issue_closed_history", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 2, "name": "updated_at", "comment": null}, "is_closed": {"type": "BOOL", "index": 3, "name": "is_closed", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 171.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2907.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_closed_history"}, "seed.github_integration_tests.github_issue_merged_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_merged_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"commit_sha": {"type": "STRING", "index": 1, "name": "commit_sha", "comment": null}, "issue_id": {"type": "INT64", "index": 2, "name": "issue_id", "comment": null}, "merged_at": {"type": "TIMESTAMP", "index": 3, "name": "merged_at", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 5, "name": "actor_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 110.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 8140.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_merged_data"}, "seed.github_integration_tests.github_issue_assignee_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_assignee_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "user_id": {"type": "INT64", "index": 2, "name": "user_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 200.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 4800.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_assignee_data"}, "model.github.github__pull_requests": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github__pull_requests", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "body": {"type": "STRING", "index": 2, "name": "body", "comment": null}, "closed_at": {"type": "TIMESTAMP", "index": 3, "name": "closed_at", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "is_locked": {"type": "BOOL", "index": 5, "name": "is_locked", "comment": null}, "milestone_id": {"type": "INT64", "index": 6, "name": "milestone_id", "comment": null}, "issue_number": {"type": "INT64", "index": 7, "name": "issue_number", "comment": null}, "is_pull_request": {"type": "BOOL", "index": 8, "name": "is_pull_request", "comment": null}, "repository_id": {"type": "INT64", "index": 9, "name": "repository_id", "comment": null}, "state": {"type": "STRING", "index": 10, "name": "state", "comment": null}, "title": {"type": "STRING", "index": 11, "name": "title", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 12, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 13, "name": "user_id", "comment": null}, "url_link": {"type": "STRING", "index": 14, "name": "url_link", "comment": null}, "days_issue_open": {"type": "FLOAT64", "index": 15, "name": "days_issue_open", "comment": null}, "number_of_times_reopened": {"type": "INT64", "index": 16, "name": "number_of_times_reopened", "comment": null}, "labels": {"type": "STRING", "index": 17, "name": "labels", "comment": null}, "number_of_comments": {"type": "INT64", "index": 18, "name": "number_of_comments", "comment": null}, "repository": {"type": "STRING", "index": 19, "name": "repository", "comment": null}, "repository_team_names": {"type": "STRING", "index": 20, "name": "repository_team_names", "comment": null}, "assignees": {"type": "STRING", "index": 21, "name": "assignees", "comment": null}, "creator_login_name": {"type": "STRING", "index": 22, "name": "creator_login_name", "comment": null}, "creator_name": {"type": "STRING", "index": 23, "name": "creator_name", "comment": null}, "creator_company": {"type": "STRING", "index": 24, "name": "creator_company", "comment": null}, "hours_request_review_to_first_review": {"type": "FLOAT64", "index": 25, "name": "hours_request_review_to_first_review", "comment": null}, "hours_request_review_to_first_action": {"type": "FLOAT64", "index": 26, "name": "hours_request_review_to_first_action", "comment": null}, "hours_request_review_to_merge": {"type": "FLOAT64", "index": 27, "name": "hours_request_review_to_merge", "comment": null}, "merged_at": {"type": "TIMESTAMP", "index": 28, "name": "merged_at", "comment": null}, "reviewers": {"type": "STRING", "index": 29, "name": "reviewers", "comment": null}, "number_of_reviews": {"type": "INT64", "index": 30, "name": "number_of_reviews", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 167.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 106809.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__pull_requests"}, "model.github.github__daily_metrics": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github__daily_metrics", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"day": {"type": "TIMESTAMP", "index": 1, "name": "day", "comment": null}, "number_issues_opened": {"type": "INT64", "index": 2, "name": "number_issues_opened", "comment": null}, "number_issues_closed": {"type": "INT64", "index": 3, "name": "number_issues_closed", "comment": null}, "sum_days_issue_open": {"type": "FLOAT64", "index": 4, "name": "sum_days_issue_open", "comment": null}, "longest_days_issue_open": {"type": "FLOAT64", "index": 5, "name": "longest_days_issue_open", "comment": null}, "number_prs_opened": {"type": "INT64", "index": 6, "name": "number_prs_opened", "comment": null}, "number_prs_merged": {"type": "INT64", "index": 7, "name": "number_prs_merged", "comment": null}, "number_prs_closed_without_merge": {"type": "INT64", "index": 8, "name": "number_prs_closed_without_merge", "comment": null}, "sum_days_pr_open": {"type": "FLOAT64", "index": 9, "name": "sum_days_pr_open", "comment": null}, "longest_days_pr_open": {"type": "FLOAT64", "index": 10, "name": "longest_days_pr_open", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 305.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 17552.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__daily_metrics"}, "seed.github_integration_tests.github_user_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_user_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "bio": {"type": "STRING", "index": 3, "name": "bio", "comment": null}, "blog": {"type": "STRING", "index": 4, "name": "blog", "comment": null}, "company": {"type": "STRING", "index": 5, "name": "company", "comment": null}, "created_at": {"type": "DATETIME", "index": 6, "name": "created_at", "comment": null}, "hireable": {"type": "BOOL", "index": 7, "name": "hireable", "comment": null}, "location": {"type": "STRING", "index": 8, "name": "location", "comment": null}, "login": {"type": "STRING", "index": 9, "name": "login", "comment": null}, "name": {"type": "STRING", "index": 10, "name": "name", "comment": null}, "site_admin": {"type": "BOOL", "index": 11, "name": "site_admin", "comment": null}, "type": {"type": "STRING", "index": 12, "name": "type", "comment": null}, "updated_at": {"type": "DATETIME", "index": 13, "name": "updated_at", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 17.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 7405.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_user_data"}, "model.github_source.stg_github__issue_assignee": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__issue_assignee", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "user_id": {"type": "INT64", "index": 2, "name": "user_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 200.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 3200.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_assignee"}, "model.github_source.stg_github__requested_reviewer_history_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__requested_reviewer_history_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"created_at": {"type": "TIMESTAMP", "index": 1, "name": "created_at", "comment": null}, "pull_request_id": {"type": "INT64", "index": 2, "name": "pull_request_id", "comment": null}, "requested_id": {"type": "INT64", "index": 3, "name": "requested_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 5, "name": "actor_id", "comment": null}, "removed": {"type": "BOOL", "index": 6, "name": "removed", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__requested_reviewer_history_tmp"}, "model.github_source.stg_github__repo_team": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__repo_team", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"repository_id": {"type": "INT64", "index": 1, "name": "repository_id", "comment": null}, "team_id": {"type": "INT64", "index": 2, "name": "team_id", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 8.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 128.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__repo_team"}, "model.github_source.stg_github__issue_merged": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__issue_merged", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "merged_at": {"type": "TIMESTAMP", "index": 2, "name": "merged_at", "comment": null}}, "stats": {"num_rows": {"id": "num_rows", "label": "# Rows", "value": 110.0, "include": true, "description": "Approximate count of rows in this table"}, "num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1760.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_merged"}}, "sources": {}, "errors": null} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "1.3.0", "generated_at": "2022-11-01T00:40:25.646866Z", "invocation_id": "581c3815-414c-47e3-91e9-f6b3f49621e9", "env": {}}, "nodes": {"model.github.github__quarterly_metrics": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "github__quarterly_metrics", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"quarter": {"type": "TIMESTAMP", "index": 1, "name": "quarter", "comment": null}, "number_issues_opened": {"type": "INT64", "index": 2, "name": "number_issues_opened", "comment": null}, "number_issues_closed": {"type": "INT64", "index": 3, "name": "number_issues_closed", "comment": null}, "avg_days_issue_open": {"type": "FLOAT64", "index": 4, "name": "avg_days_issue_open", "comment": null}, "longest_days_issue_open": {"type": "FLOAT64", "index": 5, "name": "longest_days_issue_open", "comment": null}, "number_prs_opened": {"type": "INT64", "index": 6, "name": "number_prs_opened", "comment": null}, "number_prs_merged": {"type": "INT64", "index": 7, "name": "number_prs_merged", "comment": null}, "number_prs_closed_without_merge": {"type": "INT64", "index": 8, "name": "number_prs_closed_without_merge", "comment": null}, "avg_days_pr_open": {"type": "FLOAT64", "index": 9, "name": "avg_days_pr_open", "comment": null}, "longest_days_pr_open": {"type": "FLOAT64", "index": 10, "name": "longest_days_pr_open", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 720.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 9.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__quarterly_metrics"}, "seed.github_integration_tests.github_requested_reviewer_history_data": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "github_requested_reviewer_history_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"created_at": {"type": "TIMESTAMP", "index": 1, "name": "created_at", "comment": null}, "pull_request_id": {"type": "INT64", "index": 2, "name": "pull_request_id", "comment": null}, "requested_id": {"type": "INT64", "index": 3, "name": "requested_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 5, "name": "actor_id", "comment": null}, "removed": {"type": "BOOL", "index": 6, "name": "removed", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1681.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 41.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_requested_reviewer_history_data"}, "model.github_source.stg_github__repository": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "stg_github__repository", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"repository_id": {"type": "INT64", "index": 1, "name": "repository_id", "comment": null}, "full_name": {"type": "STRING", "index": 2, "name": "full_name", "comment": null}, "is_private": {"type": "BOOL", "index": 3, "name": "is_private", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1800.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 24.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__repository"}, "seed.github_integration_tests.github_pull_request_data": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "github_pull_request_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "base_label": {"type": "STRING", "index": 3, "name": "base_label", "comment": null}, "base_ref": {"type": "STRING", "index": 4, "name": "base_ref", "comment": null}, "base_repo_id": {"type": "INT64", "index": 5, "name": "base_repo_id", "comment": null}, "base_sha": {"type": "STRING", "index": 6, "name": "base_sha", "comment": null}, "base_user_id": {"type": "INT64", "index": 7, "name": "base_user_id", "comment": null}, "head_label": {"type": "STRING", "index": 8, "name": "head_label", "comment": null}, "head_ref": {"type": "STRING", "index": 9, "name": "head_ref", "comment": null}, "head_repo_id": {"type": "INT64", "index": 10, "name": "head_repo_id", "comment": null}, "head_sha": {"type": "STRING", "index": 11, "name": "head_sha", "comment": null}, "head_user_id": {"type": "INT64", "index": 12, "name": "head_user_id", "comment": null}, "issue_id": {"type": "INT64", "index": 13, "name": "issue_id", "comment": null}, "merge_commit_sha": {"type": "STRING", "index": 14, "name": "merge_commit_sha", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 56627.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 167.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_pull_request_data"}, "model.github_source.stg_github__issue_comment_tmp": {"metadata": {"type": "view", "schema": "github_source_integration_tests", "name": "stg_github__issue_comment_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "created_at": {"type": "DATETIME", "index": 4, "name": "created_at", "comment": null}, "issue_id": {"type": "INT64", "index": 5, "name": "issue_id", "comment": null}, "updated_at": {"type": "DATETIME", "index": 6, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 7, "name": "user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_comment_tmp"}, "model.github_source.stg_github__issue_assignee": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "stg_github__issue_assignee", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "user_id": {"type": "INT64", "index": 2, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 3200.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 200.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_assignee"}, "model.github_source.stg_github__repo_team": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "stg_github__repo_team", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"repository_id": {"type": "INT64", "index": 1, "name": "repository_id", "comment": null}, "team_id": {"type": "INT64", "index": 2, "name": "team_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 128.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 8.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__repo_team"}, "seed.github_integration_tests.github_issue_merged_data": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "github_issue_merged_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"commit_sha": {"type": "STRING", "index": 1, "name": "commit_sha", "comment": null}, "issue_id": {"type": "INT64", "index": 2, "name": "issue_id", "comment": null}, "merged_at": {"type": "TIMESTAMP", "index": 3, "name": "merged_at", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 5, "name": "actor_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 8140.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 110.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_merged_data"}, "seed.github_integration_tests.github_repository_data": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "github_repository_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "archived": {"type": "BOOL", "index": 3, "name": "archived", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "default_branch": {"type": "STRING", "index": 5, "name": "default_branch", "comment": null}, "description": {"type": "STRING", "index": 6, "name": "description", "comment": null}, "fork": {"type": "BOOL", "index": 7, "name": "fork", "comment": null}, "full_name": {"type": "STRING", "index": 8, "name": "full_name", "comment": null}, "homepage": {"type": "INT64", "index": 9, "name": "homepage", "comment": null}, "language": {"type": "STRING", "index": 10, "name": "language", "comment": null}, "name": {"type": "STRING", "index": 11, "name": "name", "comment": null}, "owner_id": {"type": "INT64", "index": 12, "name": "owner_id", "comment": null}, "private": {"type": "BOOL", "index": 13, "name": "private", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 5793.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 24.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_repository_data"}, "seed.github_integration_tests.github_pull_request_review_data": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "github_pull_request_review_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "commit_sha": {"type": "STRING", "index": 4, "name": "commit_sha", "comment": null}, "pull_request_id": {"type": "INT64", "index": 5, "name": "pull_request_id", "comment": null}, "state": {"type": "STRING", "index": 6, "name": "state", "comment": null}, "submitted_at": {"type": "TIMESTAMP", "index": 7, "name": "submitted_at", "comment": null}, "user_id": {"type": "INT64", "index": 8, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 18059.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 114.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_pull_request_review_data"}, "model.github_source.stg_github__pull_request": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "stg_github__pull_request", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"pull_request_id": {"type": "INT64", "index": 1, "name": "pull_request_id", "comment": null}, "issue_id": {"type": "INT64", "index": 2, "name": "issue_id", "comment": null}, "head_repo_id": {"type": "INT64", "index": 3, "name": "head_repo_id", "comment": null}, "head_user_id": {"type": "INT64", "index": 4, "name": "head_user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 5320.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 167.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__pull_request"}, "model.github_source.stg_github__issue_merged": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "stg_github__issue_merged", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "merged_at": {"type": "TIMESTAMP", "index": 2, "name": "merged_at", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1760.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 110.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_merged"}, "model.github_source.stg_github__issue": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "stg_github__issue", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "body": {"type": "STRING", "index": 2, "name": "body", "comment": null}, "closed_at": {"type": "TIMESTAMP", "index": 3, "name": "closed_at", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "is_locked": {"type": "BOOL", "index": 5, "name": "is_locked", "comment": null}, "milestone_id": {"type": "INT64", "index": 6, "name": "milestone_id", "comment": null}, "issue_number": {"type": "INT64", "index": 7, "name": "issue_number", "comment": null}, "is_pull_request": {"type": "BOOL", "index": 8, "name": "is_pull_request", "comment": null}, "repository_id": {"type": "INT64", "index": 9, "name": "repository_id", "comment": null}, "state": {"type": "STRING", "index": 10, "name": "state", "comment": null}, "title": {"type": "STRING", "index": 11, "name": "title", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 12, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 13, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 38954.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 197.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue"}, "model.github_source.stg_github__label": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "stg_github__label", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"label_id": {"type": "INT64", "index": 1, "name": "label_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "color": {"type": "STRING", "index": 3, "name": "color", "comment": null}, "description": {"type": "STRING", "index": 4, "name": "description", "comment": null}, "is_default": {"type": "BOOL", "index": 5, "name": "is_default", "comment": null}, "label": {"type": "STRING", "index": 6, "name": "label", "comment": null}, "url": {"type": "STRING", "index": 7, "name": "url", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2016.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 15.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__label"}, "model.github_source.stg_github__repo_team_tmp": {"metadata": {"type": "view", "schema": "github_source_integration_tests", "name": "stg_github__repo_team_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"repository_id": {"type": "INT64", "index": 1, "name": "repository_id", "comment": null}, "team_id": {"type": "INT64", "index": 2, "name": "team_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "permission": {"type": "STRING", "index": 4, "name": "permission", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__repo_team_tmp"}, "model.github.github__issues": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "github__issues", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "body": {"type": "STRING", "index": 2, "name": "body", "comment": null}, "closed_at": {"type": "TIMESTAMP", "index": 3, "name": "closed_at", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "is_locked": {"type": "BOOL", "index": 5, "name": "is_locked", "comment": null}, "milestone_id": {"type": "INT64", "index": 6, "name": "milestone_id", "comment": null}, "issue_number": {"type": "INT64", "index": 7, "name": "issue_number", "comment": null}, "is_pull_request": {"type": "BOOL", "index": 8, "name": "is_pull_request", "comment": null}, "repository_id": {"type": "INT64", "index": 9, "name": "repository_id", "comment": null}, "state": {"type": "STRING", "index": 10, "name": "state", "comment": null}, "title": {"type": "STRING", "index": 11, "name": "title", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 12, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 13, "name": "user_id", "comment": null}, "url_link": {"type": "STRING", "index": 14, "name": "url_link", "comment": null}, "days_issue_open": {"type": "FLOAT64", "index": 15, "name": "days_issue_open", "comment": null}, "number_of_times_reopened": {"type": "INT64", "index": 16, "name": "number_of_times_reopened", "comment": null}, "labels": {"type": "STRING", "index": 17, "name": "labels", "comment": null}, "number_of_comments": {"type": "INT64", "index": 18, "name": "number_of_comments", "comment": null}, "repository": {"type": "STRING", "index": 19, "name": "repository", "comment": null}, "repository_team_names": {"type": "STRING", "index": 20, "name": "repository_team_names", "comment": null}, "assignees": {"type": "STRING", "index": 21, "name": "assignees", "comment": null}, "creator_login_name": {"type": "STRING", "index": 22, "name": "creator_login_name", "comment": null}, "creator_name": {"type": "STRING", "index": 23, "name": "creator_name", "comment": null}, "creator_company": {"type": "STRING", "index": 24, "name": "creator_company", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 16053.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 30.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__issues"}, "model.github_source.stg_github__label_tmp": {"metadata": {"type": "view", "schema": "github_source_integration_tests", "name": "stg_github__label_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "color": {"type": "STRING", "index": 3, "name": "color", "comment": null}, "description": {"type": "STRING", "index": 4, "name": "description", "comment": null}, "is_default": {"type": "BOOL", "index": 5, "name": "is_default", "comment": null}, "name": {"type": "STRING", "index": 6, "name": "name", "comment": null}, "url": {"type": "STRING", "index": 7, "name": "url", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__label_tmp"}, "model.github.github__monthly_metrics": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "github__monthly_metrics", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"month": {"type": "TIMESTAMP", "index": 1, "name": "month", "comment": null}, "number_issues_opened": {"type": "INT64", "index": 2, "name": "number_issues_opened", "comment": null}, "number_issues_closed": {"type": "INT64", "index": 3, "name": "number_issues_closed", "comment": null}, "avg_days_issue_open": {"type": "FLOAT64", "index": 4, "name": "avg_days_issue_open", "comment": null}, "longest_days_issue_open": {"type": "FLOAT64", "index": 5, "name": "longest_days_issue_open", "comment": null}, "number_prs_opened": {"type": "INT64", "index": 6, "name": "number_prs_opened", "comment": null}, "number_prs_merged": {"type": "INT64", "index": 7, "name": "number_prs_merged", "comment": null}, "number_prs_closed_without_merge": {"type": "INT64", "index": 8, "name": "number_prs_closed_without_merge", "comment": null}, "avg_days_pr_open": {"type": "FLOAT64", "index": 9, "name": "avg_days_pr_open", "comment": null}, "longest_days_pr_open": {"type": "FLOAT64", "index": 10, "name": "longest_days_pr_open", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1888.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 25.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__monthly_metrics"}, "model.github_source.stg_github__repository_tmp": {"metadata": {"type": "view", "schema": "github_source_integration_tests", "name": "stg_github__repository_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "archived": {"type": "BOOL", "index": 3, "name": "archived", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "default_branch": {"type": "STRING", "index": 5, "name": "default_branch", "comment": null}, "description": {"type": "STRING", "index": 6, "name": "description", "comment": null}, "fork": {"type": "BOOL", "index": 7, "name": "fork", "comment": null}, "full_name": {"type": "STRING", "index": 8, "name": "full_name", "comment": null}, "homepage": {"type": "INT64", "index": 9, "name": "homepage", "comment": null}, "language": {"type": "STRING", "index": 10, "name": "language", "comment": null}, "name": {"type": "STRING", "index": 11, "name": "name", "comment": null}, "owner_id": {"type": "INT64", "index": 12, "name": "owner_id", "comment": null}, "private": {"type": "BOOL", "index": 13, "name": "private", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__repository_tmp"}, "model.github_source.stg_github__issue_label_tmp": {"metadata": {"type": "view", "schema": "github_source_integration_tests", "name": "stg_github__issue_label_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "label_id": {"type": "INT64", "index": 2, "name": "label_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_label_tmp"}, "model.github_source.stg_github__requested_reviewer_history": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "stg_github__requested_reviewer_history", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"pull_request_id": {"type": "INT64", "index": 1, "name": "pull_request_id", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 2, "name": "created_at", "comment": null}, "requested_id": {"type": "INT64", "index": 3, "name": "requested_id", "comment": null}, "removed": {"type": "BOOL", "index": 4, "name": "removed", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1025.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 41.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__requested_reviewer_history"}, "seed.github_integration_tests.github_label_data": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "github_label_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "color": {"type": "STRING", "index": 3, "name": "color", "comment": null}, "description": {"type": "STRING", "index": 4, "name": "description", "comment": null}, "is_default": {"type": "BOOL", "index": 5, "name": "is_default", "comment": null}, "name": {"type": "STRING", "index": 6, "name": "name", "comment": null}, "url": {"type": "STRING", "index": 7, "name": "url", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2016.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 15.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_label_data"}, "seed.github_integration_tests.github_issue_closed_history_data": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "github_issue_closed_history_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 2, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 4, "name": "actor_id", "comment": null}, "closed": {"type": "BOOL", "index": 5, "name": "closed", "comment": null}, "commit_sha": {"type": "INT64", "index": 6, "name": "commit_sha", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 5643.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 171.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_closed_history_data"}, "model.github_source.stg_github__team_tmp": {"metadata": {"type": "view", "schema": "github_source_integration_tests", "name": "stg_github__team_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "description": {"type": "STRING", "index": 3, "name": "description", "comment": null}, "name": {"type": "STRING", "index": 4, "name": "name", "comment": null}, "org_id": {"type": "INT64", "index": 5, "name": "org_id", "comment": null}, "parent_id": {"type": "INT64", "index": 6, "name": "parent_id", "comment": null}, "privacy": {"type": "STRING", "index": 7, "name": "privacy", "comment": null}, "slug": {"type": "STRING", "index": 8, "name": "slug", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__team_tmp"}, "model.github.github__daily_metrics": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "github__daily_metrics", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"day": {"type": "TIMESTAMP", "index": 1, "name": "day", "comment": null}, "number_issues_opened": {"type": "INT64", "index": 2, "name": "number_issues_opened", "comment": null}, "number_issues_closed": {"type": "INT64", "index": 3, "name": "number_issues_closed", "comment": null}, "sum_days_issue_open": {"type": "FLOAT64", "index": 4, "name": "sum_days_issue_open", "comment": null}, "longest_days_issue_open": {"type": "FLOAT64", "index": 5, "name": "longest_days_issue_open", "comment": null}, "number_prs_opened": {"type": "INT64", "index": 6, "name": "number_prs_opened", "comment": null}, "number_prs_merged": {"type": "INT64", "index": 7, "name": "number_prs_merged", "comment": null}, "number_prs_closed_without_merge": {"type": "INT64", "index": 8, "name": "number_prs_closed_without_merge", "comment": null}, "sum_days_pr_open": {"type": "FLOAT64", "index": 9, "name": "sum_days_pr_open", "comment": null}, "longest_days_pr_open": {"type": "FLOAT64", "index": 10, "name": "longest_days_pr_open", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 17552.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 305.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__daily_metrics"}, "model.github_source.stg_github__pull_request_review_tmp": {"metadata": {"type": "view", "schema": "github_source_integration_tests", "name": "stg_github__pull_request_review_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "commit_sha": {"type": "STRING", "index": 4, "name": "commit_sha", "comment": null}, "pull_request_id": {"type": "INT64", "index": 5, "name": "pull_request_id", "comment": null}, "state": {"type": "STRING", "index": 6, "name": "state", "comment": null}, "submitted_at": {"type": "TIMESTAMP", "index": 7, "name": "submitted_at", "comment": null}, "user_id": {"type": "INT64", "index": 8, "name": "user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__pull_request_review_tmp"}, "seed.github_integration_tests.github_issue_label_data": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "github_issue_label_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "label_id": {"type": "INT64", "index": 2, "name": "label_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1104.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 46.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_label_data"}, "model.github_source.stg_github__pull_request_tmp": {"metadata": {"type": "view", "schema": "github_source_integration_tests", "name": "stg_github__pull_request_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "base_label": {"type": "STRING", "index": 3, "name": "base_label", "comment": null}, "base_ref": {"type": "STRING", "index": 4, "name": "base_ref", "comment": null}, "base_repo_id": {"type": "INT64", "index": 5, "name": "base_repo_id", "comment": null}, "base_sha": {"type": "STRING", "index": 6, "name": "base_sha", "comment": null}, "base_user_id": {"type": "INT64", "index": 7, "name": "base_user_id", "comment": null}, "head_label": {"type": "STRING", "index": 8, "name": "head_label", "comment": null}, "head_ref": {"type": "STRING", "index": 9, "name": "head_ref", "comment": null}, "head_repo_id": {"type": "INT64", "index": 10, "name": "head_repo_id", "comment": null}, "head_sha": {"type": "STRING", "index": 11, "name": "head_sha", "comment": null}, "head_user_id": {"type": "INT64", "index": 12, "name": "head_user_id", "comment": null}, "issue_id": {"type": "INT64", "index": 13, "name": "issue_id", "comment": null}, "merge_commit_sha": {"type": "STRING", "index": 14, "name": "merge_commit_sha", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__pull_request_tmp"}, "model.github.github__pull_requests": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "github__pull_requests", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "body": {"type": "STRING", "index": 2, "name": "body", "comment": null}, "closed_at": {"type": "TIMESTAMP", "index": 3, "name": "closed_at", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "is_locked": {"type": "BOOL", "index": 5, "name": "is_locked", "comment": null}, "milestone_id": {"type": "INT64", "index": 6, "name": "milestone_id", "comment": null}, "issue_number": {"type": "INT64", "index": 7, "name": "issue_number", "comment": null}, "is_pull_request": {"type": "BOOL", "index": 8, "name": "is_pull_request", "comment": null}, "repository_id": {"type": "INT64", "index": 9, "name": "repository_id", "comment": null}, "state": {"type": "STRING", "index": 10, "name": "state", "comment": null}, "title": {"type": "STRING", "index": 11, "name": "title", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 12, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 13, "name": "user_id", "comment": null}, "url_link": {"type": "STRING", "index": 14, "name": "url_link", "comment": null}, "days_issue_open": {"type": "FLOAT64", "index": 15, "name": "days_issue_open", "comment": null}, "number_of_times_reopened": {"type": "INT64", "index": 16, "name": "number_of_times_reopened", "comment": null}, "labels": {"type": "STRING", "index": 17, "name": "labels", "comment": null}, "number_of_comments": {"type": "INT64", "index": 18, "name": "number_of_comments", "comment": null}, "repository": {"type": "STRING", "index": 19, "name": "repository", "comment": null}, "repository_team_names": {"type": "STRING", "index": 20, "name": "repository_team_names", "comment": null}, "assignees": {"type": "STRING", "index": 21, "name": "assignees", "comment": null}, "creator_login_name": {"type": "STRING", "index": 22, "name": "creator_login_name", "comment": null}, "creator_name": {"type": "STRING", "index": 23, "name": "creator_name", "comment": null}, "creator_company": {"type": "STRING", "index": 24, "name": "creator_company", "comment": null}, "hours_request_review_to_first_review": {"type": "FLOAT64", "index": 25, "name": "hours_request_review_to_first_review", "comment": null}, "hours_request_review_to_first_action": {"type": "FLOAT64", "index": 26, "name": "hours_request_review_to_first_action", "comment": null}, "hours_request_review_to_merge": {"type": "FLOAT64", "index": 27, "name": "hours_request_review_to_merge", "comment": null}, "merged_at": {"type": "TIMESTAMP", "index": 28, "name": "merged_at", "comment": null}, "reviewers": {"type": "STRING", "index": 29, "name": "reviewers", "comment": null}, "number_of_reviews": {"type": "INT64", "index": 30, "name": "number_of_reviews", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 106809.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 167.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__pull_requests"}, "model.github_source.stg_github__issue_label": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "stg_github__issue_label", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "label_id": {"type": "INT64", "index": 2, "name": "label_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 736.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 46.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_label"}, "seed.github_integration_tests.github_issue_comment_data": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "github_issue_comment_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "created_at": {"type": "DATETIME", "index": 4, "name": "created_at", "comment": null}, "issue_id": {"type": "INT64", "index": 5, "name": "issue_id", "comment": null}, "updated_at": {"type": "DATETIME", "index": 6, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 7, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 4902.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 43.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_comment_data"}, "model.github_source.stg_github__issue_merged_tmp": {"metadata": {"type": "view", "schema": "github_source_integration_tests", "name": "stg_github__issue_merged_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"commit_sha": {"type": "STRING", "index": 1, "name": "commit_sha", "comment": null}, "issue_id": {"type": "INT64", "index": 2, "name": "issue_id", "comment": null}, "merged_at": {"type": "TIMESTAMP", "index": 3, "name": "merged_at", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 5, "name": "actor_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_merged_tmp"}, "seed.github_integration_tests.github_issue_assignee_data": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "github_issue_assignee_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "user_id": {"type": "INT64", "index": 2, "name": "user_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 4800.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 200.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_assignee_data"}, "seed.github_integration_tests.github_issue_data": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "github_issue_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "closed_at": {"type": "TIMESTAMP", "index": 4, "name": "closed_at", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 5, "name": "created_at", "comment": null}, "locked": {"type": "BOOL", "index": 6, "name": "locked", "comment": null}, "milestone_id": {"type": "INT64", "index": 7, "name": "milestone_id", "comment": null}, "number": {"type": "INT64", "index": 8, "name": "number", "comment": null}, "pull_request": {"type": "BOOL", "index": 9, "name": "pull_request", "comment": null}, "repository_id": {"type": "INT64", "index": 10, "name": "repository_id", "comment": null}, "state": {"type": "STRING", "index": 11, "name": "state", "comment": null}, "title": {"type": "STRING", "index": 12, "name": "title", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 13, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 14, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 40530.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 197.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_data"}, "model.github.github__weekly_metrics": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "github__weekly_metrics", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"week": {"type": "TIMESTAMP", "index": 1, "name": "week", "comment": null}, "number_issues_opened": {"type": "INT64", "index": 2, "name": "number_issues_opened", "comment": null}, "number_issues_closed": {"type": "INT64", "index": 3, "name": "number_issues_closed", "comment": null}, "avg_days_issue_open": {"type": "FLOAT64", "index": 4, "name": "avg_days_issue_open", "comment": null}, "longest_days_issue_open": {"type": "FLOAT64", "index": 5, "name": "longest_days_issue_open", "comment": null}, "number_prs_opened": {"type": "INT64", "index": 6, "name": "number_prs_opened", "comment": null}, "number_prs_merged": {"type": "INT64", "index": 7, "name": "number_prs_merged", "comment": null}, "number_prs_closed_without_merge": {"type": "INT64", "index": 8, "name": "number_prs_closed_without_merge", "comment": null}, "avg_days_pr_open": {"type": "FLOAT64", "index": 9, "name": "avg_days_pr_open", "comment": null}, "longest_days_pr_open": {"type": "FLOAT64", "index": 10, "name": "longest_days_pr_open", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 6672.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 102.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__weekly_metrics"}, "model.github_source.stg_github__issue_closed_history_tmp": {"metadata": {"type": "view", "schema": "github_source_integration_tests", "name": "stg_github__issue_closed_history_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 2, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 4, "name": "actor_id", "comment": null}, "closed": {"type": "BOOL", "index": 5, "name": "closed", "comment": null}, "commit_sha": {"type": "INT64", "index": 6, "name": "commit_sha", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_closed_history_tmp"}, "seed.github_integration_tests.github_user_data": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "github_user_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "bio": {"type": "STRING", "index": 3, "name": "bio", "comment": null}, "blog": {"type": "STRING", "index": 4, "name": "blog", "comment": null}, "company": {"type": "STRING", "index": 5, "name": "company", "comment": null}, "created_at": {"type": "DATETIME", "index": 6, "name": "created_at", "comment": null}, "hireable": {"type": "BOOL", "index": 7, "name": "hireable", "comment": null}, "location": {"type": "STRING", "index": 8, "name": "location", "comment": null}, "login": {"type": "STRING", "index": 9, "name": "login", "comment": null}, "name": {"type": "STRING", "index": 10, "name": "name", "comment": null}, "site_admin": {"type": "BOOL", "index": 11, "name": "site_admin", "comment": null}, "type": {"type": "STRING", "index": 12, "name": "type", "comment": null}, "updated_at": {"type": "DATETIME", "index": 13, "name": "updated_at", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 7405.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 17.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_user_data"}, "model.github_source.stg_github__pull_request_review": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "stg_github__pull_request_review", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"pull_request_review_id": {"type": "INT64", "index": 1, "name": "pull_request_review_id", "comment": null}, "pull_request_id": {"type": "INT64", "index": 2, "name": "pull_request_id", "comment": null}, "submitted_at": {"type": "TIMESTAMP", "index": 3, "name": "submitted_at", "comment": null}, "state": {"type": "STRING", "index": 4, "name": "state", "comment": null}, "user_id": {"type": "INT64", "index": 5, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 4835.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 114.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__pull_request_review"}, "model.github_source.stg_github__issue_comment": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "stg_github__issue_comment", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_comment_id": {"type": "INT64", "index": 1, "name": "issue_comment_id", "comment": null}, "issue_id": {"type": "INT64", "index": 2, "name": "issue_id", "comment": null}, "user_id": {"type": "INT64", "index": 3, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1032.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 43.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_comment"}, "seed.github_integration_tests.github_team_data": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "github_team_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "description": {"type": "STRING", "index": 3, "name": "description", "comment": null}, "name": {"type": "STRING", "index": 4, "name": "name", "comment": null}, "org_id": {"type": "INT64", "index": 5, "name": "org_id", "comment": null}, "parent_id": {"type": "INT64", "index": 6, "name": "parent_id", "comment": null}, "privacy": {"type": "STRING", "index": 7, "name": "privacy", "comment": null}, "slug": {"type": "STRING", "index": 8, "name": "slug", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2346.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 19.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_team_data"}, "model.github_source.stg_github__team": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "stg_github__team", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"team_id": {"type": "INT64", "index": 1, "name": "team_id", "comment": null}, "description": {"type": "STRING", "index": 2, "name": "description", "comment": null}, "name": {"type": "STRING", "index": 3, "name": "name", "comment": null}, "parent_id": {"type": "INT64", "index": 4, "name": "parent_id", "comment": null}, "privacy": {"type": "STRING", "index": 5, "name": "privacy", "comment": null}, "slug": {"type": "STRING", "index": 6, "name": "slug", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2042.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 19.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__team"}, "model.github_source.stg_github__user": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "stg_github__user", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"user_id": {"type": "INT64", "index": 1, "name": "user_id", "comment": null}, "login_name": {"type": "STRING", "index": 2, "name": "login_name", "comment": null}, "name": {"type": "STRING", "index": 3, "name": "name", "comment": null}, "company": {"type": "STRING", "index": 4, "name": "company", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 3502.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 17.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__user"}, "model.github_source.stg_github__user_tmp": {"metadata": {"type": "view", "schema": "github_source_integration_tests", "name": "stg_github__user_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "bio": {"type": "STRING", "index": 3, "name": "bio", "comment": null}, "blog": {"type": "STRING", "index": 4, "name": "blog", "comment": null}, "company": {"type": "STRING", "index": 5, "name": "company", "comment": null}, "created_at": {"type": "DATETIME", "index": 6, "name": "created_at", "comment": null}, "hireable": {"type": "BOOL", "index": 7, "name": "hireable", "comment": null}, "location": {"type": "STRING", "index": 8, "name": "location", "comment": null}, "login": {"type": "STRING", "index": 9, "name": "login", "comment": null}, "name": {"type": "STRING", "index": 10, "name": "name", "comment": null}, "site_admin": {"type": "BOOL", "index": 11, "name": "site_admin", "comment": null}, "type": {"type": "STRING", "index": 12, "name": "type", "comment": null}, "updated_at": {"type": "DATETIME", "index": 13, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__user_tmp"}, "seed.github_integration_tests.github_repo_team_data": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "github_repo_team_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"repository_id": {"type": "INT64", "index": 1, "name": "repository_id", "comment": null}, "team_id": {"type": "INT64", "index": 2, "name": "team_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "permission": {"type": "STRING", "index": 4, "name": "permission", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 464.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 8.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_repo_team_data"}, "model.github_source.stg_github__requested_reviewer_history_tmp": {"metadata": {"type": "view", "schema": "github_source_integration_tests", "name": "stg_github__requested_reviewer_history_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"created_at": {"type": "TIMESTAMP", "index": 1, "name": "created_at", "comment": null}, "pull_request_id": {"type": "INT64", "index": 2, "name": "pull_request_id", "comment": null}, "requested_id": {"type": "INT64", "index": 3, "name": "requested_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 5, "name": "actor_id", "comment": null}, "removed": {"type": "BOOL", "index": 6, "name": "removed", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__requested_reviewer_history_tmp"}, "model.github_source.stg_github__issue_tmp": {"metadata": {"type": "view", "schema": "github_source_integration_tests", "name": "stg_github__issue_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "closed_at": {"type": "TIMESTAMP", "index": 4, "name": "closed_at", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 5, "name": "created_at", "comment": null}, "locked": {"type": "BOOL", "index": 6, "name": "locked", "comment": null}, "milestone_id": {"type": "INT64", "index": 7, "name": "milestone_id", "comment": null}, "number": {"type": "INT64", "index": 8, "name": "number", "comment": null}, "pull_request": {"type": "BOOL", "index": 9, "name": "pull_request", "comment": null}, "repository_id": {"type": "INT64", "index": 10, "name": "repository_id", "comment": null}, "state": {"type": "STRING", "index": 11, "name": "state", "comment": null}, "title": {"type": "STRING", "index": 12, "name": "title", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 13, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 14, "name": "user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_tmp"}, "model.github_source.stg_github__issue_assignee_tmp": {"metadata": {"type": "view", "schema": "github_source_integration_tests", "name": "stg_github__issue_assignee_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "user_id": {"type": "INT64", "index": 2, "name": "user_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_assignee_tmp"}, "model.github_source.stg_github__issue_closed_history": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "stg_github__issue_closed_history", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 2, "name": "updated_at", "comment": null}, "is_closed": {"type": "BOOL", "index": 3, "name": "is_closed", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2907.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 171.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_closed_history"}}, "sources": {"source.github_source.github.issue": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "closed_at": {"type": "TIMESTAMP", "index": 4, "name": "closed_at", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 5, "name": "created_at", "comment": null}, "locked": {"type": "BOOL", "index": 6, "name": "locked", "comment": null}, "milestone_id": {"type": "INT64", "index": 7, "name": "milestone_id", "comment": null}, "number": {"type": "INT64", "index": 8, "name": "number", "comment": null}, "pull_request": {"type": "BOOL", "index": 9, "name": "pull_request", "comment": null}, "repository_id": {"type": "INT64", "index": 10, "name": "repository_id", "comment": null}, "state": {"type": "STRING", "index": 11, "name": "state", "comment": null}, "title": {"type": "STRING", "index": 12, "name": "title", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 13, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 14, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 40530.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 197.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.issue"}, "source.github_source.github.user": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_user_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "bio": {"type": "STRING", "index": 3, "name": "bio", "comment": null}, "blog": {"type": "STRING", "index": 4, "name": "blog", "comment": null}, "company": {"type": "STRING", "index": 5, "name": "company", "comment": null}, "created_at": {"type": "DATETIME", "index": 6, "name": "created_at", "comment": null}, "hireable": {"type": "BOOL", "index": 7, "name": "hireable", "comment": null}, "location": {"type": "STRING", "index": 8, "name": "location", "comment": null}, "login": {"type": "STRING", "index": 9, "name": "login", "comment": null}, "name": {"type": "STRING", "index": 10, "name": "name", "comment": null}, "site_admin": {"type": "BOOL", "index": 11, "name": "site_admin", "comment": null}, "type": {"type": "STRING", "index": 12, "name": "type", "comment": null}, "updated_at": {"type": "DATETIME", "index": 13, "name": "updated_at", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 7405.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 17.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.user"}, "source.github_source.github.repository": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_repository_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "archived": {"type": "BOOL", "index": 3, "name": "archived", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "default_branch": {"type": "STRING", "index": 5, "name": "default_branch", "comment": null}, "description": {"type": "STRING", "index": 6, "name": "description", "comment": null}, "fork": {"type": "BOOL", "index": 7, "name": "fork", "comment": null}, "full_name": {"type": "STRING", "index": 8, "name": "full_name", "comment": null}, "homepage": {"type": "INT64", "index": 9, "name": "homepage", "comment": null}, "language": {"type": "STRING", "index": 10, "name": "language", "comment": null}, "name": {"type": "STRING", "index": 11, "name": "name", "comment": null}, "owner_id": {"type": "INT64", "index": 12, "name": "owner_id", "comment": null}, "private": {"type": "BOOL", "index": 13, "name": "private", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 5793.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 24.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.repository"}, "source.github_source.github.requested_reviewer_history": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_requested_reviewer_history_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"created_at": {"type": "TIMESTAMP", "index": 1, "name": "created_at", "comment": null}, "pull_request_id": {"type": "INT64", "index": 2, "name": "pull_request_id", "comment": null}, "requested_id": {"type": "INT64", "index": 3, "name": "requested_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 5, "name": "actor_id", "comment": null}, "removed": {"type": "BOOL", "index": 6, "name": "removed", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1681.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 41.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.requested_reviewer_history"}, "source.github_source.github.issue_comment": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_comment_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "created_at": {"type": "DATETIME", "index": 4, "name": "created_at", "comment": null}, "issue_id": {"type": "INT64", "index": 5, "name": "issue_id", "comment": null}, "updated_at": {"type": "DATETIME", "index": 6, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 7, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 4902.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 43.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.issue_comment"}, "source.github_source.github.issue_closed_history": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_closed_history_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 2, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 4, "name": "actor_id", "comment": null}, "closed": {"type": "BOOL", "index": 5, "name": "closed", "comment": null}, "commit_sha": {"type": "INT64", "index": 6, "name": "commit_sha", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 5643.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 171.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.issue_closed_history"}, "source.github_source.github.pull_request": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_pull_request_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "base_label": {"type": "STRING", "index": 3, "name": "base_label", "comment": null}, "base_ref": {"type": "STRING", "index": 4, "name": "base_ref", "comment": null}, "base_repo_id": {"type": "INT64", "index": 5, "name": "base_repo_id", "comment": null}, "base_sha": {"type": "STRING", "index": 6, "name": "base_sha", "comment": null}, "base_user_id": {"type": "INT64", "index": 7, "name": "base_user_id", "comment": null}, "head_label": {"type": "STRING", "index": 8, "name": "head_label", "comment": null}, "head_ref": {"type": "STRING", "index": 9, "name": "head_ref", "comment": null}, "head_repo_id": {"type": "INT64", "index": 10, "name": "head_repo_id", "comment": null}, "head_sha": {"type": "STRING", "index": 11, "name": "head_sha", "comment": null}, "head_user_id": {"type": "INT64", "index": 12, "name": "head_user_id", "comment": null}, "issue_id": {"type": "INT64", "index": 13, "name": "issue_id", "comment": null}, "merge_commit_sha": {"type": "STRING", "index": 14, "name": "merge_commit_sha", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 56627.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 167.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.pull_request"}, "source.github_source.github.issue_label": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_label_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "label_id": {"type": "INT64", "index": 2, "name": "label_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1104.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 46.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.issue_label"}, "source.github_source.github.pull_request_review": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_pull_request_review_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "commit_sha": {"type": "STRING", "index": 4, "name": "commit_sha", "comment": null}, "pull_request_id": {"type": "INT64", "index": 5, "name": "pull_request_id", "comment": null}, "state": {"type": "STRING", "index": 6, "name": "state", "comment": null}, "submitted_at": {"type": "TIMESTAMP", "index": 7, "name": "submitted_at", "comment": null}, "user_id": {"type": "INT64", "index": 8, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 18059.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 114.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.pull_request_review"}, "source.github_source.github.issue_merged": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_merged_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"commit_sha": {"type": "STRING", "index": 1, "name": "commit_sha", "comment": null}, "issue_id": {"type": "INT64", "index": 2, "name": "issue_id", "comment": null}, "merged_at": {"type": "TIMESTAMP", "index": 3, "name": "merged_at", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 5, "name": "actor_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 8140.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 110.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.issue_merged"}, "source.github_source.github.label": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_label_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "color": {"type": "STRING", "index": 3, "name": "color", "comment": null}, "description": {"type": "STRING", "index": 4, "name": "description", "comment": null}, "is_default": {"type": "BOOL", "index": 5, "name": "is_default", "comment": null}, "name": {"type": "STRING", "index": 6, "name": "name", "comment": null}, "url": {"type": "STRING", "index": 7, "name": "url", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2016.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 15.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.label"}, "source.github_source.github.team": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_team_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "description": {"type": "STRING", "index": 3, "name": "description", "comment": null}, "name": {"type": "STRING", "index": 4, "name": "name", "comment": null}, "org_id": {"type": "INT64", "index": 5, "name": "org_id", "comment": null}, "parent_id": {"type": "INT64", "index": 6, "name": "parent_id", "comment": null}, "privacy": {"type": "STRING", "index": 7, "name": "privacy", "comment": null}, "slug": {"type": "STRING", "index": 8, "name": "slug", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2346.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 19.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.team"}, "source.github_source.github.issue_assignee": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_assignee_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "user_id": {"type": "INT64", "index": 2, "name": "user_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 4800.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 200.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.issue_assignee"}, "source.github_source.github.repo_team": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_repo_team_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"repository_id": {"type": "INT64", "index": 1, "name": "repository_id", "comment": null}, "team_id": {"type": "INT64", "index": 2, "name": "team_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "permission": {"type": "STRING", "index": 4, "name": "permission", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 464.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 8.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.repo_team"}}, "errors": null} \ No newline at end of file diff --git a/docs/manifest.json b/docs/manifest.json index 082f062..ce7583e 100644 --- a/docs/manifest.json +++ b/docs/manifest.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v7.json", "dbt_version": "1.3.0", "generated_at": "2022-10-26T19:31:43.194980Z", "invocation_id": "56400515-88f7-4836-88ef-853ef5bcc0a5", "env": {}, "project_id": "b4ed7eda1f97e936d48d60e52edb4717", "user_id": "8268eefe-e8f7-472e-ab2a-a92f0135d76d", "send_anonymous_usage_stats": true, "adapter_type": "bigquery"}, "nodes": {"seed.github_integration_tests.github_pull_request_review_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "INT64", "submitted_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_pull_request_review_data"], "unique_id": "seed.github_integration_tests.github_pull_request_review_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_pull_request_review_data.csv", "original_file_path": "seeds/github_pull_request_review_data.csv", "name": "github_pull_request_review_data", "alias": "github_pull_request_review_data", "checksum": {"name": "sha256", "checksum": "4bdebf989d5e5d1bf41df343300be0a7e2a12f74b8148de6a97e75118edf0efa"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "submitted_at": "timestamp"}}, "created_at": 1666812439.189562, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_pull_request_review_data`"}, "seed.github_integration_tests.github_label_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "INT64"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_label_data"], "unique_id": "seed.github_integration_tests.github_label_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_label_data.csv", "original_file_path": "seeds/github_label_data.csv", "name": "github_label_data", "alias": "github_label_data", "checksum": {"name": "sha256", "checksum": "f47357ad7761ae8e671c889ce5e385f6916b78cb669dfc65f09bacea1ecafb1f"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "created_at": 1666812439.195436, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_label_data`"}, "seed.github_integration_tests.github_repository_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "created_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_repository_data"], "unique_id": "seed.github_integration_tests.github_repository_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_repository_data.csv", "original_file_path": "seeds/github_repository_data.csv", "name": "github_repository_data", "alias": "github_repository_data", "checksum": {"name": "sha256", "checksum": "78cd55c70468340db27d24a3fc299fc8c191129ca26ea80620a0d796a608a1a4"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"created_at": "timestamp"}}, "created_at": 1666812439.196762, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_repository_data`"}, "seed.github_integration_tests.github_issue_merged_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "merged_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_issue_merged_data"], "unique_id": "seed.github_integration_tests.github_issue_merged_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_issue_merged_data.csv", "original_file_path": "seeds/github_issue_merged_data.csv", "name": "github_issue_merged_data", "alias": "github_issue_merged_data", "checksum": {"name": "sha256", "checksum": "397efa928dca45bafbdc11219b3335265bd9a6cce1447c02e07c0bf53ddaba31"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"merged_at": "timestamp"}}, "created_at": 1666812439.197939, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_merged_data`"}, "seed.github_integration_tests.github_issue_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "closed_at": "timestamp", "created_at": "timestamp", "updated_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_issue_data"], "unique_id": "seed.github_integration_tests.github_issue_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_issue_data.csv", "original_file_path": "seeds/github_issue_data.csv", "name": "github_issue_data", "alias": "github_issue_data", "checksum": {"name": "sha256", "checksum": "6eabcc9bc0920d64775f8058446b279e803384a2205f18a07d7a2f1ebcf89286"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"closed_at": "timestamp", "created_at": "timestamp", "updated_at": "timestamp"}}, "created_at": 1666812439.199287, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_data`"}, "seed.github_integration_tests.github_repo_team_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_repo_team_data"], "unique_id": "seed.github_integration_tests.github_repo_team_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_repo_team_data.csv", "original_file_path": "seeds/github_repo_team_data.csv", "name": "github_repo_team_data", "alias": "github_repo_team_data", "checksum": {"name": "sha256", "checksum": "3a16bf772f5f15231f0d7e26c116041543fad5a9dbdabbdfec30ddd063058722"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1666812439.2006059, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_repo_team_data`"}, "seed.github_integration_tests.github_requested_reviewer_history_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "created_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_requested_reviewer_history_data"], "unique_id": "seed.github_integration_tests.github_requested_reviewer_history_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_requested_reviewer_history_data.csv", "original_file_path": "seeds/github_requested_reviewer_history_data.csv", "name": "github_requested_reviewer_history_data", "alias": "github_requested_reviewer_history_data", "checksum": {"name": "sha256", "checksum": "91225ac95874fc314f772530dfcb6ece74f35c292ea5bba53ff86b599b902743"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"created_at": "timestamp"}}, "created_at": 1666812439.201875, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_requested_reviewer_history_data`"}, "seed.github_integration_tests.github_issue_label_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "issue_id": "INT64", "label_id": "INT64"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_issue_label_data"], "unique_id": "seed.github_integration_tests.github_issue_label_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_issue_label_data.csv", "original_file_path": "seeds/github_issue_label_data.csv", "name": "github_issue_label_data", "alias": "github_issue_label_data", "checksum": {"name": "sha256", "checksum": "847ef3245b5610a81f3d8e91b4787d24829b2b0d3d064c529a61d430e90f0585"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"issue_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "label_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "created_at": 1666812439.203082, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_label_data`"}, "seed.github_integration_tests.github_issue_comment_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "INT64"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_issue_comment_data"], "unique_id": "seed.github_integration_tests.github_issue_comment_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_issue_comment_data.csv", "original_file_path": "seeds/github_issue_comment_data.csv", "name": "github_issue_comment_data", "alias": "github_issue_comment_data", "checksum": {"name": "sha256", "checksum": "6cc173c061308bc4de703c7c5d0fc30228b2c86117ed7db1daf9decf1a4238cd"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "created_at": 1666812439.204253, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_comment_data`"}, "seed.github_integration_tests.github_issue_assignee_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_issue_assignee_data"], "unique_id": "seed.github_integration_tests.github_issue_assignee_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_issue_assignee_data.csv", "original_file_path": "seeds/github_issue_assignee_data.csv", "name": "github_issue_assignee_data", "alias": "github_issue_assignee_data", "checksum": {"name": "sha256", "checksum": "fe25fadc4593349b873b50da5e2e2fbf436cbb3c1bcfe325c3340c64a7d8972b"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1666812439.205397, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_assignee_data`"}, "seed.github_integration_tests.github_issue_closed_history_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "updated_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_issue_closed_history_data"], "unique_id": "seed.github_integration_tests.github_issue_closed_history_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_issue_closed_history_data.csv", "original_file_path": "seeds/github_issue_closed_history_data.csv", "name": "github_issue_closed_history_data", "alias": "github_issue_closed_history_data", "checksum": {"name": "sha256", "checksum": "5f281ce9e29e69280633dc6aae2e9f8028c86815442821a608bb793c82aab3f1"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"updated_at": "timestamp"}}, "created_at": 1666812439.206629, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_closed_history_data`"}, "seed.github_integration_tests.github_pull_request_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_pull_request_data"], "unique_id": "seed.github_integration_tests.github_pull_request_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_pull_request_data.csv", "original_file_path": "seeds/github_pull_request_data.csv", "name": "github_pull_request_data", "alias": "github_pull_request_data", "checksum": {"name": "sha256", "checksum": "1e27d3e9b6881a3fda6402b048071032411d81612ff4b2009d852a194b137006"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1666812439.207768, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_pull_request_data`"}, "seed.github_integration_tests.github_team_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_team_data"], "unique_id": "seed.github_integration_tests.github_team_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_team_data.csv", "original_file_path": "seeds/github_team_data.csv", "name": "github_team_data", "alias": "github_team_data", "checksum": {"name": "sha256", "checksum": "a3916608387192c2bcec219067bd19e3280a23a3d4f546390e5d7e9aa16420bd"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1666812439.208873, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_team_data`"}, "seed.github_integration_tests.github_user_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_user_data"], "unique_id": "seed.github_integration_tests.github_user_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_user_data.csv", "original_file_path": "seeds/github_user_data.csv", "name": "github_user_data", "alias": "github_user_data", "checksum": {"name": "sha256", "checksum": "5d101839c6a685fac17231a071c6516f3ac668b133d7a96a83d97ede20f16e46"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1666812439.210102, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_user_data`"}, "model.github.github__weekly_metrics": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.date_trunc"], "nodes": ["model.github.github__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "github__weekly_metrics"], "unique_id": "model.github.github__weekly_metrics", "raw_code": "with daily_metrics as (\n select *\n from {{ ref('github__daily_metrics') }}\n)\n\nselect \n {{ dbt.date_trunc('week', 'day') }} as week, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__weekly_metrics.sql", "original_file_path": "models/github__weekly_metrics.sql", "name": "github__weekly_metrics", "alias": "github__weekly_metrics", "checksum": {"name": "sha256", "checksum": "0c23e13d9ae5aa9256b832965069a021826131bbcf8c23be244b660d1a513870"}, "tags": [], "refs": [["github__daily_metrics"]], "sources": [], "metrics": [], "description": "Summary numbers for issues and pull requests by week\n", "columns": {"week": {"name": "week", "description": "The reporting week", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_opened": {"name": "number_issues_opened", "description": "The total number of issues created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_closed": {"name": "number_issues_closed", "description": "The total number of issues closed during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_issue_open": {"name": "avg_days_issue_open", "description": "The average number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_issue_open": {"name": "longest_days_issue_open", "description": "The longest number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_opened": {"name": "number_prs_opened", "description": "The total number of pull requests created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_merged": {"name": "number_prs_merged", "description": "The total number of pull requests merged during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_closed_without_merge": {"name": "number_prs_closed_without_merge", "description": "The total number of pull requests closed without a merge during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_pr_open": {"name": "avg_days_pr_open", "description": "The average number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_pr_open": {"name": "longest_days_pr_open", "description": "The longest number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__weekly_metrics.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1666812439.5157928, "compiled_code": "with daily_metrics as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`github__daily_metrics`\n)\n\nselect \n timestamp_trunc(\n cast(day as timestamp),\n week\n ) as week, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github__weekly_metrics`"}, "model.github.github__monthly_metrics": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.date_trunc"], "nodes": ["model.github.github__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "github__monthly_metrics"], "unique_id": "model.github.github__monthly_metrics", "raw_code": "with daily_metrics as (\n select *\n from {{ ref('github__daily_metrics') }}\n)\n\nselect \n {{ dbt.date_trunc('month', 'day') }} as month, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__monthly_metrics.sql", "original_file_path": "models/github__monthly_metrics.sql", "name": "github__monthly_metrics", "alias": "github__monthly_metrics", "checksum": {"name": "sha256", "checksum": "13125ad4966c9d1caa3cd74e6174cc3845a7ceb7929836e849e70628af2b0d0d"}, "tags": [], "refs": [["github__daily_metrics"]], "sources": [], "metrics": [], "description": "Summary numbers for issues and pull requests by month\n", "columns": {"month": {"name": "month", "description": "The reporting month", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_opened": {"name": "number_issues_opened", "description": "The total number of issues created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_closed": {"name": "number_issues_closed", "description": "The total number of issues closed during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_issue_open": {"name": "avg_days_issue_open", "description": "The average number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_issue_open": {"name": "longest_days_issue_open", "description": "The longest number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_opened": {"name": "number_prs_opened", "description": "The total number of pull requests created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_merged": {"name": "number_prs_merged", "description": "The total number of pull requests merged during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_closed_without_merge": {"name": "number_prs_closed_without_merge", "description": "The total number of pull requests closed without a merge during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_pr_open": {"name": "avg_days_pr_open", "description": "The average number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_pr_open": {"name": "longest_days_pr_open", "description": "The longest number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__monthly_metrics.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1666812439.51751, "compiled_code": "with daily_metrics as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`github__daily_metrics`\n)\n\nselect \n timestamp_trunc(\n cast(day as timestamp),\n month\n ) as month, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github__monthly_metrics`"}, "model.github.github__quarterly_metrics": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.date_trunc"], "nodes": ["model.github.github__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "github__quarterly_metrics"], "unique_id": "model.github.github__quarterly_metrics", "raw_code": "with daily_metrics as (\n select *\n from {{ ref('github__daily_metrics') }}\n)\n\nselect \n {{ dbt.date_trunc('quarter', 'day') }} as quarter, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\n\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__quarterly_metrics.sql", "original_file_path": "models/github__quarterly_metrics.sql", "name": "github__quarterly_metrics", "alias": "github__quarterly_metrics", "checksum": {"name": "sha256", "checksum": "482a40e9b5ae8283bec98905910cc35747f7f98accd058453d69064844533c50"}, "tags": [], "refs": [["github__daily_metrics"]], "sources": [], "metrics": [], "description": "Summary numbers for issues and pull requests by quarter\n", "columns": {"quarter": {"name": "quarter", "description": "The reporting quarter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_opened": {"name": "number_issues_opened", "description": "The total number of issues created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_closed": {"name": "number_issues_closed", "description": "The total number of issues closed during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_issue_open": {"name": "avg_days_issue_open", "description": "The average number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_issue_open": {"name": "longest_days_issue_open", "description": "The longest number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_opened": {"name": "number_prs_opened", "description": "The total number of pull requests created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_merged": {"name": "number_prs_merged", "description": "The total number of pull requests merged during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_closed_without_merge": {"name": "number_prs_closed_without_merge", "description": "The total number of pull requests closed without a merge during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_pr_open": {"name": "avg_days_pr_open", "description": "The average number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_pr_open": {"name": "longest_days_pr_open", "description": "The longest number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__quarterly_metrics.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1666812439.519181, "compiled_code": "with daily_metrics as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`github__daily_metrics`\n)\n\nselect \n timestamp_trunc(\n cast(day as timestamp),\n quarter\n ) as quarter, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\n\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github__quarterly_metrics`"}, "model.github.github__pull_requests": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.github.int_github__issue_joined"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "github__pull_requests"], "unique_id": "model.github.github__pull_requests", "raw_code": "with issue_joined as (\n select *\n from {{ ref('int_github__issue_joined') }} \n)\n\nselect\n *\nfrom issue_joined\nwhere is_pull_request", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__pull_requests.sql", "original_file_path": "models/github__pull_requests.sql", "name": "github__pull_requests", "alias": "github__pull_requests", "checksum": {"name": "sha256", "checksum": "ab4761ae05c0aabc7585d92ed7c68e12b53317a47a4278810e1777a051f43350"}, "tags": [], "refs": [["int_github__issue_joined"]], "sources": [], "metrics": [], "description": "Basic information about pull_requests as well as additional fields about reviews and time between actions\n", "columns": {"issue_id": {"name": "issue_id", "description": "The unique ID of an issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "body": {"name": "body", "description": "the text body of the description of the pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed_at": {"name": "closed_at", "description": "Timestamp of when the pull request was closed. NULL for pull requests that are still open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the pull request was created", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_locked": {"name": "is_locked", "description": "Boolean indicating whether the issue is locked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "milestone_id": {"name": "milestone_id", "description": "Foreign key that references the milestone.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_pull_request": {"name": "is_pull_request", "description": "Boolean indiciating whether the issue is a pull request.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_number": {"name": "issue_number", "description": "The number of the pull request. Unique within a repository, but not accross.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_id": {"name": "repository_id", "description": "Foreign key that references the repository table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the issue was last updated", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "days_issue_open": {"name": "days_issue_open", "description": "The number of days an issue has been open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_times_reopened": {"name": "number_of_times_reopened", "description": "Total number of times the issue was reopened", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_comments": {"name": "number_of_comments", "description": "The total number of comments included in the issue", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_login_name": {"name": "creator_login_name", "description": "User that created the issue login name", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_name": {"name": "creator_name", "description": "User that created the issue name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_company": {"name": "creator_company", "description": "User that created the issue company name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the pull request is open or closed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url_link": {"name": "url_link", "description": "A link to the pull request on github.com", "meta": {}, "data_type": null, "quote": null, "tags": []}, "labels": {"name": "labels", "description": "The labels currently applied to the pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository": {"name": "repository", "description": "The repository that the pull request applies to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_team_names": {"name": "repository_team_names", "description": "An aggreate of the teams associated with the repository", "meta": {}, "data_type": null, "quote": null, "tags": []}, "assignees": {"name": "assignees", "description": "Users who have been assigned to the pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hours_request_review_to_first_review": {"name": "hours_request_review_to_first_review", "description": "Number of hours between the first request for review and a review", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hours_request_review_to_first_action": {"name": "hours_request_review_to_first_action", "description": "Number of hours between the first request for review and any action besides dismissing the request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hours_request_review_to_merge": {"name": "hours_request_review_to_merge", "description": "Number of hours between the first request for review and the pull request being merged", "meta": {}, "data_type": null, "quote": null, "tags": []}, "merged_at": {"name": "merged_at", "description": "Timestamp of when the pull request was merged", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reviewers": {"name": "reviewers", "description": "List of Users who reviewed the pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_reviews": {"name": "number_of_reviews", "description": "Number of times a pull request was reviewed", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__pull_requests.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1666812439.5124412, "compiled_code": "with __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n), __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n), __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n), __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n), __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n), __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n), __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n), __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n), __dbt__cte__int_github__issue_joined as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_labels as (\n select *\n from __dbt__cte__int_github__issue_labels\n), \n\nrepository_teams as (\n select \n \n *\n from __dbt__cte__int_github__repository_teams\n\n \n), \n\nissue_assignees as (\n select *\n from __dbt__cte__int_github__issue_assignees\n), \n\nissue_open_length as (\n select *\n from __dbt__cte__int_github__issue_open_length\n), \n\nissue_comments as (\n select *\n from __dbt__cte__int_github__issue_comments\n), \n\ncreator as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n), \n\npull_request_times as (\n select *\n from __dbt__cte__int_github__pull_request_times\n), \n\npull_request_reviewers as (\n select *\n from __dbt__cte__int_github__pull_request_reviewers\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then 'https://github.com/' || repository_teams.repository || '/pull/' || issue.issue_number\n else 'https://github.com/' || repository_teams.repository || '/issues/' || issue.issue_number\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n \n repository_teams.repository_team_names,\n \n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id\n),issue_joined as (\n select *\n from __dbt__cte__int_github__issue_joined \n)\n\nselect\n *\nfrom issue_joined\nwhere is_pull_request", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.github.int_github__issue_label_joined", "sql": " __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n)"}, {"id": "model.github.int_github__issue_labels", "sql": " __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n)"}, {"id": "model.github.int_github__repository_teams", "sql": " __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n)"}, {"id": "model.github.int_github__issue_assignees", "sql": " __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n)"}, {"id": "model.github.int_github__issue_open_length", "sql": " __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n)"}, {"id": "model.github.int_github__issue_comments", "sql": " __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n)"}, {"id": "model.github.int_github__pull_request_times", "sql": " __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n)"}, {"id": "model.github.int_github__pull_request_reviewers", "sql": " __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n)"}, {"id": "model.github.int_github__issue_joined", "sql": " __dbt__cte__int_github__issue_joined as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_labels as (\n select *\n from __dbt__cte__int_github__issue_labels\n), \n\nrepository_teams as (\n select \n \n *\n from __dbt__cte__int_github__repository_teams\n\n \n), \n\nissue_assignees as (\n select *\n from __dbt__cte__int_github__issue_assignees\n), \n\nissue_open_length as (\n select *\n from __dbt__cte__int_github__issue_open_length\n), \n\nissue_comments as (\n select *\n from __dbt__cte__int_github__issue_comments\n), \n\ncreator as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n), \n\npull_request_times as (\n select *\n from __dbt__cte__int_github__pull_request_times\n), \n\npull_request_reviewers as (\n select *\n from __dbt__cte__int_github__pull_request_reviewers\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then 'https://github.com/' || repository_teams.repository || '/pull/' || issue.issue_number\n else 'https://github.com/' || repository_teams.repository || '/issues/' || issue.issue_number\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n \n repository_teams.repository_team_names,\n \n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id\n)"}], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github__pull_requests`"}, "model.github.github__daily_metrics": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.date_trunc"], "nodes": ["model.github.github__issues", "model.github.github__pull_requests"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "github__daily_metrics"], "unique_id": "model.github.github__daily_metrics", "raw_code": "with github_issues as (\n select *\n from {{ ref('github__issues') }}\n), \n\npull_requests as (\n select *\n from {{ ref('github__pull_requests') }}\n), \n\nissues_opened_per_day as (\n select \n {{ dbt.date_trunc('day', 'created_at') }} as day, \n count(*) as number_issues_opened,\n sum(days_issue_open) as sum_days_issue_open,\n max(days_issue_open) as longest_days_issue_open\n from github_issues\n group by 1\n), \n\nissues_closed_per_day as (\n select \n {{ dbt.date_trunc('day', 'closed_at') }} as day, \n count(*) as number_issues_closed\n from github_issues\n where closed_at is not null\n group by 1\n), \n\nprs_opened_per_day as (\n select \n {{ dbt.date_trunc('day', 'created_at') }} as day, \n count(*) as number_prs_opened,\n sum(days_issue_open) as sum_days_pr_open,\n max(days_issue_open) as longest_days_pr_open\n from pull_requests\n group by 1\n), \n\nprs_merged_per_day as (\n select \n {{ dbt.date_trunc('day', 'merged_at') }} as day, \n count(*) as number_prs_merged\n from pull_requests\n where merged_at is not null\n group by 1\n), \n\nprs_closed_without_merge_per_day as (\n select \n {{ dbt.date_trunc('day', 'closed_at') }} as day, \n count(*) as number_prs_closed_without_merge\n from pull_requests\n where closed_at is not null\n and merged_at is null\n group by 1\n), \n\nissues_per_day as (\n select \n coalesce(issues_opened_per_day.day, \n issues_closed_per_day.day\n ) as day,\n number_issues_opened,\n number_issues_closed, \n sum_days_issue_open,\n longest_days_issue_open\n from issues_opened_per_day\n full outer join issues_closed_per_day on issues_opened_per_day.day = issues_closed_per_day.day\n), \n\nprs_per_day as (\n select \n coalesce(prs_opened_per_day.day, \n prs_merged_per_day.day,\n prs_closed_without_merge_per_day.day\n ) as day,\n number_prs_opened,\n number_prs_merged,\n number_prs_closed_without_merge,\n sum_days_pr_open,\n longest_days_pr_open\n from prs_opened_per_day\n full outer join prs_merged_per_day on prs_opened_per_day.day = prs_merged_per_day.day\n full outer join prs_closed_without_merge_per_day on coalesce(prs_opened_per_day.day, prs_merged_per_day.day) = prs_closed_without_merge_per_day.day\n)\n\nselect \n coalesce(issues_per_day.day, prs_per_day.day) as day,\n coalesce(number_issues_opened, 0) as number_issues_opened,\n coalesce(number_issues_closed, 0) as number_issues_closed,\n sum_days_issue_open,\n longest_days_issue_open,\n coalesce(number_prs_opened, 0) as number_prs_opened,\n coalesce(number_prs_merged, 0) as number_prs_merged,\n coalesce(number_prs_closed_without_merge, 0) as number_prs_closed_without_merge,\n sum_days_pr_open,\n longest_days_pr_open\nfrom issues_per_day \nfull outer join prs_per_day on issues_per_day.day = prs_per_day.day\norder by day desc", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__daily_metrics.sql", "original_file_path": "models/github__daily_metrics.sql", "name": "github__daily_metrics", "alias": "github__daily_metrics", "checksum": {"name": "sha256", "checksum": "a6ee3eb9c8198f8b11e48b8e0206e90860a02af8a20f748985a58499dde4f476"}, "tags": [], "refs": [["github__issues"], ["github__pull_requests"]], "sources": [], "metrics": [], "description": "Summary numbers for issues and pull requests by day\n", "columns": {"day": {"name": "day", "description": "The reporting day", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_opened": {"name": "number_issues_opened", "description": "The total number of issues created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_closed": {"name": "number_issues_closed", "description": "The total number of issues closed during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sum_days_issue_open": {"name": "sum_days_issue_open", "description": "The total number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_issue_open": {"name": "longest_days_issue_open", "description": "The longest number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_opened": {"name": "number_prs_opened", "description": "The total number of pull requests created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_merged": {"name": "number_prs_merged", "description": "The total number of pull requests merged during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_closed_without_merge": {"name": "number_prs_closed_without_merge", "description": "The total number of pull requests closed without a merge during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sum_days_pr_open": {"name": "sum_days_pr_open", "description": "The total number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_pr_open": {"name": "longest_days_pr_open", "description": "The longest number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__daily_metrics.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1666812439.5141602, "compiled_code": "with github_issues as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`github__issues`\n), \n\npull_requests as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`github__pull_requests`\n), \n\nissues_opened_per_day as (\n select \n timestamp_trunc(\n cast(created_at as timestamp),\n day\n ) as day, \n count(*) as number_issues_opened,\n sum(days_issue_open) as sum_days_issue_open,\n max(days_issue_open) as longest_days_issue_open\n from github_issues\n group by 1\n), \n\nissues_closed_per_day as (\n select \n timestamp_trunc(\n cast(closed_at as timestamp),\n day\n ) as day, \n count(*) as number_issues_closed\n from github_issues\n where closed_at is not null\n group by 1\n), \n\nprs_opened_per_day as (\n select \n timestamp_trunc(\n cast(created_at as timestamp),\n day\n ) as day, \n count(*) as number_prs_opened,\n sum(days_issue_open) as sum_days_pr_open,\n max(days_issue_open) as longest_days_pr_open\n from pull_requests\n group by 1\n), \n\nprs_merged_per_day as (\n select \n timestamp_trunc(\n cast(merged_at as timestamp),\n day\n ) as day, \n count(*) as number_prs_merged\n from pull_requests\n where merged_at is not null\n group by 1\n), \n\nprs_closed_without_merge_per_day as (\n select \n timestamp_trunc(\n cast(closed_at as timestamp),\n day\n ) as day, \n count(*) as number_prs_closed_without_merge\n from pull_requests\n where closed_at is not null\n and merged_at is null\n group by 1\n), \n\nissues_per_day as (\n select \n coalesce(issues_opened_per_day.day, \n issues_closed_per_day.day\n ) as day,\n number_issues_opened,\n number_issues_closed, \n sum_days_issue_open,\n longest_days_issue_open\n from issues_opened_per_day\n full outer join issues_closed_per_day on issues_opened_per_day.day = issues_closed_per_day.day\n), \n\nprs_per_day as (\n select \n coalesce(prs_opened_per_day.day, \n prs_merged_per_day.day,\n prs_closed_without_merge_per_day.day\n ) as day,\n number_prs_opened,\n number_prs_merged,\n number_prs_closed_without_merge,\n sum_days_pr_open,\n longest_days_pr_open\n from prs_opened_per_day\n full outer join prs_merged_per_day on prs_opened_per_day.day = prs_merged_per_day.day\n full outer join prs_closed_without_merge_per_day on coalesce(prs_opened_per_day.day, prs_merged_per_day.day) = prs_closed_without_merge_per_day.day\n)\n\nselect \n coalesce(issues_per_day.day, prs_per_day.day) as day,\n coalesce(number_issues_opened, 0) as number_issues_opened,\n coalesce(number_issues_closed, 0) as number_issues_closed,\n sum_days_issue_open,\n longest_days_issue_open,\n coalesce(number_prs_opened, 0) as number_prs_opened,\n coalesce(number_prs_merged, 0) as number_prs_merged,\n coalesce(number_prs_closed_without_merge, 0) as number_prs_closed_without_merge,\n sum_days_pr_open,\n longest_days_pr_open\nfrom issues_per_day \nfull outer join prs_per_day on issues_per_day.day = prs_per_day.day\norder by day desc", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github__daily_metrics`"}, "model.github.github__issues": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.github.int_github__issue_joined"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "github__issues"], "unique_id": "model.github.github__issues", "raw_code": "with issue_joined as (\n select *\n from {{ ref('int_github__issue_joined') }} \n)\n\nselect\n issue_id,\n body,\n closed_at,\n created_at,\n is_locked,\n milestone_id,\n issue_number,\n is_pull_request,\n repository_id,\n state,\n title,\n updated_at,\n user_id,\n url_link,\n days_issue_open,\n number_of_times_reopened,\n labels,\n number_of_comments,\n repository,\n {% if var('github__using_repo_team', true) %}\n repository_team_names,\n {% endif %}\n assignees,\n creator_login_name,\n creator_name,\n creator_company\nfrom issue_joined\nwhere not is_pull_request", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__issues.sql", "original_file_path": "models/github__issues.sql", "name": "github__issues", "alias": "github__issues", "checksum": {"name": "sha256", "checksum": "382d94f82ea63be958d53cc7353d6e3e792844f45ab9c48609e03355eb68a133"}, "tags": [], "refs": [["int_github__issue_joined"]], "sources": [], "metrics": [], "description": "Basic information about issues as well as additional fields for things like assignees, projects, labels and open time\n", "columns": {"issue_id": {"name": "issue_id", "description": "The unique ID of an issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "body": {"name": "body", "description": "The text body of the issue's main description", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed_at": {"name": "closed_at", "description": "The timestamp for when an issue was last closed. \"null\" for issues that are open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The timestamp for when an issue was created", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_locked": {"name": "is_locked", "description": "Boolean indicating if the issue is locked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "milestone_id": {"name": "milestone_id", "description": "Foreign key that references the milestone table representing the current milestone the issue is in", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_number": {"name": "issue_number", "description": "The number of the issue. Is unique within a repository, but not accross", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_pull_request": {"name": "is_pull_request", "description": "Boolean indicating whether the issue is a pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_id": {"name": "repository_id", "description": "Foreign key that references the repository table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the issue is open or closed", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the issue", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the issue was last updated", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url_link": {"name": "url_link", "description": "a link to the issue on github.com", "meta": {}, "data_type": null, "quote": null, "tags": []}, "days_issue_open": {"name": "days_issue_open", "description": "The number of days an issue has been open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_times_reopened": {"name": "number_of_times_reopened", "description": "Total number of times the issue was reopened", "meta": {}, "data_type": null, "quote": null, "tags": []}, "labels": {"name": "labels", "description": "A list of the labels that are currently applied to the issue", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_comments": {"name": "number_of_comments", "description": "The total number of comments included in the issue", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_login_name": {"name": "creator_login_name", "description": "User that created the issue login name", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_name": {"name": "creator_name", "description": "User that created the issue name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_company": {"name": "creator_company", "description": "User that created the issue company name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository": {"name": "repository", "description": "The repository that the issue is applicable to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_team_names": {"name": "repository_team_names", "description": "An aggreate of the teams associated with the repository", "meta": {}, "data_type": null, "quote": null, "tags": []}, "assignees": {"name": "assignees", "description": "The current list of users assigned to the issue", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__issues.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1666812439.5075572, "compiled_code": "with __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n), __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n), __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n), __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n), __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n), __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n), __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n), __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n), __dbt__cte__int_github__issue_joined as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_labels as (\n select *\n from __dbt__cte__int_github__issue_labels\n), \n\nrepository_teams as (\n select \n \n *\n from __dbt__cte__int_github__repository_teams\n\n \n), \n\nissue_assignees as (\n select *\n from __dbt__cte__int_github__issue_assignees\n), \n\nissue_open_length as (\n select *\n from __dbt__cte__int_github__issue_open_length\n), \n\nissue_comments as (\n select *\n from __dbt__cte__int_github__issue_comments\n), \n\ncreator as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n), \n\npull_request_times as (\n select *\n from __dbt__cte__int_github__pull_request_times\n), \n\npull_request_reviewers as (\n select *\n from __dbt__cte__int_github__pull_request_reviewers\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then 'https://github.com/' || repository_teams.repository || '/pull/' || issue.issue_number\n else 'https://github.com/' || repository_teams.repository || '/issues/' || issue.issue_number\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n \n repository_teams.repository_team_names,\n \n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id\n),issue_joined as (\n select *\n from __dbt__cte__int_github__issue_joined \n)\n\nselect\n issue_id,\n body,\n closed_at,\n created_at,\n is_locked,\n milestone_id,\n issue_number,\n is_pull_request,\n repository_id,\n state,\n title,\n updated_at,\n user_id,\n url_link,\n days_issue_open,\n number_of_times_reopened,\n labels,\n number_of_comments,\n repository,\n \n repository_team_names,\n \n assignees,\n creator_login_name,\n creator_name,\n creator_company\nfrom issue_joined\nwhere not is_pull_request", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.github.int_github__issue_label_joined", "sql": " __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n)"}, {"id": "model.github.int_github__issue_labels", "sql": " __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n)"}, {"id": "model.github.int_github__repository_teams", "sql": " __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n)"}, {"id": "model.github.int_github__issue_assignees", "sql": " __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n)"}, {"id": "model.github.int_github__issue_open_length", "sql": " __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n)"}, {"id": "model.github.int_github__issue_comments", "sql": " __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n)"}, {"id": "model.github.int_github__pull_request_times", "sql": " __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n)"}, {"id": "model.github.int_github__pull_request_reviewers", "sql": " __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n)"}, {"id": "model.github.int_github__issue_joined", "sql": " __dbt__cte__int_github__issue_joined as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_labels as (\n select *\n from __dbt__cte__int_github__issue_labels\n), \n\nrepository_teams as (\n select \n \n *\n from __dbt__cte__int_github__repository_teams\n\n \n), \n\nissue_assignees as (\n select *\n from __dbt__cte__int_github__issue_assignees\n), \n\nissue_open_length as (\n select *\n from __dbt__cte__int_github__issue_open_length\n), \n\nissue_comments as (\n select *\n from __dbt__cte__int_github__issue_comments\n), \n\ncreator as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n), \n\npull_request_times as (\n select *\n from __dbt__cte__int_github__pull_request_times\n), \n\npull_request_reviewers as (\n select *\n from __dbt__cte__int_github__pull_request_reviewers\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then 'https://github.com/' || repository_teams.repository || '/pull/' || issue.issue_number\n else 'https://github.com/' || repository_teams.repository || '/issues/' || issue.issue_number\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n \n repository_teams.repository_team_names,\n \n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id\n)"}], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github__issues`"}, "model.github.int_github__pull_request_times": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt.datediff"], "nodes": ["model.github_source.stg_github__pull_request_review", "model.github_source.stg_github__pull_request", "model.github_source.stg_github__requested_reviewer_history", "model.github_source.stg_github__issue", "model.github_source.stg_github__issue_merged"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__pull_request_times"], "unique_id": "model.github.int_github__pull_request_times", "raw_code": "with pull_request_review as (\n select *\n from {{ var('pull_request_review') }}\n), \n\npull_request as (\n select *\n from {{ var('pull_request')}}\n), \n\nrequested_reviewer_history as (\n select *\n from {{ var('requested_reviewer_history')}}\n where not removed\n), \n\nissue as (\n select *\n from {{ var('issue') }}\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from {{ var('issue_merged')}}\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n {{ dbt.datediff(\n 'time_of_first_request', \n \"coalesce(time_of_first_review_post_request, \" ~ dbt.current_timestamp_backcompat() ~ \")\", \n 'second') \n }}/ 60/60 as hours_request_review_to_first_review,\n {{ dbt.datediff(\n 'time_of_first_request', \n \"least(\n coalesce(time_of_first_requested_reviewer_review, \" ~ dbt.current_timestamp_backcompat() ~ \"),\n coalesce(issue.closed_at, \" ~ dbt.current_timestamp_backcompat() ~ \"))\", \n 'second') \n }} / 60/60 as hours_request_review_to_first_action,\n {{ dbt.datediff('time_of_first_request', 'merged_at', 'second') }}/ 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__pull_request_times.sql", "original_file_path": "models/intermediate/int_github__pull_request_times.sql", "name": "int_github__pull_request_times", "alias": "int_github__pull_request_times", "checksum": {"name": "sha256", "checksum": "35a197fef6ef12f2b408564be9d54b15ba8ff1eee0cf8514abedef9f7818422c"}, "tags": [], "refs": [["stg_github__pull_request_review"], ["stg_github__pull_request"], ["stg_github__requested_reviewer_history"], ["stg_github__issue"], ["stg_github__issue_merged"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__pull_request_times.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1666812439.250686, "compiled_code": "with pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__pull_request_reviewers": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.github_source.stg_github__pull_request_review", "model.github_source.stg_github__user"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__pull_request_reviewers"], "unique_id": "model.github.int_github__pull_request_reviewers", "raw_code": "with pull_request_review as (\n select *\n from {{ var('pull_request_review') }}\n), \n\ngithub_user as (\n select *\n from {{ var('user')}}\n)\n\nselect\n pull_request_review.pull_request_id,\n {{ fivetran_utils.string_agg( 'github_user.login_name', \"', '\" )}} as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__pull_request_reviewers.sql", "original_file_path": "models/intermediate/int_github__pull_request_reviewers.sql", "name": "int_github__pull_request_reviewers", "alias": "int_github__pull_request_reviewers", "checksum": {"name": "sha256", "checksum": "fd5518273ce75ae9066be686308ee078ce9a3df73f3799620f8eb6e611655cd7"}, "tags": [], "refs": [["stg_github__pull_request_review"], ["stg_github__user"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__pull_request_reviewers.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1666812439.261657, "compiled_code": "with pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__issue_label_joined": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.github_source.stg_github__issue_label", "model.github_source.stg_github__label"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_label_joined"], "unique_id": "model.github.int_github__issue_label_joined", "raw_code": "with issue_label as (\n\n select *\n from {{ var('issue_label') }}\n\n), label as (\n\n select *\n from {{ var('label') }}\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_label_joined.sql", "original_file_path": "models/intermediate/int_github__issue_label_joined.sql", "name": "int_github__issue_label_joined", "alias": "int_github__issue_label_joined", "checksum": {"name": "sha256", "checksum": "6f1b225ff9958e67fae4ea1ba0be10ebb9426da364c758c37d0b83305d575d98"}, "tags": [], "refs": [["stg_github__issue_label"], ["stg_github__label"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_label_joined.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1666812439.2669702, "compiled_code": "with issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__issue_joined": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.concat"], "nodes": ["model.github_source.stg_github__issue", "model.github.int_github__issue_labels", "model.github.int_github__repository_teams", "model.github.int_github__issue_assignees", "model.github.int_github__issue_open_length", "model.github.int_github__issue_comments", "model.github_source.stg_github__user", "model.github.int_github__pull_request_times", "model.github.int_github__pull_request_reviewers", "model.github_source.stg_github__pull_request"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_joined"], "unique_id": "model.github.int_github__issue_joined", "raw_code": "with issue as (\n select *\n from {{ var('issue') }}\n), \n\nissue_labels as (\n select *\n from {{ ref('int_github__issue_labels')}}\n), \n\nrepository_teams as (\n select \n {% if var('github__using_repo_team', true) %}\n *\n from {{ ref('int_github__repository_teams') }}\n\n {% else %}\n repository_id,\n full_name as repository\n from {{ var('repository') }}\n\n {% endif %}\n), \n\nissue_assignees as (\n select *\n from {{ ref('int_github__issue_assignees')}}\n), \n\nissue_open_length as (\n select *\n from {{ ref('int_github__issue_open_length')}}\n), \n\nissue_comments as (\n select *\n from {{ ref('int_github__issue_comments')}}\n), \n\ncreator as (\n select *\n from {{ var('user')}}\n), \n\npull_request_times as (\n select *\n from {{ ref('int_github__pull_request_times')}}\n), \n\npull_request_reviewers as (\n select *\n from {{ ref('int_github__pull_request_reviewers')}}\n), \n\npull_request as (\n select *\n from {{ var('pull_request')}}\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then {{ dbt.concat([\"'https://github.com/'\",'repository_teams.repository',\"'/pull/'\", 'issue.issue_number']) }}\n else {{ dbt.concat([\"'https://github.com/'\",'repository_teams.repository',\"'/issues/'\", 'issue.issue_number']) }}\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n {% if var('github__using_repo_team', true) %}\n repository_teams.repository_team_names,\n {% endif %}\n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_joined.sql", "original_file_path": "models/intermediate/int_github__issue_joined.sql", "name": "int_github__issue_joined", "alias": "int_github__issue_joined", "checksum": {"name": "sha256", "checksum": "75658855b696a3744360bbbf58433d6155e44d35128236e08da3df93b87ead16"}, "tags": [], "refs": [["stg_github__issue"], ["int_github__issue_labels"], ["int_github__repository_teams"], ["int_github__issue_assignees"], ["int_github__issue_open_length"], ["int_github__issue_comments"], ["stg_github__user"], ["int_github__pull_request_times"], ["int_github__pull_request_reviewers"], ["stg_github__pull_request"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_joined.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1666812439.2707431, "compiled_code": "with __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n), __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n), __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n), __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n), __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n), __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n), __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n), __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n),issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_labels as (\n select *\n from __dbt__cte__int_github__issue_labels\n), \n\nrepository_teams as (\n select \n \n *\n from __dbt__cte__int_github__repository_teams\n\n \n), \n\nissue_assignees as (\n select *\n from __dbt__cte__int_github__issue_assignees\n), \n\nissue_open_length as (\n select *\n from __dbt__cte__int_github__issue_open_length\n), \n\nissue_comments as (\n select *\n from __dbt__cte__int_github__issue_comments\n), \n\ncreator as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n), \n\npull_request_times as (\n select *\n from __dbt__cte__int_github__pull_request_times\n), \n\npull_request_reviewers as (\n select *\n from __dbt__cte__int_github__pull_request_reviewers\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then 'https://github.com/' || repository_teams.repository || '/pull/' || issue.issue_number\n else 'https://github.com/' || repository_teams.repository || '/issues/' || issue.issue_number\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n \n repository_teams.repository_team_names,\n \n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.github.int_github__issue_label_joined", "sql": " __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n)"}, {"id": "model.github.int_github__issue_labels", "sql": " __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n)"}, {"id": "model.github.int_github__repository_teams", "sql": " __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n)"}, {"id": "model.github.int_github__issue_assignees", "sql": " __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n)"}, {"id": "model.github.int_github__issue_open_length", "sql": " __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n)"}, {"id": "model.github.int_github__issue_comments", "sql": " __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n)"}, {"id": "model.github.int_github__pull_request_times", "sql": " __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n)"}, {"id": "model.github.int_github__pull_request_reviewers", "sql": " __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n)"}], "relation_name": null}, "model.github.int_github__issue_labels": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.github.int_github__issue_label_joined"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_labels"], "unique_id": "model.github.int_github__issue_labels", "raw_code": "with issue_label as (\n select *\n from {{ ref('int_github__issue_label_joined') }}\n)\n\nselect\n issue_id,\n {{ fivetran_utils.string_agg( 'label', \"', '\" )}} as labels\nfrom issue_label\ngroup by issue_id", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_labels.sql", "original_file_path": "models/intermediate/int_github__issue_labels.sql", "name": "int_github__issue_labels", "alias": "int_github__issue_labels", "checksum": {"name": "sha256", "checksum": "126b7de5034d8b9e5067e9d0a346ea3d93132574cc3ae85d4d711270404f4064"}, "tags": [], "refs": [["int_github__issue_label_joined"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_labels.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1666812439.278359, "compiled_code": "with __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n),issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.github.int_github__issue_label_joined", "sql": " __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n)"}], "relation_name": null}, "model.github.int_github__issue_assignees": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.github_source.stg_github__issue_assignee", "model.github_source.stg_github__user"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_assignees"], "unique_id": "model.github.int_github__issue_assignees", "raw_code": "with issue_assignee as (\n select *\n from {{ var('issue_assignee') }}\n), \n\ngithub_user as (\n select *\n from {{ var('user')}}\n)\n\nselect\n issue_assignee.issue_id,\n {{ fivetran_utils.string_agg( 'github_user.login_name', \"', '\" )}} as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_assignees.sql", "original_file_path": "models/intermediate/int_github__issue_assignees.sql", "name": "int_github__issue_assignees", "alias": "int_github__issue_assignees", "checksum": {"name": "sha256", "checksum": "837310bb78ff6f1460babc622037227dbc0c5776aae3ce3f5e9de48cb2ffac9c"}, "tags": [], "refs": [["stg_github__issue_assignee"], ["stg_github__user"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_assignees.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1666812439.281491, "compiled_code": "with issue_assignee as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__issue_comments": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.github_source.stg_github__issue_comment"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_comments"], "unique_id": "model.github.int_github__issue_comments", "raw_code": "with issue_comment as (\n select *\n from {{ var('issue_comment') }}\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_comments.sql", "original_file_path": "models/intermediate/int_github__issue_comments.sql", "name": "int_github__issue_comments", "alias": "int_github__issue_comments", "checksum": {"name": "sha256", "checksum": "b56ffccc19ec39a1d1bc4137557c8e1971167f97e673ea30d0f713bd34bc111a"}, "tags": [], "refs": [["stg_github__issue_comment"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_comments.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1666812439.285284, "compiled_code": "with issue_comment as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__issue_open_length": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt.datediff"], "nodes": ["model.github_source.stg_github__issue", "model.github_source.stg_github__issue_closed_history"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_open_length"], "unique_id": "model.github.int_github__issue_open_length", "raw_code": "with issue as (\n select *\n from {{ var('issue') }}\n), \n\nissue_closed_history as (\n select *\n from {{ var('issue_closed_history') }}\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), {{ dbt.current_timestamp_backcompat() }}) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum({{ dbt.datediff('valid_starting', 'valid_until', 'second') }}) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_open_length.sql", "original_file_path": "models/intermediate/int_github__issue_open_length.sql", "name": "int_github__issue_open_length", "alias": "int_github__issue_open_length", "checksum": {"name": "sha256", "checksum": "58de864860664b785e8000ef983dcb006d60af6cbba301e72e9e4c45aa1d8d5a"}, "tags": [], "refs": [["stg_github__issue"], ["stg_github__issue_closed_history"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_open_length.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1666812439.28928, "compiled_code": "with issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__repository_teams": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.github_source.stg_github__repository", "model.github_source.stg_github__repo_team", "model.github_source.stg_github__team"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__repository_teams"], "unique_id": "model.github.int_github__repository_teams", "raw_code": "{{ config(enabled=var('github__using_repo_team', True)) }}\n\nwith repository as (\n select *\n from {{ var('repository')}}\n),\n\nrepo_teams as (\n select *\n from {{ var('repo_team')}}\n),\n\nteams as (\n select *\n from {{ var('team')}}\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n {{ fivetran_utils.string_agg('team_name', \"', '\" ) }} as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__repository_teams.sql", "original_file_path": "models/intermediate/int_github__repository_teams.sql", "name": "int_github__repository_teams", "alias": "int_github__repository_teams", "checksum": {"name": "sha256", "checksum": "aa75375faa9f533b0c9c935f80ed6e9c7b90f20249089e7d64b7b47194f9044e"}, "tags": [], "refs": [["stg_github__repository"], ["stg_github__repo_team"], ["stg_github__team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__repository_teams.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "enabled": true}, "created_at": 1666812439.293377, "compiled_code": "\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github_source.stg_github__issue_comment": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_comment_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__issue_comment_tmp", "model.github_source.stg_github__issue_comment_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__issue_comment"], "unique_id": "model.github_source.stg_github__issue_comment", "raw_code": "with issue_comment as (\n\n select *\n from {{ ref('stg_github__issue_comment_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_comment_tmp')),\n staging_columns=get_issue_comment_columns()\n )\n }}\n\n from issue_comment\n\n), fields as (\n\n select \n id as issue_comment_id,\n issue_id,\n user_id\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue_comment.sql", "original_file_path": "models/stg_github__issue_comment.sql", "name": "stg_github__issue_comment", "alias": "stg_github__issue_comment", "checksum": {"name": "sha256", "checksum": "2f96156ac9d0de0afe220888eb6912117a7d04b1680b8fb1f5890dfbbcdb2994"}, "tags": [], "refs": [["stg_github__issue_comment_tmp"], ["stg_github__issue_comment_tmp"]], "sources": [], "metrics": [], "description": "Table that contains comments made on issues", "columns": {"issue_comment_id": {"name": "issue_comment_id", "description": "System generated unique id for the issue comment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue_comment.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1666812439.558922, "compiled_code": "with issue_comment as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n body\n \n as \n \n body\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 issue_id\n \n as \n \n issue_id\n \n, \n \n \n updated_at\n \n as \n \n updated_at\n \n, \n \n \n user_id\n \n as \n \n user_id\n \n\n\n\n\n from issue_comment\n\n), fields as (\n\n select \n id as issue_comment_id,\n issue_id,\n user_id\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment`"}, "model.github_source.stg_github__requested_reviewer_history": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_requested_reviewer_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.github_source.stg_github__requested_reviewer_history_tmp", "model.github_source.stg_github__requested_reviewer_history_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__requested_reviewer_history"], "unique_id": "model.github_source.stg_github__requested_reviewer_history", "raw_code": "with requested_reviewer_history as (\n\n select *\n from {{ ref('stg_github__requested_reviewer_history_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__requested_reviewer_history_tmp')),\n staging_columns=get_requested_reviewer_history_columns()\n )\n }}\n\n from requested_reviewer_history\n\n), fields as (\n\n select \n pull_request_id,\n cast(created_at as {{ dbt.type_timestamp() }}) as created_at,\n requested_id,\n removed\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__requested_reviewer_history.sql", "original_file_path": "models/stg_github__requested_reviewer_history.sql", "name": "stg_github__requested_reviewer_history", "alias": "stg_github__requested_reviewer_history", "checksum": {"name": "sha256", "checksum": "40abf6ac94bece080abe8e8a45ed43030166df171697acf3c59c5958ffe68eba"}, "tags": [], "refs": [["stg_github__requested_reviewer_history_tmp"], ["stg_github__requested_reviewer_history_tmp"]], "sources": [], "metrics": [], "description": "Table containing when a user requests another user to review a pull request", "columns": {"pull_request_id": {"name": "pull_request_id", "description": "Foreign key that references the pull request table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the review was submitted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "requested_id": {"name": "requested_id", "description": "Foreign key that references the user table, representing the user that was requested to review a PR.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "removed": {"name": "removed", "description": "Boolean variable indicating if the requester was removed from the PR (true) or added to the PR (false).", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__requested_reviewer_history.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1666812439.565063, "compiled_code": "with requested_reviewer_history as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__requested_reviewer_history_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n actor_id\n \n as \n \n actor_id\n \n, \n \n \n created_at\n \n as \n \n created_at\n \n, \n \n \n pull_request_id\n \n as \n \n pull_request_id\n \n, \n \n \n removed\n \n as \n \n removed\n \n, \n \n \n requested_id\n \n as \n \n requested_id\n \n\n\n\n\n from requested_reviewer_history\n\n), fields as (\n\n select \n pull_request_id,\n cast(created_at as TIMESTAMP) as created_at,\n requested_id,\n removed\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__requested_reviewer_history`"}, "model.github_source.stg_github__issue_label": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_label_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__issue_label_tmp", "model.github_source.stg_github__issue_label_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__issue_label"], "unique_id": "model.github_source.stg_github__issue_label", "raw_code": "with issue_label as (\n\n select *\n from {{ ref('stg_github__issue_label_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_label_tmp')),\n staging_columns=get_issue_label_columns()\n )\n }}\n\n from issue_label\n\n), fields as (\n\n select \n issue_id,\n label_id\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue_label.sql", "original_file_path": "models/stg_github__issue_label.sql", "name": "stg_github__issue_label", "alias": "stg_github__issue_label", "checksum": {"name": "sha256", "checksum": "bbc4b8e82ab26b7cb753ead2165a6d483171b6def78a34c8ab6b2c9d1dc1357c"}, "tags": [], "refs": [["stg_github__issue_label_tmp"], ["stg_github__issue_label_tmp"]], "sources": [], "metrics": [], "description": "The current labels attached to an issue", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "label_id": {"name": "label_id", "description": "Unique identifier of the used label", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue_label.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1666812439.558292, "compiled_code": "with issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n label_id\n \n as \n \n label_id\n \n, \n \n \n issue_id\n \n as \n \n issue_id\n \n\n\n\n\n from issue_label\n\n), fields as (\n\n select \n issue_id,\n label_id\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label`"}, "model.github_source.stg_github__issue_merged": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_merged_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.github_source.stg_github__issue_merged_tmp", "model.github_source.stg_github__issue_merged_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__issue_merged"], "unique_id": "model.github_source.stg_github__issue_merged", "raw_code": "with issue_merged as (\n\n select *\n from {{ ref('stg_github__issue_merged_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_merged_tmp')),\n staging_columns=get_issue_merged_columns()\n )\n }}\n\n from issue_merged\n\n), fields as (\n\n select \n issue_id,\n cast(merged_at as {{ dbt.type_timestamp() }}) as merged_at\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue_merged.sql", "original_file_path": "models/stg_github__issue_merged.sql", "name": "stg_github__issue_merged", "alias": "stg_github__issue_merged", "checksum": {"name": "sha256", "checksum": "d0ffc63496f8a12ccde9c115909db85d5f2fbd7c2ca8a7761cd96abcf31f532c"}, "tags": [], "refs": [["stg_github__issue_merged_tmp"], ["stg_github__issue_merged_tmp"]], "sources": [], "metrics": [], "description": "Table that tracks when an issue (always a pull request) is merged", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table. This table will only reference issues that are pull requests", "meta": {}, "data_type": null, "quote": null, "tags": []}, "merged_at": {"name": "merged_at", "description": "Timestamp of when the code merge took place", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue_merged.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1666812439.559469, "compiled_code": "with issue_merged as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_merged_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n actor_id\n \n as \n \n actor_id\n \n, \n \n \n commit_sha\n \n as \n \n commit_sha\n \n, \n \n \n issue_id\n \n as \n \n issue_id\n \n, \n \n \n merged_at\n \n as \n \n merged_at\n \n\n\n\n\n from issue_merged\n\n), fields as (\n\n select \n issue_id,\n cast(merged_at as TIMESTAMP) as merged_at\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_merged`"}, "model.github_source.stg_github__issue_closed_history": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_closed_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.github_source.stg_github__issue_closed_history_tmp", "model.github_source.stg_github__issue_closed_history_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__issue_closed_history"], "unique_id": "model.github_source.stg_github__issue_closed_history", "raw_code": "with issue_closed_history as (\n\n select *\n from {{ ref('stg_github__issue_closed_history_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_closed_history_tmp')),\n staging_columns=get_issue_closed_history_columns()\n )\n }}\n\n from issue_closed_history\n\n), fields as (\n\n select \n issue_id,\n cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at,\n closed as is_closed\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue_closed_history.sql", "original_file_path": "models/stg_github__issue_closed_history.sql", "name": "stg_github__issue_closed_history", "alias": "stg_github__issue_closed_history", "checksum": {"name": "sha256", "checksum": "8820baed7a5b47177c8e57576741ab5d3763026682f66c52429092e655e07408"}, "tags": [], "refs": [["stg_github__issue_closed_history_tmp"], ["stg_github__issue_closed_history_tmp"]], "sources": [], "metrics": [], "description": "Table to track when an issue is closed or re-opened", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the action took place", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_closed": {"name": "is_closed", "description": "Boolean variable for if the issue was closed (true) or re-opened (false)", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue_closed_history.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1666812439.557817, "compiled_code": "with issue_closed_history as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n actor_id\n \n as \n \n actor_id\n \n, \n \n \n closed\n \n as \n \n closed\n \n, \n \n \n commit_sha\n \n as \n \n commit_sha\n \n, \n \n \n issue_id\n \n as \n \n issue_id\n \n, \n \n \n updated_at\n \n as \n \n updated_at\n \n\n\n\n\n from issue_closed_history\n\n), fields as (\n\n select \n issue_id,\n cast(updated_at as TIMESTAMP) as updated_at,\n closed as is_closed\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history`"}, "model.github_source.stg_github__issue_assignee": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_assignee_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__issue_assignee_tmp", "model.github_source.stg_github__issue_assignee_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__issue_assignee"], "unique_id": "model.github_source.stg_github__issue_assignee", "raw_code": "with issue_assignee as (\n\n select *\n from {{ ref('stg_github__issue_assignee_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_assignee_tmp')),\n staging_columns=get_issue_assignee_columns()\n )\n }}\n\n from issue_assignee\n\n), fields as (\n\n select \n issue_id,\n user_id\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue_assignee.sql", "original_file_path": "models/stg_github__issue_assignee.sql", "name": "stg_github__issue_assignee", "alias": "stg_github__issue_assignee", "checksum": {"name": "sha256", "checksum": "1ee1ae6a0a648f4fddde4964f184b889bfd09ca43f0560fb10faaa8544b2f90d"}, "tags": [], "refs": [["stg_github__issue_assignee_tmp"], ["stg_github__issue_assignee_tmp"]], "sources": [], "metrics": [], "description": "Table with the current user(s) assigned to an issue", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue_assignee.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1666812439.5558798, "compiled_code": "with issue_assignee as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n issue_id\n \n as \n \n issue_id\n \n, \n \n \n user_id\n \n as \n \n user_id\n \n\n\n\n\n from issue_assignee\n\n), fields as (\n\n select \n issue_id,\n user_id\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee`"}, "model.github_source.stg_github__repository": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_repository_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__repository_tmp", "model.github_source.stg_github__repository_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__repository"], "unique_id": "model.github_source.stg_github__repository", "raw_code": "with repository as (\n\n select *\n from {{ ref('stg_github__repository_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__repository_tmp')),\n staging_columns=get_repository_columns()\n )\n }}\n\n from repository\n\n), fields as (\n\n select \n id as repository_id,\n full_name,\n private as is_private\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__repository.sql", "original_file_path": "models/stg_github__repository.sql", "name": "stg_github__repository", "alias": "stg_github__repository", "checksum": {"name": "sha256", "checksum": "52faadfa1a36e8b144c01bdba106b9b22c58154bbd60b69c069c409f1b2f4712"}, "tags": [], "refs": [["stg_github__repository_tmp"], ["stg_github__repository_tmp"]], "sources": [], "metrics": [], "description": "Table representing the file structure of a directory under git control", "columns": {"repository_id": {"name": "repository_id", "description": "System generated unique id for the repository.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "full_name": {"name": "full_name", "description": "The name of the git repository.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_private": {"name": "is_private", "description": "Boolean field indicating whether the repository is private (true) or public (false).", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__repository.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1666812439.564342, "compiled_code": "with repository as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repository_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\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 created_at\n \n as \n \n created_at\n \n, \n \n \n default_branch\n \n as \n \n default_branch\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n fork\n \n as \n \n fork\n \n, \n \n \n full_name\n \n as \n \n full_name\n \n, \n \n \n homepage\n \n as \n \n homepage\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n language\n \n as \n \n language\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n owner_id\n \n as \n \n owner_id\n \n, \n \n \n private\n \n as \n \n private\n \n\n\n\n\n from repository\n\n), fields as (\n\n select \n id as repository_id,\n full_name,\n private as is_private\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__repository`"}, "model.github_source.stg_github__user": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_user_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__user_tmp", "model.github_source.stg_github__user_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__user"], "unique_id": "model.github_source.stg_github__user", "raw_code": "with github_user as (\n\n select *\n from {{ ref('stg_github__user_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__user_tmp')),\n staging_columns=get_user_columns()\n )\n }}\n \n \n from github_user\n\n), fields as (\n\n select\n id as user_id,\n login as login_name,\n name,\n company\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__user.sql", "original_file_path": "models/stg_github__user.sql", "name": "stg_github__user", "alias": "stg_github__user", "checksum": {"name": "sha256", "checksum": "3fade99df6af62e01efd3bdabe4245077eeb17d7c05a33eae885ab9cebfb33a6"}, "tags": [], "refs": [["stg_github__user_tmp"], ["stg_github__user_tmp"]], "sources": [], "metrics": [], "description": "Table representing contributors to a git project", "columns": {"user_id": {"name": "user_id", "description": "System generated unique id for the user.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "login_name": {"name": "login_name", "description": "The alias the user uses to login to github.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the user", "meta": {}, "data_type": null, "quote": null, "tags": []}, "company": {"name": "company", "description": "The company of the user.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__user.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1666812439.567612, "compiled_code": "with github_user as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n company\n \n as \n \n company\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n login\n \n as \n \n login\n \n, \n \n \n name\n \n as \n \n name\n \n\n\n\n \n \n from github_user\n\n), fields as (\n\n select\n id as user_id,\n login as login_name,\n name,\n company\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__user`"}, "model.github_source.stg_github__pull_request_review": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_pull_request_review_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.github_source.stg_github__pull_request_review_tmp", "model.github_source.stg_github__pull_request_review_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__pull_request_review"], "unique_id": "model.github_source.stg_github__pull_request_review", "raw_code": "with pull_request_review as (\n\n select *\n from {{ ref('stg_github__pull_request_review_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__pull_request_review_tmp')),\n staging_columns=get_pull_request_review_columns()\n )\n }}\n\n from pull_request_review\n\n), fields as (\n\n select \n id as pull_request_review_id,\n pull_request_id,\n cast(submitted_at as {{ dbt.type_timestamp() }}) as submitted_at,\n state,\n user_id\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__pull_request_review.sql", "original_file_path": "models/stg_github__pull_request_review.sql", "name": "stg_github__pull_request_review", "alias": "stg_github__pull_request_review", "checksum": {"name": "sha256", "checksum": "3c5b56fcda26503106a11215aa4895199d140d378e4f81dc73fee0a95a39ef6b"}, "tags": [], "refs": [["stg_github__pull_request_review_tmp"], ["stg_github__pull_request_review_tmp"]], "sources": [], "metrics": [], "description": "Table containing reviews made to pull requests", "columns": {"pull_request_review_id": {"name": "pull_request_review_id", "description": "System generated unique id for the pull request review.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pull_request_id": {"name": "pull_request_id", "description": "Foreign key that references the pull request table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "submitted_at": {"name": "submitted_at", "description": "Timestamp of when the request for review was submitted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the review was an approval, request for change, comment, dismissal.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table, representing the user that reviewed the pull request.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__pull_request_review.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1666812439.562358, "compiled_code": "with pull_request_review as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n body\n \n as \n \n body\n \n, \n \n \n commit_sha\n \n as \n \n commit_sha\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n pull_request_id\n \n as \n \n pull_request_id\n \n, \n \n \n state\n \n as \n \n state\n \n, \n \n \n submitted_at\n \n as \n \n submitted_at\n \n, \n \n \n user_id\n \n as \n \n user_id\n \n\n\n\n\n from pull_request_review\n\n), fields as (\n\n select \n id as pull_request_review_id,\n pull_request_id,\n cast(submitted_at as TIMESTAMP) as submitted_at,\n state,\n user_id\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`"}, "model.github_source.stg_github__repo_team": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_repo_team_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__repo_team_tmp", "model.github_source.stg_github__repo_team_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__repo_team"], "unique_id": "model.github_source.stg_github__repo_team", "raw_code": "{{ config(enabled=var('github__using_repo_team', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_github__repo_team_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__repo_team_tmp')),\n staging_columns=get_repo_team_columns()\n )\n }}\n \n from base\n \n), final as (\n \n select \n repository_id,\n team_id\n from fields\n)\n\nselect * from final", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__repo_team.sql", "original_file_path": "models/stg_github__repo_team.sql", "name": "stg_github__repo_team", "alias": "stg_github__repo_team", "checksum": {"name": "sha256", "checksum": "bbf2296c63f5601191f285d1b9509717c9af73282ef8faae25df101d5c2058ec"}, "tags": [], "refs": [["stg_github__repo_team_tmp"], ["stg_github__repo_team_tmp"]], "sources": [], "metrics": [], "description": "Table representing the mapping relationships between repositories and teams", "columns": {"repository_id": {"name": "repository_id", "description": "Reference to the respective repository for the record.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "team_id": {"name": "team_id", "description": "Reference to the respective team for the record.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__repo_team.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "enabled": true}, "created_at": 1666812439.563639, "compiled_code": "\n\nwith base as (\n\n select * \n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team_tmp`\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n permission\n \n as \n \n permission\n \n, \n \n \n repository_id\n \n as \n \n repository_id\n \n, \n \n \n team_id\n \n as \n \n team_id\n \n\n\n\n \n from base\n \n), final as (\n \n select \n repository_id,\n team_id\n from fields\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team`"}, "model.github_source.stg_github__label": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_label_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__label_tmp", "model.github_source.stg_github__label_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__label"], "unique_id": "model.github_source.stg_github__label", "raw_code": "with issue_label as (\n\n select *\n from {{ ref('stg_github__label_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__label_tmp')),\n staging_columns=get_label_columns()\n )\n }}\n\n from issue_label\n\n), fields as (\n\n select \n id as label_id,\n _fivetran_synced,\t\n color,\n description,\n is_default,\n name as label,\n url\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__label.sql", "original_file_path": "models/stg_github__label.sql", "name": "stg_github__label", "alias": "stg_github__label", "checksum": {"name": "sha256", "checksum": "65919f8309be5eb259a6143e007f38f4ac91c1692d10990206708faa17f086e1"}, "tags": [], "refs": [["stg_github__label_tmp"], ["stg_github__label_tmp"]], "sources": [], "metrics": [], "description": "Table that contains labels that are used across your Github account within individual repositories.", "columns": {"label_id": {"name": "label_id", "description": "Unique identifier of the Github label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of the record being synced by Fivetran", "meta": {}, "data_type": null, "quote": null, "tags": []}, "color": {"name": "color", "description": "The color of the label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "The description of the label indicating the purpose", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_default": {"name": "is_default", "description": "Boolean flagging if the label is default on creation", "meta": {}, "data_type": null, "quote": null, "tags": []}, "label": {"name": "label", "description": "Name of the label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url": {"name": "url", "description": "Url where the label was used", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__label.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1666812439.557178, "compiled_code": "with issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\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 description\n \n as \n \n description\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n is_default\n \n as \n \n is_default\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n url\n \n as \n \n url\n \n\n\n\n\n from issue_label\n\n), fields as (\n\n select \n id as label_id,\n _fivetran_synced,\t\n color,\n description,\n is_default,\n name as label,\n url\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__label`"}, "model.github_source.stg_github__issue": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.github_source.stg_github__issue_tmp", "model.github_source.stg_github__issue_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__issue"], "unique_id": "model.github_source.stg_github__issue", "raw_code": "with issue as (\n\n select *\n from {{ ref('stg_github__issue_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_tmp')),\n staging_columns=get_issue_columns()\n )\n }}\n\n from issue \n\n), fields as (\n\n select \n id as issue_id,\n body,\n cast(closed_at as {{ dbt.type_timestamp() }}) as closed_at,\n cast(created_at as {{ dbt.type_timestamp() }}) as created_at,\n locked as is_locked,\n milestone_id,\n number as issue_number,\n pull_request as is_pull_request,\n repository_id,\n state,\n title,\n cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at,\n user_id\n \n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue.sql", "original_file_path": "models/stg_github__issue.sql", "name": "stg_github__issue", "alias": "stg_github__issue", "checksum": {"name": "sha256", "checksum": "4fa11e7a1ff0785189f14a205478aba55bb62784e05066f421e1723ec12240d0"}, "tags": [], "refs": [["stg_github__issue_tmp"], ["stg_github__issue_tmp"]], "sources": [], "metrics": [], "description": "Table that contains 1 entry for every issue created. Pull Requests also create an entry in this table, and there is a boolean field to determine if an entry is a pull request.", "columns": {"issue_id": {"name": "issue_id", "description": "System generated unique id for the issue. This is not the number that appears in the URL.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "body": {"name": "body", "description": "The text of the main description of the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed_at": {"name": "closed_at", "description": "Timestamp of when the issue was closed, NULL for issues that are open.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_locked": {"name": "is_locked", "description": "Boolean indicating whether the issue is locked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the issue was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "milestone_id": {"name": "milestone_id", "description": "Foreign key that references the milestone table representing the current milestone the issue is in.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_number": {"name": "issue_number", "description": "The issue number within a repository. Is unique by repository, but not across repositories.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_pull_request": {"name": "is_pull_request", "description": "Boolean for is the issue is a pull request (true) ot regular issue (false)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_id": {"name": "repository_id", "description": "Foreign key that references the repository table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the issue is open or closed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "Title of the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the last update was made to the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table, representing the user that created the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1666812439.561398, "compiled_code": "with issue as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n body\n \n as \n \n body\n \n, \n \n \n closed_at\n \n as \n \n closed_at\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 locked\n \n as \n \n locked\n \n, \n \n \n milestone_id\n \n as \n \n milestone_id\n \n, \n \n \n number\n \n as \n \n number\n \n, \n \n \n pull_request\n \n as \n \n pull_request\n \n, \n \n \n repository_id\n \n as \n \n repository_id\n \n, \n \n \n state\n \n as \n \n state\n \n, \n \n \n title\n \n as \n \n title\n \n, \n \n \n updated_at\n \n as \n \n updated_at\n \n, \n \n \n user_id\n \n as \n \n user_id\n \n\n\n\n\n from issue \n\n), fields as (\n\n select \n id as issue_id,\n body,\n cast(closed_at as TIMESTAMP) as closed_at,\n cast(created_at as TIMESTAMP) as created_at,\n locked as is_locked,\n milestone_id,\n number as issue_number,\n pull_request as is_pull_request,\n repository_id,\n state,\n title,\n cast(updated_at as TIMESTAMP) as updated_at,\n user_id\n \n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue`"}, "model.github_source.stg_github__team": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_team_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__team_tmp", "model.github_source.stg_github__team_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__team"], "unique_id": "model.github_source.stg_github__team", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_github__team_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__team_tmp')),\n staging_columns=get_team_columns()\n )\n }}\n \n from base\n \n), final as (\n \n select \n id as team_id,\n description,\n name,\n parent_id,\n privacy,\n slug\n from fields\n)\n\nselect * \nfrom final", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__team.sql", "original_file_path": "models/stg_github__team.sql", "name": "stg_github__team", "alias": "stg_github__team", "checksum": {"name": "sha256", "checksum": "219e47883ec9f076dc1c27b22f72534709edaedd60e8ad9dc1b13db05499f4a4"}, "tags": [], "refs": [["stg_github__team_tmp"], ["stg_github__team_tmp"]], "sources": [], "metrics": [], "description": "Table containing teams and team details", "columns": {"team_id": {"name": "team_id", "description": "System generated unique id for the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "User created description of the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "User created name of the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "Reference to the parent team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "privacy": {"name": "privacy", "description": "Type of privacy permissions associated with the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "slug": {"name": "slug", "description": "Url friendly version of the team name.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__team.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1666812439.566155, "compiled_code": "with base as (\n\n select * \n from `dbt-package-testing`.`github_integration_tests`.`stg_github__team_tmp`\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n description\n \n as \n \n description\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 org_id\n \n as \n \n org_id\n \n, \n \n \n parent_id\n \n as \n \n parent_id\n \n, \n \n \n privacy\n \n as \n \n privacy\n \n, \n \n \n slug\n \n as \n \n slug\n \n\n\n\n \n from base\n \n), final as (\n \n select \n id as team_id,\n description,\n name,\n parent_id,\n privacy,\n slug\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__team`"}, "model.github_source.stg_github__pull_request": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_pull_request_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__pull_request_tmp", "model.github_source.stg_github__pull_request_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__pull_request"], "unique_id": "model.github_source.stg_github__pull_request", "raw_code": "with pull_request as (\n\n select *\n from {{ ref('stg_github__pull_request_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__pull_request_tmp')),\n staging_columns=get_pull_request_columns()\n )\n }}\n\n from pull_request\n\n), fields as (\n\n select \n id as pull_request_id,\n issue_id,\n head_repo_id,\n head_user_id\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__pull_request.sql", "original_file_path": "models/stg_github__pull_request.sql", "name": "stg_github__pull_request", "alias": "stg_github__pull_request", "checksum": {"name": "sha256", "checksum": "c2b1a593030492afcf35407523b636105f42f1cf3fd14f6067e31ba76d70dfe8"}, "tags": [], "refs": [["stg_github__pull_request_tmp"], ["stg_github__pull_request_tmp"]], "sources": [], "metrics": [], "description": "A special type of issue that is created when a user wants to merge one branch of code into another", "columns": {"pull_request_id": {"name": "pull_request_id", "description": "System generated unique id for the pull request.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "head_repo_id": {"name": "head_repo_id", "description": "Foreign key that references the repository table, referencing the current branch.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "head_user_id": {"name": "head_user_id", "description": "Foreign key that references the user table, referencing who created the current branch.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__pull_request.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1666812439.5631201, "compiled_code": "with pull_request as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n base_label\n \n as \n \n base_label\n \n, \n \n \n base_ref\n \n as \n \n base_ref\n \n, \n \n \n base_repo_id\n \n as \n \n base_repo_id\n \n, \n \n \n base_sha\n \n as \n \n base_sha\n \n, \n \n \n base_user_id\n \n as \n \n base_user_id\n \n, \n \n \n head_label\n \n as \n \n head_label\n \n, \n \n \n head_ref\n \n as \n \n head_ref\n \n, \n \n \n head_repo_id\n \n as \n \n head_repo_id\n \n, \n \n \n head_sha\n \n as \n \n head_sha\n \n, \n \n \n head_user_id\n \n as \n \n head_user_id\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n issue_id\n \n as \n \n issue_id\n \n, \n \n \n merge_commit_sha\n \n as \n \n merge_commit_sha\n \n\n\n\n\n from pull_request\n\n), fields as (\n\n select \n id as pull_request_id,\n issue_id,\n head_repo_id,\n head_user_id\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`"}, "model.github_source.stg_github__repository_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.github_integration_tests.github_repository_data"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__repository_tmp"], "unique_id": "model.github_source.stg_github__repository_tmp", "raw_code": "select *\nfrom {{ var('repository') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__repository_tmp.sql", "original_file_path": "models/tmp/stg_github__repository_tmp.sql", "name": "stg_github__repository_tmp", "alias": "stg_github__repository_tmp", "checksum": {"name": "sha256", "checksum": "e090c8cb68dc96c49ee363d95e9bbaf417dd03e2ec675bfdc3d9cefdf889cfc8"}, "tags": [], "refs": [["github_repository_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__repository_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1666812439.450547, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_repository_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__repository_tmp`"}, "model.github_source.stg_github__label_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.github_integration_tests.github_label_data"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__label_tmp"], "unique_id": "model.github_source.stg_github__label_tmp", "raw_code": "select *\nfrom {{ var('label') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__label_tmp.sql", "original_file_path": "models/tmp/stg_github__label_tmp.sql", "name": "stg_github__label_tmp", "alias": "stg_github__label_tmp", "checksum": {"name": "sha256", "checksum": "8e66aceee9e6c677e3b0b105b85de66edea0f4141bef42cd097fd9a236abcf2f"}, "tags": [], "refs": [["github_label_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__label_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1666812439.454255, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_label_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__label_tmp`"}, "model.github_source.stg_github__requested_reviewer_history_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.github_integration_tests.github_requested_reviewer_history_data"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__requested_reviewer_history_tmp"], "unique_id": "model.github_source.stg_github__requested_reviewer_history_tmp", "raw_code": "select *\nfrom {{ var('requested_reviewer_history') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__requested_reviewer_history_tmp.sql", "original_file_path": "models/tmp/stg_github__requested_reviewer_history_tmp.sql", "name": "stg_github__requested_reviewer_history_tmp", "alias": "stg_github__requested_reviewer_history_tmp", "checksum": {"name": "sha256", "checksum": "ed713a77bb2c7407b63c6cc1eb5da22d3267a585bd972dabeb7c86e568180aaf"}, "tags": [], "refs": [["github_requested_reviewer_history_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__requested_reviewer_history_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1666812439.457622, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_requested_reviewer_history_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__requested_reviewer_history_tmp`"}, "model.github_source.stg_github__issue_comment_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.github_integration_tests.github_issue_comment_data"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_comment_tmp"], "unique_id": "model.github_source.stg_github__issue_comment_tmp", "raw_code": "select *\nfrom {{ var('issue_comment') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_comment_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_comment_tmp.sql", "name": "stg_github__issue_comment_tmp", "alias": "stg_github__issue_comment_tmp", "checksum": {"name": "sha256", "checksum": "0954877e30180964df220c97f9b398d775fc74106c25666bf9dd98c5449a72a1"}, "tags": [], "refs": [["github_issue_comment_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_comment_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1666812439.4616761, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_issue_comment_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment_tmp`"}, "model.github_source.stg_github__pull_request_review_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.github_integration_tests.github_pull_request_review_data"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__pull_request_review_tmp"], "unique_id": "model.github_source.stg_github__pull_request_review_tmp", "raw_code": "select *\nfrom {{ var('pull_request_review') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__pull_request_review_tmp.sql", "original_file_path": "models/tmp/stg_github__pull_request_review_tmp.sql", "name": "stg_github__pull_request_review_tmp", "alias": "stg_github__pull_request_review_tmp", "checksum": {"name": "sha256", "checksum": "3419833d93b14d370eb3c9cfb7fda9a373c47a2f9701620425d882b95fbaa55c"}, "tags": [], "refs": [["github_pull_request_review_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__pull_request_review_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1666812439.4647622, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_pull_request_review_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review_tmp`"}, "model.github_source.stg_github__issue_label_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.github_integration_tests.github_issue_label_data"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_label_tmp"], "unique_id": "model.github_source.stg_github__issue_label_tmp", "raw_code": "select *\nfrom {{ var('issue_label') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_label_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_label_tmp.sql", "name": "stg_github__issue_label_tmp", "alias": "stg_github__issue_label_tmp", "checksum": {"name": "sha256", "checksum": "3cd52e662c2bc67a66c9c3e6250e38739362a0b688287d41329d2989297fa201"}, "tags": [], "refs": [["github_issue_label_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_label_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1666812439.467735, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_issue_label_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label_tmp`"}, "model.github_source.stg_github__team_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.github_integration_tests.github_team_data"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__team_tmp"], "unique_id": "model.github_source.stg_github__team_tmp", "raw_code": "select * \nfrom {{ var('team') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__team_tmp.sql", "original_file_path": "models/tmp/stg_github__team_tmp.sql", "name": "stg_github__team_tmp", "alias": "stg_github__team_tmp", "checksum": {"name": "sha256", "checksum": "8c107692c9394962da82e0c2460045e6686d962c1eefe0cff564c618aed7a17d"}, "tags": [], "refs": [["github_team_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__team_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1666812439.4708219, "compiled_code": "select * \nfrom `dbt-package-testing`.`github_integration_tests`.`github_team_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__team_tmp`"}, "model.github_source.stg_github__pull_request_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.github_integration_tests.github_pull_request_data"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__pull_request_tmp"], "unique_id": "model.github_source.stg_github__pull_request_tmp", "raw_code": "select *\nfrom {{ var('pull_request') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__pull_request_tmp.sql", "original_file_path": "models/tmp/stg_github__pull_request_tmp.sql", "name": "stg_github__pull_request_tmp", "alias": "stg_github__pull_request_tmp", "checksum": {"name": "sha256", "checksum": "11df5e7fd7046db485c6654ea88c82c566b71140c4e233f3567bd63bbf1cca19"}, "tags": [], "refs": [["github_pull_request_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__pull_request_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1666812439.473834, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_pull_request_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_tmp`"}, "model.github_source.stg_github__issue_merged_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.github_integration_tests.github_issue_merged_data"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_merged_tmp"], "unique_id": "model.github_source.stg_github__issue_merged_tmp", "raw_code": "select *\nfrom {{ var('issue_merged') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_merged_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_merged_tmp.sql", "name": "stg_github__issue_merged_tmp", "alias": "stg_github__issue_merged_tmp", "checksum": {"name": "sha256", "checksum": "e61fb5297937f494370067232958a443ec21c885a55cca0022f480b463ce90a9"}, "tags": [], "refs": [["github_issue_merged_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_merged_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1666812439.476795, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_issue_merged_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_merged_tmp`"}, "model.github_source.stg_github__user_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.github_integration_tests.github_user_data"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__user_tmp"], "unique_id": "model.github_source.stg_github__user_tmp", "raw_code": "select *\nfrom {{ var('user') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__user_tmp.sql", "original_file_path": "models/tmp/stg_github__user_tmp.sql", "name": "stg_github__user_tmp", "alias": "stg_github__user_tmp", "checksum": {"name": "sha256", "checksum": "e71885bca06f3e1feaef9e729cfb58827c8999bc4d4b7cda538c392c5f56ffdf"}, "tags": [], "refs": [["github_user_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__user_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1666812439.4806578, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_user_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__user_tmp`"}, "model.github_source.stg_github__issue_closed_history_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.github_integration_tests.github_issue_closed_history_data"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_closed_history_tmp"], "unique_id": "model.github_source.stg_github__issue_closed_history_tmp", "raw_code": "select *\nfrom {{ var('issue_closed_history') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_closed_history_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_closed_history_tmp.sql", "name": "stg_github__issue_closed_history_tmp", "alias": "stg_github__issue_closed_history_tmp", "checksum": {"name": "sha256", "checksum": "5ce3eed90261c385c0ddcb0dc9d914a0bf3d3e0f737e4e233af244d29bbf3ce4"}, "tags": [], "refs": [["github_issue_closed_history_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_closed_history_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1666812439.484015, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_issue_closed_history_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history_tmp`"}, "model.github_source.stg_github__issue_assignee_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.github_integration_tests.github_issue_assignee_data"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_assignee_tmp"], "unique_id": "model.github_source.stg_github__issue_assignee_tmp", "raw_code": "select *\nfrom {{ var('issue_assignee') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_assignee_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_assignee_tmp.sql", "name": "stg_github__issue_assignee_tmp", "alias": "stg_github__issue_assignee_tmp", "checksum": {"name": "sha256", "checksum": "4cab39e652c5972bfa16de13454df8e5745610e91b69f3840305e49a9d613753"}, "tags": [], "refs": [["github_issue_assignee_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_assignee_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1666812439.487417, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_issue_assignee_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee_tmp`"}, "model.github_source.stg_github__issue_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.github_integration_tests.github_issue_data"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_tmp"], "unique_id": "model.github_source.stg_github__issue_tmp", "raw_code": "select *\nfrom {{ var('issue') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_tmp.sql", "name": "stg_github__issue_tmp", "alias": "stg_github__issue_tmp", "checksum": {"name": "sha256", "checksum": "4100b13686c42d580a5eeaab15449896ec2ce740b0e5f002775eb9f222ef7c32"}, "tags": [], "refs": [["github_issue_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1666812439.490473, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_issue_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_tmp`"}, "model.github_source.stg_github__repo_team_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.github_integration_tests.github_repo_team_data"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__repo_team_tmp"], "unique_id": "model.github_source.stg_github__repo_team_tmp", "raw_code": "{{ config(enabled=var('github__using_repo_team', True)) }}\n\nselect * \nfrom {{ var('repo_team') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__repo_team_tmp.sql", "original_file_path": "models/tmp/stg_github__repo_team_tmp.sql", "name": "stg_github__repo_team_tmp", "alias": "stg_github__repo_team_tmp", "checksum": {"name": "sha256", "checksum": "25a704d9235d40dc05601995f184779690eabcc6e3a64d3a0489e00c3e6d13ab"}, "tags": [], "refs": [["github_repo_team_data"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__repo_team_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "enabled": true}, "created_at": 1666812439.493454, "compiled_code": "\n\nselect * \nfrom `dbt-package-testing`.`github_integration_tests`.`github_repo_team_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team_tmp`"}, "test.github.unique_github__issues_issue_id.6723b9b1db": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('github__issues')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__issues"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__issues_issue_id"], "unique_id": "test.github.unique_github__issues_issue_id.6723b9b1db", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__issues_issue_id.sql", "original_file_path": "models/github.yml", "name": "unique_github__issues_issue_id", "alias": "unique_github__issues_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__issues"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__issues_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.5233788, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select issue_id as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`github__issues`\n where issue_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.github__issues"}, "test.github.not_null_github__issues_issue_id.fed0631e25": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('github__issues')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__issues"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__issues_issue_id"], "unique_id": "test.github.not_null_github__issues_issue_id.fed0631e25", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__issues_issue_id.sql", "original_file_path": "models/github.yml", "name": "not_null_github__issues_issue_id", "alias": "not_null_github__issues_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__issues"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__issues_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.524467, "compiled_code": "\n \n \n\n\n\nselect issue_id\nfrom `dbt-package-testing`.`github_integration_tests`.`github__issues`\nwhere issue_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.github__issues"}, "test.github.unique_github__pull_requests_issue_id.ce23997907": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('github__pull_requests')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__pull_requests"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__pull_requests_issue_id"], "unique_id": "test.github.unique_github__pull_requests_issue_id.ce23997907", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__pull_requests_issue_id.sql", "original_file_path": "models/github.yml", "name": "unique_github__pull_requests_issue_id", "alias": "unique_github__pull_requests_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__pull_requests"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__pull_requests_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.525402, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select issue_id as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`github__pull_requests`\n where issue_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.github__pull_requests"}, "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('github__pull_requests')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__pull_requests"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__pull_requests_issue_id"], "unique_id": "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__pull_requests_issue_id.sql", "original_file_path": "models/github.yml", "name": "not_null_github__pull_requests_issue_id", "alias": "not_null_github__pull_requests_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__pull_requests"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__pull_requests_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.526331, "compiled_code": "\n \n \n\n\n\nselect issue_id\nfrom `dbt-package-testing`.`github_integration_tests`.`github__pull_requests`\nwhere issue_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.github__pull_requests"}, "test.github.unique_github__daily_metrics_day.f98cab9456": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "day", "model": "{{ get_where_subquery(ref('github__daily_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__daily_metrics_day"], "unique_id": "test.github.unique_github__daily_metrics_day.f98cab9456", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__daily_metrics_day.sql", "original_file_path": "models/github.yml", "name": "unique_github__daily_metrics_day", "alias": "unique_github__daily_metrics_day", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__daily_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__daily_metrics_day.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.52738, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select day as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`github__daily_metrics`\n where day is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "day", "file_key_name": "models.github__daily_metrics"}, "test.github.not_null_github__daily_metrics_day.647e494434": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "day", "model": "{{ get_where_subquery(ref('github__daily_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__daily_metrics_day"], "unique_id": "test.github.not_null_github__daily_metrics_day.647e494434", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__daily_metrics_day.sql", "original_file_path": "models/github.yml", "name": "not_null_github__daily_metrics_day", "alias": "not_null_github__daily_metrics_day", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__daily_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__daily_metrics_day.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.5282838, "compiled_code": "\n \n \n\n\n\nselect day\nfrom `dbt-package-testing`.`github_integration_tests`.`github__daily_metrics`\nwhere day is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "day", "file_key_name": "models.github__daily_metrics"}, "test.github.unique_github__weekly_metrics_week.6794858a8e": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "week", "model": "{{ get_where_subquery(ref('github__weekly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__weekly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__weekly_metrics_week"], "unique_id": "test.github.unique_github__weekly_metrics_week.6794858a8e", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__weekly_metrics_week.sql", "original_file_path": "models/github.yml", "name": "unique_github__weekly_metrics_week", "alias": "unique_github__weekly_metrics_week", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__weekly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__weekly_metrics_week.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.529196, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select week as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`github__weekly_metrics`\n where week is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "week", "file_key_name": "models.github__weekly_metrics"}, "test.github.not_null_github__weekly_metrics_week.4b0b928243": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "week", "model": "{{ get_where_subquery(ref('github__weekly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__weekly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__weekly_metrics_week"], "unique_id": "test.github.not_null_github__weekly_metrics_week.4b0b928243", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__weekly_metrics_week.sql", "original_file_path": "models/github.yml", "name": "not_null_github__weekly_metrics_week", "alias": "not_null_github__weekly_metrics_week", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__weekly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__weekly_metrics_week.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.530111, "compiled_code": "\n \n \n\n\n\nselect week\nfrom `dbt-package-testing`.`github_integration_tests`.`github__weekly_metrics`\nwhere week is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "week", "file_key_name": "models.github__weekly_metrics"}, "test.github.unique_github__monthly_metrics_month.3076284fbb": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "month", "model": "{{ get_where_subquery(ref('github__monthly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__monthly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__monthly_metrics_month"], "unique_id": "test.github.unique_github__monthly_metrics_month.3076284fbb", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__monthly_metrics_month.sql", "original_file_path": "models/github.yml", "name": "unique_github__monthly_metrics_month", "alias": "unique_github__monthly_metrics_month", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__monthly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__monthly_metrics_month.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.531159, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select month as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`github__monthly_metrics`\n where month is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "month", "file_key_name": "models.github__monthly_metrics"}, "test.github.not_null_github__monthly_metrics_month.9e4fba84df": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "month", "model": "{{ get_where_subquery(ref('github__monthly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__monthly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__monthly_metrics_month"], "unique_id": "test.github.not_null_github__monthly_metrics_month.9e4fba84df", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__monthly_metrics_month.sql", "original_file_path": "models/github.yml", "name": "not_null_github__monthly_metrics_month", "alias": "not_null_github__monthly_metrics_month", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__monthly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__monthly_metrics_month.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.532068, "compiled_code": "\n \n \n\n\n\nselect month\nfrom `dbt-package-testing`.`github_integration_tests`.`github__monthly_metrics`\nwhere month is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "month", "file_key_name": "models.github__monthly_metrics"}, "test.github.unique_github__quarterly_metrics_quarter.9165a921c1": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "quarter", "model": "{{ get_where_subquery(ref('github__quarterly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__quarterly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__quarterly_metrics_quarter"], "unique_id": "test.github.unique_github__quarterly_metrics_quarter.9165a921c1", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__quarterly_metrics_quarter.sql", "original_file_path": "models/github.yml", "name": "unique_github__quarterly_metrics_quarter", "alias": "unique_github__quarterly_metrics_quarter", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__quarterly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__quarterly_metrics_quarter.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.533098, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select quarter as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`github__quarterly_metrics`\n where quarter is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "quarter", "file_key_name": "models.github__quarterly_metrics"}, "test.github.not_null_github__quarterly_metrics_quarter.92394d46dc": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "quarter", "model": "{{ get_where_subquery(ref('github__quarterly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__quarterly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__quarterly_metrics_quarter"], "unique_id": "test.github.not_null_github__quarterly_metrics_quarter.92394d46dc", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__quarterly_metrics_quarter.sql", "original_file_path": "models/github.yml", "name": "not_null_github__quarterly_metrics_quarter", "alias": "not_null_github__quarterly_metrics_quarter", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__quarterly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__quarterly_metrics_quarter.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.534125, "compiled_code": "\n \n \n\n\n\nselect quarter\nfrom `dbt-package-testing`.`github_integration_tests`.`github__quarterly_metrics`\nwhere quarter is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "quarter", "file_key_name": "models.github__quarterly_metrics"}, "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["issue_id", "user_id"], "model": "{{ get_where_subquery(ref('stg_github__issue_assignee')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue_assignee"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id"], "unique_id": "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388\") }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388.sql", "original_file_path": "models/stg_github.yml", "name": "dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id", "alias": "dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue_assignee"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388"}, "created_at": 1666812439.5681238, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n issue_id, user_id\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee`\n group by issue_id, user_id\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_github__issue_assignee"}, "test.github_source.not_null_stg_github__label_label_id.9f07379974": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "label_id", "model": "{{ get_where_subquery(ref('stg_github__label')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__label"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__label_label_id"], "unique_id": "test.github_source.not_null_stg_github__label_label_id.9f07379974", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__label_label_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__label_label_id", "alias": "not_null_stg_github__label_label_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__label"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__label_label_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.5751219, "compiled_code": "\n \n \n\n\n\nselect label_id\nfrom `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\nwhere label_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "label_id", "file_key_name": "models.stg_github__label"}, "test.github_source.unique_stg_github__label_label_id.74d3c21466": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "label_id", "model": "{{ get_where_subquery(ref('stg_github__label')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__label"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__label_label_id"], "unique_id": "test.github_source.unique_stg_github__label_label_id.74d3c21466", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__label_label_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__label_label_id", "alias": "unique_stg_github__label_label_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__label"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__label_label_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.576064, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select label_id as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\n where label_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "label_id", "file_key_name": "models.stg_github__label"}, "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["issue_id", "updated_at"], "model": "{{ get_where_subquery(ref('stg_github__issue_closed_history')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue_closed_history"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at"], "unique_id": "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f\") }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f.sql", "original_file_path": "models/stg_github.yml", "name": "dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at", "alias": "dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue_closed_history"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f"}, "created_at": 1666812439.577471, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n issue_id, updated_at\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history`\n group by issue_id, updated_at\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_github__issue_closed_history"}, "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "issue_comment_id", "model": "{{ get_where_subquery(ref('stg_github__issue_comment')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue_comment"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__issue_comment_issue_comment_id"], "unique_id": "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__issue_comment_issue_comment_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__issue_comment_issue_comment_id", "alias": "unique_stg_github__issue_comment_issue_comment_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue_comment"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__issue_comment_issue_comment_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.580319, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select issue_comment_id as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment`\n where issue_comment_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_comment_id", "file_key_name": "models.stg_github__issue_comment"}, "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "issue_comment_id", "model": "{{ get_where_subquery(ref('stg_github__issue_comment')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue_comment"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__issue_comment_issue_comment_id"], "unique_id": "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__issue_comment_issue_comment_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__issue_comment_issue_comment_id", "alias": "not_null_stg_github__issue_comment_issue_comment_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue_comment"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__issue_comment_issue_comment_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.581419, "compiled_code": "\n \n \n\n\n\nselect issue_comment_id\nfrom `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment`\nwhere issue_comment_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_comment_id", "file_key_name": "models.stg_github__issue_comment"}, "test.github_source.unique_stg_github__issue_issue_id.84891aeece": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('stg_github__issue')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__issue_issue_id"], "unique_id": "test.github_source.unique_stg_github__issue_issue_id.84891aeece", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__issue_issue_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__issue_issue_id", "alias": "unique_stg_github__issue_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__issue_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.582388, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select issue_id as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n where issue_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.stg_github__issue"}, "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('stg_github__issue')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__issue_issue_id"], "unique_id": "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__issue_issue_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__issue_issue_id", "alias": "not_null_stg_github__issue_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__issue_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.583352, "compiled_code": "\n \n \n\n\n\nselect issue_id\nfrom `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\nwhere issue_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.stg_github__issue"}, "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "pull_request_review_id", "model": "{{ get_where_subquery(ref('stg_github__pull_request_review')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__pull_request_review"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__pull_request_review_pull_request_review_id"], "unique_id": "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__pull_request_review_pull_request_review_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__pull_request_review_pull_request_review_id", "alias": "unique_stg_github__pull_request_review_pull_request_review_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__pull_request_review"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__pull_request_review_pull_request_review_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.584297, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select pull_request_review_id as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n where pull_request_review_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "pull_request_review_id", "file_key_name": "models.stg_github__pull_request_review"}, "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "pull_request_review_id", "model": "{{ get_where_subquery(ref('stg_github__pull_request_review')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__pull_request_review"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__pull_request_review_pull_request_review_id"], "unique_id": "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__pull_request_review_pull_request_review_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__pull_request_review_pull_request_review_id", "alias": "not_null_stg_github__pull_request_review_pull_request_review_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__pull_request_review"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__pull_request_review_pull_request_review_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.585383, "compiled_code": "\n \n \n\n\n\nselect pull_request_review_id\nfrom `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\nwhere pull_request_review_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "pull_request_review_id", "file_key_name": "models.stg_github__pull_request_review"}, "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "pull_request_id", "model": "{{ get_where_subquery(ref('stg_github__pull_request')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__pull_request"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__pull_request_pull_request_id"], "unique_id": "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__pull_request_pull_request_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__pull_request_pull_request_id", "alias": "unique_stg_github__pull_request_pull_request_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__pull_request"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__pull_request_pull_request_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.586422, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select pull_request_id as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n where pull_request_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "pull_request_id", "file_key_name": "models.stg_github__pull_request"}, "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "pull_request_id", "model": "{{ get_where_subquery(ref('stg_github__pull_request')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__pull_request"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__pull_request_pull_request_id"], "unique_id": "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__pull_request_pull_request_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__pull_request_pull_request_id", "alias": "not_null_stg_github__pull_request_pull_request_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__pull_request"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__pull_request_pull_request_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.5874949, "compiled_code": "\n \n \n\n\n\nselect pull_request_id\nfrom `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\nwhere pull_request_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "pull_request_id", "file_key_name": "models.stg_github__pull_request"}, "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "repository_id", "model": "{{ get_where_subquery(ref('stg_github__repo_team')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__repo_team"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__repo_team_repository_id"], "unique_id": "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__repo_team_repository_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__repo_team_repository_id", "alias": "not_null_stg_github__repo_team_repository_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__repo_team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__repo_team_repository_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.588463, "compiled_code": "\n \n \n\n\n\nselect repository_id\nfrom `dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team`\nwhere repository_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "repository_id", "file_key_name": "models.stg_github__repo_team"}, "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "team_id", "model": "{{ get_where_subquery(ref('stg_github__repo_team')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__repo_team"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__repo_team_team_id"], "unique_id": "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__repo_team_team_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__repo_team_team_id", "alias": "not_null_stg_github__repo_team_team_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__repo_team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__repo_team_team_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.5895329, "compiled_code": "\n \n \n\n\n\nselect team_id\nfrom `dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team`\nwhere team_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "team_id", "file_key_name": "models.stg_github__repo_team"}, "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "repository_id", "model": "{{ get_where_subquery(ref('stg_github__repository')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__repository"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__repository_repository_id"], "unique_id": "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__repository_repository_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__repository_repository_id", "alias": "unique_stg_github__repository_repository_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__repository"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__repository_repository_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.590462, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select repository_id as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repository`\n where repository_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "repository_id", "file_key_name": "models.stg_github__repository"}, "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "repository_id", "model": "{{ get_where_subquery(ref('stg_github__repository')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__repository"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__repository_repository_id"], "unique_id": "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__repository_repository_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__repository_repository_id", "alias": "not_null_stg_github__repository_repository_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__repository"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__repository_repository_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.591392, "compiled_code": "\n \n \n\n\n\nselect repository_id\nfrom `dbt-package-testing`.`github_integration_tests`.`stg_github__repository`\nwhere repository_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "repository_id", "file_key_name": "models.stg_github__repository"}, "test.github_source.unique_stg_github__team_team_id.94e9716ab4": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "team_id", "model": "{{ get_where_subquery(ref('stg_github__team')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__team"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__team_team_id"], "unique_id": "test.github_source.unique_stg_github__team_team_id.94e9716ab4", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__team_team_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__team_team_id", "alias": "unique_stg_github__team_team_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__team_team_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.59231, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select team_id as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__team`\n where team_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "team_id", "file_key_name": "models.stg_github__team"}, "test.github_source.not_null_stg_github__team_team_id.440aefe7a7": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "team_id", "model": "{{ get_where_subquery(ref('stg_github__team')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__team"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__team_team_id"], "unique_id": "test.github_source.not_null_stg_github__team_team_id.440aefe7a7", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__team_team_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__team_team_id", "alias": "not_null_stg_github__team_team_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__team_team_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.593385, "compiled_code": "\n \n \n\n\n\nselect team_id\nfrom `dbt-package-testing`.`github_integration_tests`.`stg_github__team`\nwhere team_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "team_id", "file_key_name": "models.stg_github__team"}, "test.github_source.unique_stg_github__user_user_id.5c1a00cd90": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(ref('stg_github__user')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__user"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__user_user_id"], "unique_id": "test.github_source.unique_stg_github__user_user_id.5c1a00cd90", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__user_user_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__user_user_id", "alias": "unique_stg_github__user_user_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__user"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__user_user_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.5942929, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select user_id as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n where user_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "user_id", "file_key_name": "models.stg_github__user"}, "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(ref('stg_github__user')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__user"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__user_user_id"], "unique_id": "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__user_user_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__user_user_id", "alias": "not_null_stg_github__user_user_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__user"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__user_user_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1666812439.5951948, "compiled_code": "\n \n \n\n\n\nselect user_id\nfrom `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "user_id", "file_key_name": "models.stg_github__user"}}, "sources": {"source.github_source.github.issue_assignee": {"fqn": ["github_source", "github", "issue_assignee"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue_assignee", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue_assignee", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "issue_assignee", "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": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table with the current user(s) assigned to an issue", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`issue_assignee`", "created_at": 1666812439.595996}, "source.github_source.github.label": {"fqn": ["github_source", "github", "label"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.label", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "label", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "label", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Table that contains labels that are used across your Github account within individual repositories.", "columns": {"id": {"name": "id", "description": "Unique identifier of the Github label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of the record being synced by Fivetran", "meta": {}, "data_type": null, "quote": null, "tags": []}, "color": {"name": "color", "description": "The color of the label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "The description of the label indicating the purpose", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_default": {"name": "is_default", "description": "Boolean flagging if the label is default on creation", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "Name of the label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url": {"name": "url", "description": "Url where the label was used", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`label`", "created_at": 1666812439.596092}, "source.github_source.github.issue_closed_history": {"fqn": ["github_source", "github", "issue_closed_history"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue_closed_history", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue_closed_history", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "issue_closed_history", "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": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table to track when an issue is closed or re-opened", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the action took place", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed": {"name": "closed", "description": "Boolean variable for if the issue was closed (true) or re-opened (false)", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`issue_closed_history`", "created_at": 1666812439.59616}, "source.github_source.github.issue_label": {"fqn": ["github_source", "github", "issue_label"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue_label", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue_label", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "issue_label", "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": 168, "period": "hour"}, "filter": null}, "external": null, "description": "The current labels attached to an issue", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "label_id": {"name": "label_id", "description": "Unique identifier of the used label", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`issue_label`", "created_at": 1666812439.596221}, "source.github_source.github.issue_comment": {"fqn": ["github_source", "github", "issue_comment"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue_comment", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue_comment", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "issue_comment", "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": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table that contains comments made on issues", "columns": {"id": {"name": "id", "description": "System generated unique id for the issue comment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`issue_comment`", "created_at": 1666812439.596282}, "source.github_source.github.issue_merged": {"fqn": ["github_source", "github", "issue_merged"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue_merged", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue_merged", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "issue_merged", "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": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table that tracks when an issue (always a pull request) is merged", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table. This table will only reference issues that are pull requests", "meta": {}, "data_type": null, "quote": null, "tags": []}, "merged_at": {"name": "merged_at", "description": "Timestamp of when the code merge took place", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`issue_merged`", "created_at": 1666812439.596344}, "source.github_source.github.issue": {"fqn": ["github_source", "github", "issue"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "issue", "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": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table that contains 1 entry for every issue created. Pull Requests also create an entry in this table, and there is a boolean field to determine if an entry is a pull request.", "columns": {"id": {"name": "id", "description": "System generated unique id for the issue. This is not the number that appears in the URL.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "body": {"name": "body", "description": "The text of the main description of the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "locked": {"name": "locked", "description": "Boolean indicating whether the issue is locked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed_at": {"name": "closed_at", "description": "Timestamp of when the issue was closed, NULL for issues that are open.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the issue was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "milestone_id": {"name": "milestone_id", "description": "Foreign key that references the milestone table representing the current milestone the issue is in.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number": {"name": "number", "description": "The issue number within a repository. Is unique by repository, but not across repositories.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pull_request": {"name": "pull_request", "description": "Boolean for is the issue is a pull request (true) ot regular issue (false)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_id": {"name": "repository_id", "description": "Foreign key that references the repository table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the issue is open or closed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "Title of the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the last update was made to the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table, representing the user that created the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`issue`", "created_at": 1666812439.596417}, "source.github_source.github.pull_request_review": {"fqn": ["github_source", "github", "pull_request_review"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.pull_request_review", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "pull_request_review", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "pull_request_review", "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": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table containing reviews made to pull requests", "columns": {"id": {"name": "id", "description": "System generated unique id for the pull request review.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pull_request_id": {"name": "pull_request_id", "description": "Foreign key that references the pull request table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "submitted_at": {"name": "submitted_at", "description": "Timestamp of when the request for review was submitted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the review was an approval, request for change, comment, dismissal.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table, representing the user that reviewed the pull request.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`pull_request_review`", "created_at": 1666812439.596481}, "source.github_source.github.pull_request": {"fqn": ["github_source", "github", "pull_request"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.pull_request", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "pull_request", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "pull_request", "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": 168, "period": "hour"}, "filter": null}, "external": null, "description": "A special type of issue that is created when a user wants to merge one branch of code into another", "columns": {"id": {"name": "id", "description": "System generated unique id for the pull request.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "head_repo_id": {"name": "head_repo_id", "description": "Foreign key that references the repository table, referencing the current branch.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "head_user_id": {"name": "head_user_id", "description": "Foreign key that references the user table, referencing who created the current branch.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`pull_request`", "created_at": 1666812439.596542}, "source.github_source.github.repo_team": {"fqn": ["github_source", "github", "repo_team"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.repo_team", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "repo_team", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "repo_team", "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": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table representing the mapping relationships between repositories and teams", "columns": {"repository_id": {"name": "repository_id", "description": "Reference to the respective repository for the record.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "team_id": {"name": "team_id", "description": "Reference to the respective team for the record.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {"is_enabled": true}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`repo_team`", "created_at": 1666812439.596601}, "source.github_source.github.repository": {"fqn": ["github_source", "github", "repository"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.repository", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "repository", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "repository", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Table representing the file structure of a directory under git control", "columns": {"id": {"name": "id", "description": "System generated unique id for the repository.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the repository was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "full_name": {"name": "full_name", "description": "The name of the git repository.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "private": {"name": "private", "description": "Boolean field indicating whether the repository is private (true) or public (false).", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`repository`", "created_at": 1666812439.596661}, "source.github_source.github.requested_reviewer_history": {"fqn": ["github_source", "github", "requested_reviewer_history"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.requested_reviewer_history", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "requested_reviewer_history", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "requested_reviewer_history", "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": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table containing when a user requests another user to review a pull request", "columns": {"pull_request_id": {"name": "pull_request_id", "description": "Foreign key that references the pull request table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the review was submitted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "requested_id": {"name": "requested_id", "description": "Foreign key that references the user table, representing the user that was requested to review a PR.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "removed": {"name": "removed", "description": "Boolean variable indicating if the requester was removed from the PR (true) or added to the PR (false).", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`requested_reviewer_history`", "created_at": 1666812439.596725}, "source.github_source.github.team": {"fqn": ["github_source", "github", "team"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.team", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "team", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "team", "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": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table containing teams and team details", "columns": {"id": {"name": "id", "description": "System generated unique id for the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "User created description of the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "User created name of the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "Reference to the parent team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "privacy": {"name": "privacy", "description": "Type of privacy permissions associated with the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "slug": {"name": "slug", "description": "Url friendly version of the team name.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`team`", "created_at": 1666812439.5967948}, "source.github_source.github.user": {"fqn": ["github_source", "github", "user"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.user", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "user", "source_name": "github", "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 representing contributors to a git project", "columns": {"id": {"name": "id", "description": "System generated unique id for the user.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "login": {"name": "login", "description": "The alias the user uses to login to github.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the user", "meta": {}, "data_type": null, "quote": null, "tags": []}, "company": {"name": "company", "description": "The company of the user.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`user`", "created_at": 1666812439.596854}}, "macros": {"macro.dbt_bigquery.date_sharded_table": {"unique_id": "macro.dbt_bigquery.date_sharded_table", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "date_sharded_table", "macro_sql": "{% macro date_sharded_table(base_name) %}\n {{ return(base_name ~ \"[DBT__PARTITION_DATE]\") }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.6762729, "supported_languages": null}, "macro.dbt_bigquery.grant_access_to": {"unique_id": "macro.dbt_bigquery.grant_access_to", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "grant_access_to", "macro_sql": "{% macro grant_access_to(entity, entity_type, role, grant_target_dict) -%}\n {% do adapter.grant_access_to(entity, entity_type, role, grant_target_dict) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.6765199, "supported_languages": null}, "macro.dbt_bigquery.get_partitions_metadata": {"unique_id": "macro.dbt_bigquery.get_partitions_metadata", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "get_partitions_metadata", "macro_sql": "\n\n{%- macro get_partitions_metadata(table) -%}\n {%- if execute -%}\n {%- set res = adapter.get_partitions_metadata(table) -%}\n {{- return(res) -}}\n {%- endif -%}\n {{- return(None) -}}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.676818, "supported_languages": null}, "macro.dbt_bigquery.bigquery__get_catalog": {"unique_id": "macro.dbt_bigquery.bigquery__get_catalog", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "name": "bigquery__get_catalog", "macro_sql": "{% macro bigquery__get_catalog(information_schema, schemas) -%}\n\n {%- if (schemas | length) == 0 -%}\n {# Hopefully nothing cares about the columns we return when there are no rows #}\n {%- set query = \"select 1 as id limit 0\" -%}\n {%- else -%}\n\n {%- set query -%}\n with tables as (\n select\n project_id as table_database,\n dataset_id as table_schema,\n table_id as original_table_name,\n\n concat(project_id, '.', dataset_id, '.', table_id) as relation_id,\n\n row_count,\n size_bytes as size_bytes,\n case\n when type = 1 then 'table'\n when type = 2 then 'view'\n else 'external'\n end as table_type,\n\n REGEXP_CONTAINS(table_id, '^.+[0-9]{8}$') and coalesce(type, 0) = 1 as is_date_shard,\n REGEXP_EXTRACT(table_id, '^(.+)[0-9]{8}$') as shard_base_name,\n REGEXP_EXTRACT(table_id, '^.+([0-9]{8})$') as shard_name\n\n from {{ information_schema.replace(information_schema_view='__TABLES__') }}\n where (\n {%- for schema in schemas -%}\n upper(dataset_id) = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n ),\n\n extracted as (\n\n select *,\n case\n when is_date_shard then shard_base_name\n else original_table_name\n end as table_name\n\n from tables\n\n ),\n\n unsharded_tables as (\n\n select\n table_database,\n table_schema,\n table_name,\n coalesce(table_type, 'external') as table_type,\n is_date_shard,\n\n struct(\n min(shard_name) as shard_min,\n max(shard_name) as shard_max,\n count(*) as shard_count\n ) as table_shards,\n\n sum(size_bytes) as size_bytes,\n sum(row_count) as row_count,\n\n max(relation_id) as relation_id\n\n from extracted\n group by 1,2,3,4,5\n\n ),\n\n info_schema_columns as (\n\n select\n concat(table_catalog, '.', table_schema, '.', table_name) as relation_id,\n table_catalog as table_database,\n table_schema,\n table_name,\n\n -- use the \"real\" column name from the paths query below\n column_name as base_column_name,\n ordinal_position as column_index,\n\n is_partitioning_column,\n clustering_ordinal_position\n\n from {{ information_schema.replace(information_schema_view='COLUMNS') }}\n where ordinal_position is not null\n\n ),\n\n info_schema_column_paths as (\n\n select\n concat(table_catalog, '.', table_schema, '.', table_name) as relation_id,\n field_path as column_name,\n data_type as column_type,\n column_name as base_column_name,\n description as column_comment\n\n from {{ information_schema.replace(information_schema_view='COLUMN_FIELD_PATHS') }}\n\n ),\n\n columns as (\n\n select * except (base_column_name)\n from info_schema_columns\n join info_schema_column_paths using (relation_id, base_column_name)\n\n ),\n\n column_stats as (\n\n select\n table_database,\n table_schema,\n table_name,\n max(relation_id) as relation_id,\n max(case when is_partitioning_column = 'YES' then 1 else 0 end) = 1 as is_partitioned,\n max(case when is_partitioning_column = 'YES' then column_name else null end) as partition_column,\n max(case when clustering_ordinal_position is not null then 1 else 0 end) = 1 as is_clustered,\n array_to_string(\n array_agg(\n case\n when clustering_ordinal_position is not null then column_name\n else null\n end ignore nulls\n order by clustering_ordinal_position\n ), ', '\n ) as clustering_columns\n\n from columns\n group by 1,2,3\n\n )\n\n select\n unsharded_tables.table_database,\n unsharded_tables.table_schema,\n case\n when is_date_shard then concat(unsharded_tables.table_name, '*')\n else unsharded_tables.table_name\n end as table_name,\n unsharded_tables.table_type,\n\n -- coalesce name and type for External tables - these columns are not\n -- present in the COLUMN_FIELD_PATHS resultset\n coalesce(columns.column_name, '') as column_name,\n -- invent a row number to account for nested fields -- BQ does\n -- not treat these nested properties as independent fields\n row_number() over (\n partition by relation_id\n order by columns.column_index, columns.column_name\n ) as column_index,\n coalesce(columns.column_type, '') as column_type,\n columns.column_comment,\n\n 'Shard count' as `stats__date_shards__label`,\n table_shards.shard_count as `stats__date_shards__value`,\n 'The number of date shards in this table' as `stats__date_shards__description`,\n is_date_shard as `stats__date_shards__include`,\n\n 'Shard (min)' as `stats__date_shard_min__label`,\n table_shards.shard_min as `stats__date_shard_min__value`,\n 'The first date shard in this table' as `stats__date_shard_min__description`,\n is_date_shard as `stats__date_shard_min__include`,\n\n 'Shard (max)' as `stats__date_shard_max__label`,\n table_shards.shard_max as `stats__date_shard_max__value`,\n 'The last date shard in this table' as `stats__date_shard_max__description`,\n is_date_shard as `stats__date_shard_max__include`,\n\n '# Rows' as `stats__num_rows__label`,\n row_count as `stats__num_rows__value`,\n 'Approximate count of rows in this table' as `stats__num_rows__description`,\n (unsharded_tables.table_type = 'table') as `stats__num_rows__include`,\n\n 'Approximate Size' as `stats__num_bytes__label`,\n size_bytes as `stats__num_bytes__value`,\n 'Approximate size of table as reported by BigQuery' as `stats__num_bytes__description`,\n (unsharded_tables.table_type = 'table') as `stats__num_bytes__include`,\n\n 'Partitioned By' as `stats__partitioning_type__label`,\n partition_column as `stats__partitioning_type__value`,\n 'The partitioning column for this table' as `stats__partitioning_type__description`,\n is_partitioned as `stats__partitioning_type__include`,\n\n 'Clustered By' as `stats__clustering_fields__label`,\n clustering_columns as `stats__clustering_fields__value`,\n 'The clustering columns for this table' as `stats__clustering_fields__description`,\n is_clustered as `stats__clustering_fields__include`\n\n -- join using relation_id (an actual relation, not a shard prefix) to make\n -- sure that column metadata is picked up through the join. This will only\n -- return the column information for the \"max\" table in a date-sharded table set\n from unsharded_tables\n left join columns using (relation_id)\n left join column_stats using (relation_id)\n {%- endset -%}\n\n {%- endif -%}\n\n {{ return(run_query(query)) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.6802409, "supported_languages": null}, "macro.dbt_bigquery.partition_by": {"unique_id": "macro.dbt_bigquery.partition_by", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "partition_by", "macro_sql": "{% macro partition_by(partition_config) -%}\n {%- if partition_config is none -%}\n {% do return('') %}\n {%- elif partition_config.data_type | lower in ('date','timestamp','datetime') -%}\n partition by {{ partition_config.render() }}\n {%- elif partition_config.data_type | lower in ('int64') -%}\n {%- set range = partition_config.range -%}\n partition by range_bucket(\n {{ partition_config.field }},\n generate_array({{ range.start}}, {{ range.end }}, {{ range.interval }})\n )\n {%- endif -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.684181, "supported_languages": null}, "macro.dbt_bigquery.cluster_by": {"unique_id": "macro.dbt_bigquery.cluster_by", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "cluster_by", "macro_sql": "{% macro cluster_by(raw_cluster_by) %}\n {%- if raw_cluster_by is not none -%}\n cluster by {% if raw_cluster_by is string -%}\n {% set raw_cluster_by = [raw_cluster_by] %}\n {%- endif -%}\n {%- for cluster in raw_cluster_by -%}\n {{ cluster }}\n {%- if not loop.last -%}, {% endif -%}\n {%- endfor -%}\n\n {% endif %}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.684744, "supported_languages": null}, "macro.dbt_bigquery.bigquery_options": {"unique_id": "macro.dbt_bigquery.bigquery_options", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_options", "macro_sql": "{% macro bigquery_options(opts) %}\n {% set options -%}\n OPTIONS({% for opt_key, opt_val in opts.items() %}\n {{ opt_key }}={{ opt_val }}{{ \",\" if not loop.last }}\n {% endfor %})\n {%- endset %}\n {%- do return(options) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.685181, "supported_languages": null}, "macro.dbt_bigquery.bigquery_table_options": {"unique_id": "macro.dbt_bigquery.bigquery_table_options", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_table_options", "macro_sql": "{% macro bigquery_table_options(config, node, temporary) %}\n {% set opts = adapter.get_table_options(config, node, temporary) %}\n {%- do return(bigquery_options(opts)) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.6854558, "supported_languages": null}, "macro.dbt_bigquery.bigquery__create_table_as": {"unique_id": "macro.dbt_bigquery.bigquery__create_table_as", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_table_as", "macro_sql": "{% macro bigquery__create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {%- if language == '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 {{ compiled_code }}\n );\n {%- elif language == 'python' -%}\n {#--\n N.B. Python models _can_ write to temp views HOWEVER they use a different session\n and have already expired by the time they need to be used (I.E. in merges for incremental models)\n\n TODO: Deep dive into spark sessions to see if we can reuse a single session for an entire\n dbt invocation.\n --#}\n {{ py_write_table(compiled_code=compiled_code, target_relation=relation.quote(database=False, schema=False, identifier=False)) }}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"bigquery__create_table_as macro didn't get supported language, it got %s\" % language) %}\n {%- endif -%}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.partition_by", "macro.dbt_bigquery.cluster_by", "macro.dbt_bigquery.bigquery_table_options", "macro.dbt_bigquery.py_write_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.686474, "supported_languages": null}, "macro.dbt_bigquery.bigquery_view_options": {"unique_id": "macro.dbt_bigquery.bigquery_view_options", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_view_options", "macro_sql": "{% macro bigquery_view_options(config, node) %}\n {% set opts = adapter.get_view_options(config, node) %}\n {%- do return(bigquery_options(opts)) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.686722, "supported_languages": null}, "macro.dbt_bigquery.bigquery__create_view_as": {"unique_id": "macro.dbt_bigquery.bigquery__create_view_as", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_view_as", "macro_sql": "{% macro bigquery__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create or replace view {{ relation }}\n {{ bigquery_view_options(config, model) }}\n as {{ sql }};\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_view_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.6870332, "supported_languages": null}, "macro.dbt_bigquery.bigquery__drop_schema": {"unique_id": "macro.dbt_bigquery.bigquery__drop_schema", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__drop_schema", "macro_sql": "{% macro bigquery__drop_schema(relation) -%}\n {{ adapter.drop_schema(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.68716, "supported_languages": null}, "macro.dbt_bigquery.bigquery__drop_relation": {"unique_id": "macro.dbt_bigquery.bigquery__drop_relation", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__drop_relation", "macro_sql": "{% macro bigquery__drop_relation(relation) -%}\n {% call statement('drop_relation') -%}\n drop {{ relation.type }} if exists {{ relation }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.687344, "supported_languages": null}, "macro.dbt_bigquery.bigquery__get_columns_in_relation": {"unique_id": "macro.dbt_bigquery.bigquery__get_columns_in_relation", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__get_columns_in_relation", "macro_sql": "{% macro bigquery__get_columns_in_relation(relation) -%}\n {{ return(adapter.get_columns_in_relation(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.687489, "supported_languages": null}, "macro.dbt_bigquery.bigquery__list_relations_without_caching": {"unique_id": "macro.dbt_bigquery.bigquery__list_relations_without_caching", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__list_relations_without_caching", "macro_sql": "{% macro bigquery__list_relations_without_caching(schema_relation) -%}\n {{ return(adapter.list_relations_without_caching(schema_relation)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.687644, "supported_languages": null}, "macro.dbt_bigquery.bigquery__list_schemas": {"unique_id": "macro.dbt_bigquery.bigquery__list_schemas", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__list_schemas", "macro_sql": "{% macro bigquery__list_schemas(database) -%}\n {{ return(adapter.list_schemas(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.6877902, "supported_languages": null}, "macro.dbt_bigquery.bigquery__check_schema_exists": {"unique_id": "macro.dbt_bigquery.bigquery__check_schema_exists", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__check_schema_exists", "macro_sql": "{% macro bigquery__check_schema_exists(information_schema, schema) %}\n {{ return(adapter.check_schema_exists(information_schema.database, schema)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.687965, "supported_languages": null}, "macro.dbt_bigquery.bigquery__persist_docs": {"unique_id": "macro.dbt_bigquery.bigquery__persist_docs", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__persist_docs", "macro_sql": "{% macro bigquery__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do alter_column_comment(relation, model.columns) %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.688352, "supported_languages": null}, "macro.dbt_bigquery.bigquery__alter_column_comment": {"unique_id": "macro.dbt_bigquery.bigquery__alter_column_comment", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_column_comment", "macro_sql": "{% macro bigquery__alter_column_comment(relation, column_dict) -%}\n {% do adapter.update_columns(relation, column_dict) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.688504, "supported_languages": null}, "macro.dbt_bigquery.bigquery__rename_relation": {"unique_id": "macro.dbt_bigquery.bigquery__rename_relation", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__rename_relation", "macro_sql": "{% macro bigquery__rename_relation(from_relation, to_relation) -%}\n {% do adapter.rename_relation(from_relation, to_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.68865, "supported_languages": null}, "macro.dbt_bigquery.bigquery__alter_relation_add_columns": {"unique_id": "macro.dbt_bigquery.bigquery__alter_relation_add_columns", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_relation_add_columns", "macro_sql": "{% macro bigquery__alter_relation_add_columns(relation, add_columns) %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation }}\n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {{ return(run_query(sql)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.689025, "supported_languages": null}, "macro.dbt_bigquery.bigquery__alter_relation_drop_columns": {"unique_id": "macro.dbt_bigquery.bigquery__alter_relation_drop_columns", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_relation_drop_columns", "macro_sql": "{% macro bigquery__alter_relation_drop_columns(relation, drop_columns) %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation }}\n\n {% for column in drop_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {{ return(run_query(sql)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.689394, "supported_languages": null}, "macro.dbt_bigquery.bigquery__alter_column_type": {"unique_id": "macro.dbt_bigquery.bigquery__alter_column_type", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_column_type", "macro_sql": "{% macro bigquery__alter_column_type(relation, column_name, new_column_type) -%}\n {#-- Changing a column's data type using a query requires you to scan the entire table.\n The query charges can be significant if the table is very large.\n\n https://cloud.google.com/bigquery/docs/manually-changing-schemas#changing_a_columns_data_type\n #}\n {% set relation_columns = get_columns_in_relation(relation) %}\n\n {% set sql %}\n select\n {%- for col in relation_columns -%}\n {% if col.column == column_name %}\n CAST({{ col.quoted }} AS {{ new_column_type }}) AS {{ col.quoted }}\n {%- else %}\n {{ col.quoted }}\n {%- endif %}\n {%- if not loop.last %},{% endif -%}\n {%- endfor %}\n from {{ relation }}\n {% endset %}\n\n {% call statement('alter_column_type') %}\n {{ create_table_as(False, relation, sql)}}\n {%- endcall %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_columns_in_relation", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.6900349, "supported_languages": null}, "macro.dbt_bigquery.bigquery__test_unique": {"unique_id": "macro.dbt_bigquery.bigquery__test_unique", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__test_unique", "macro_sql": "{% macro bigquery__test_unique(model, column_name) %}\n\nwith dbt_test__target as (\n\n select {{ column_name }} as unique_field\n from {{ model }}\n where {{ column_name }} is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.69021, "supported_languages": null}, "macro.dbt_bigquery.bigquery__upload_file": {"unique_id": "macro.dbt_bigquery.bigquery__upload_file", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__upload_file", "macro_sql": "{% macro bigquery__upload_file(local_file_path, database, table_schema, table_name) %}\n\n {{ log(\"kwargs: \" ~ kwargs) }}\n\n {% do adapter.upload_file(local_file_path, database, table_schema, table_name, kwargs=kwargs) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.690479, "supported_languages": null}, "macro.dbt_bigquery.bigquery__create_csv_table": {"unique_id": "macro.dbt_bigquery.bigquery__create_csv_table", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__create_csv_table", "macro_sql": "{% macro bigquery__create_csv_table(model, agate_table) %}\n -- no-op\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.6909702, "supported_languages": null}, "macro.dbt_bigquery.bigquery__reset_csv_table": {"unique_id": "macro.dbt_bigquery.bigquery__reset_csv_table", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__reset_csv_table", "macro_sql": "{% macro bigquery__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.691125, "supported_languages": null}, "macro.dbt_bigquery.bigquery__load_csv_rows": {"unique_id": "macro.dbt_bigquery.bigquery__load_csv_rows", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__load_csv_rows", "macro_sql": "{% macro bigquery__load_csv_rows(model, agate_table) %}\n\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {{ adapter.load_dataframe(model['database'], model['schema'], model['alias'],\n \t\t\t\t\t\t\tagate_table, column_override) }}\n {% if config.persist_relation_docs() and 'description' in model %}\n\n \t{{ adapter.update_table_description(model['database'], model['schema'], model['alias'], model['description']) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.691707, "supported_languages": null}, "macro.dbt_bigquery.bigquery__handle_existing_table": {"unique_id": "macro.dbt_bigquery.bigquery__handle_existing_table", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/view.sql", "original_file_path": "macros/materializations/view.sql", "name": "bigquery__handle_existing_table", "macro_sql": "{% macro bigquery__handle_existing_table(full_refresh, old_relation) %}\n {%- if full_refresh -%}\n {{ adapter.drop_relation(old_relation) }}\n {%- else -%}\n {{ exceptions.relation_wrong_type(old_relation, 'view') }}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.692307, "supported_languages": null}, "macro.dbt_bigquery.materialization_view_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_view_bigquery", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/view.sql", "original_file_path": "macros/materializations/view.sql", "name": "materialization_view_bigquery", "macro_sql": "{% materialization view, adapter='bigquery' -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {% set to_return = create_or_replace_view() %}\n\n {% set target_relation = this.incorporate(type='view') %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if config.get('grant_access_to') %}\n {% for grant_target_dict in config.get('grant_access_to') %}\n {% do adapter.grant_access_to(this, 'view', None, grant_target_dict) %}\n {% endfor %}\n {% endif %}\n\n {% do return(to_return) %}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_or_replace_view", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.6929522, "supported_languages": ["sql"]}, "macro.dbt_bigquery.materialization_table_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_table_bigquery", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "name": "materialization_table_bigquery", "macro_sql": "{% materialization table, adapter='bigquery', supported_languages=['sql', 'python']-%}\n\n {%- set language = model['language'] -%}\n {%- set identifier = model['alias'] -%}\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_not_as_table = (old_relation is not none and not old_relation.is_table) -%}\n {%- set target_relation = api.Relation.create(database=database, schema=schema, identifier=identifier, type='table') -%}\n\n -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\n\n {{ run_hooks(pre_hooks) }}\n\n {#\n We only need to drop this thing if it is not a table.\n If it _is_ already a table, then we can overwrite it without downtime\n Unlike table -> view, no need for `--full-refresh`: dropping a view is no big deal\n #}\n {%- if exists_not_as_table -%}\n {{ adapter.drop_relation(old_relation) }}\n {%- endif -%}\n\n -- build model\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set partition_by = adapter.parse_partition_by(raw_partition_by) -%}\n {%- set cluster_by = config.get('cluster_by', none) -%}\n {% if not adapter.is_replaceable(old_relation, partition_by, cluster_by) %}\n {% do log(\"Hard refreshing \" ~ old_relation ~ \" because it is not replaceable\") %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n\n -- build model\n {%- call statement('main', language=language) -%}\n {{ create_table_as(False, target_relation, compiled_code, language) }}\n {%- endcall -%}\n\n {{ run_hooks(post_hooks) }}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.696316, "supported_languages": ["sql", "python"]}, "macro.dbt_bigquery.py_write_table": {"unique_id": "macro.dbt_bigquery.py_write_table", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "name": "py_write_table", "macro_sql": "{% macro py_write_table(compiled_code, target_relation) %}\nfrom pyspark.sql import SparkSession\n\nspark = SparkSession.builder.appName('smallTest').getOrCreate()\n\nspark.conf.set(\"viewsEnabled\",\"true\")\nspark.conf.set(\"temporaryGcsBucket\",\"{{target.gcs_bucket}}\")\n\n{{ compiled_code }}\ndbt = dbtObj(spark.read.format(\"bigquery\").load)\ndf = model(dbt, spark)\n\n# COMMAND ----------\n# this is materialization code dbt generated, please do not modify\n\nimport pyspark\n# make sure pandas exists before using it\ntry:\n import pandas\n pandas_available = True\nexcept ImportError:\n pandas_available = False\n\n# make sure pyspark.pandas exists before using it\ntry:\n import pyspark.pandas\n pyspark_pandas_api_available = True\nexcept ImportError:\n pyspark_pandas_api_available = False\n\n# make sure databricks.koalas exists before using it\ntry:\n import databricks.koalas\n koalas_available = True\nexcept ImportError:\n koalas_available = False\n\n# preferentially convert pandas DataFrames to pandas-on-Spark or Koalas DataFrames first\n# since they know how to convert pandas DataFrames better than `spark.createDataFrame(df)`\n# and converting from pandas-on-Spark to Spark DataFrame has no overhead\nif pyspark_pandas_api_available and pandas_available and isinstance(df, pandas.core.frame.DataFrame):\n df = pyspark.pandas.frame.DataFrame(df)\nelif koalas_available and pandas_available and isinstance(df, pandas.core.frame.DataFrame):\n df = databricks.koalas.frame.DataFrame(df)\n\n# convert to pyspark.sql.dataframe.DataFrame\nif isinstance(df, pyspark.sql.dataframe.DataFrame):\n pass # since it is already a Spark DataFrame\nelif pyspark_pandas_api_available and isinstance(df, pyspark.pandas.frame.DataFrame):\n df = df.to_spark()\nelif koalas_available and isinstance(df, databricks.koalas.frame.DataFrame):\n df = df.to_spark()\nelif pandas_available and isinstance(df, pandas.core.frame.DataFrame):\n df = spark.createDataFrame(df)\nelse:\n msg = f\"{type(df)} is not a supported type for dbt Python materialization\"\n raise Exception(msg)\n\ndf.write \\\n .mode(\"overwrite\") \\\n .format(\"bigquery\") \\\n .option(\"writeMethod\", \"direct\").option(\"writeDisposition\", 'WRITE_TRUNCATE') \\\n .save(\"{{target_relation}}\")\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.696722, "supported_languages": null}, "macro.dbt_bigquery.materialization_copy_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_copy_bigquery", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/copy.sql", "original_file_path": "macros/materializations/copy.sql", "name": "materialization_copy_bigquery", "macro_sql": "{% materialization copy, adapter='bigquery' -%}\n\n {# Setup #}\n {{ run_hooks(pre_hooks) }}\n\n {% set destination = this.incorporate(type='table') %}\n\n {# there can be several ref() or source() according to BQ copy API docs #}\n {# cycle over ref() and source() to create source tables array #}\n {% set source_array = [] %}\n {% for ref_table in model.refs %}\n {{ source_array.append(ref(*ref_table)) }}\n {% endfor %}\n\n {% for src_table in model.sources %}\n {{ source_array.append(source(*src_table)) }}\n {% endfor %}\n\n {# Call adapter copy_table function #}\n {%- set result_str = adapter.copy_table(\n source_array,\n destination,\n config.get('copy_materialization', default = 'table')) -%}\n\n {{ store_result('main', response=result_str) }}\n\n {# Clean up #}\n {{ run_hooks(post_hooks) }}\n {%- do apply_grants(target_relation, grant_config) -%}\n {{ adapter.commit() }}\n\n {{ return({'relations': [destination]}) }}\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.698048, "supported_languages": ["sql"]}, "macro.dbt_bigquery.declare_dbt_max_partition": {"unique_id": "macro.dbt_bigquery.declare_dbt_max_partition", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "declare_dbt_max_partition", "macro_sql": "{% macro declare_dbt_max_partition(relation, partition_by, complied_code, language='sql') %}\n\n {#-- TODO: revisit partitioning with python models --#}\n {%- if '_dbt_max_partition' in complied_code and language == 'sql' -%}\n\n declare _dbt_max_partition {{ partition_by.data_type }} default (\n select max({{ partition_by.field }}) from {{ this }}\n where {{ partition_by.field }} is not null\n );\n\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.700427, "supported_languages": null}, "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy": {"unique_id": "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "dbt_bigquery_validate_get_incremental_strategy", "macro_sql": "{% macro dbt_bigquery_validate_get_incremental_strategy(config) %}\n {#-- Find and validate the incremental strategy #}\n {%- set strategy = config.get(\"incremental_strategy\") or '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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.700916, "supported_languages": null}, "macro.dbt_bigquery.bq_insert_overwrite": {"unique_id": "macro.dbt_bigquery.bq_insert_overwrite", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "bq_insert_overwrite", "macro_sql": "{% macro bq_insert_overwrite(\n tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n) %}\n\n {% if partitions is not none and partitions != [] %} {# static #}\n\n {% set predicate -%}\n {{ partition_by.render(alias='DBT_INTERNAL_DEST') }} in (\n {{ partitions | join (', ') }}\n )\n {%- endset %}\n\n {%- set source_sql -%}\n (\n {{sql}}\n )\n {%- endset -%}\n\n {#-- Because we're putting the model SQL _directly_ into the MERGE statement,\n we need to prepend the MERGE statement with the user-configured sql_header,\n which may be needed to resolve that model SQL (e.g. referencing a variable or UDF in the header)\n in the \"dynamic\" case, we save the model SQL result as a temp table first, wherein the\n sql_header is included by the create_table_as macro.\n #}\n {{ get_insert_overwrite_merge_sql(target_relation, source_sql, dest_columns, [predicate], include_sql_header=true) }}\n\n {% else %} {# dynamic #}\n\n {% set predicate -%}\n {{ partition_by.render(alias='DBT_INTERNAL_DEST') }} in unnest(dbt_partitions_for_replacement)\n {%- endset %}\n\n {%- set source_sql -%}\n (\n select * from {{ tmp_relation }}\n )\n {%- endset -%}\n\n -- generated script to merge partitions into {{ target_relation }}\n declare dbt_partitions_for_replacement array<{{ partition_by.data_type }}>;\n\n {# have we already created the temp table to check for schema changes? #}\n {% if not tmp_relation_exists %}\n {{ declare_dbt_max_partition(this, partition_by, sql) }}\n\n -- 1. create a temp table\n {{ create_table_as(True, tmp_relation, compiled_code) }}\n {% else %}\n -- 1. temp table already exists, we used it to check for schema changes\n {% endif %}\n\n -- 2. define partitions to update\n set (dbt_partitions_for_replacement) = (\n select as struct\n array_agg(distinct {{ partition_by.render() }})\n from {{ tmp_relation }}\n );\n\n -- 3. run the merge statement\n {{ get_insert_overwrite_merge_sql(target_relation, source_sql, dest_columns, [predicate]) }};\n\n -- 4. clean up the temp table\n drop table if exists {{ tmp_relation }}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql", "macro.dbt_bigquery.declare_dbt_max_partition", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.702147, "supported_languages": null}, "macro.dbt_bigquery.bq_generate_incremental_build_sql": {"unique_id": "macro.dbt_bigquery.bq_generate_incremental_build_sql", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "bq_generate_incremental_build_sql", "macro_sql": "{% macro bq_generate_incremental_build_sql(\n strategy, tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n) %}\n {#-- if partitioned, use BQ scripting to get the range of partition values to be updated --#}\n {% if strategy == 'insert_overwrite' %}\n\n {% set missing_partition_msg -%}\n The 'insert_overwrite' strategy requires the `partition_by` config.\n {%- endset %}\n {% if partition_by is none %}\n {% do exceptions.raise_compiler_error(missing_partition_msg) %}\n {% endif %}\n\n {% set build_sql = bq_insert_overwrite(\n tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n ) %}\n\n {% else %} {# strategy == 'merge' #}\n {%- set source_sql -%}\n {%- if tmp_relation_exists -%}\n (\n select * from {{ tmp_relation }}\n )\n {%- else -%} {#-- wrap sql in parens to make it a subquery --#}\n (\n {{sql}}\n )\n {%- endif -%}\n {%- endset -%}\n\n {% set build_sql = get_merge_sql(target_relation, source_sql, unique_key, dest_columns) %}\n\n {% endif %}\n\n {{ return(build_sql) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bq_insert_overwrite", "macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7029812, "supported_languages": null}, "macro.dbt_bigquery.materialization_incremental_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_incremental_bigquery", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "materialization_incremental_bigquery", "macro_sql": "{% materialization incremental, adapter='bigquery', supported_languages=['sql', 'python'] -%}\n\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n {%- set language = model['language'] %}\n\n {%- set target_relation = this %}\n {%- set existing_relation = load_relation(this) %}\n {%- set tmp_relation = make_temp_relation(this) %}\n\n {#-- Validate early so we don't run SQL if the strategy is invalid --#}\n {% set strategy = dbt_bigquery_validate_get_incremental_strategy(config) -%}\n\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set partition_by = adapter.parse_partition_by(raw_partition_by) -%}\n {%- set partitions = config.get('partitions', none) -%}\n {%- set cluster_by = config.get('cluster_by', none) -%}\n\n {% set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') %}\n\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n {% if existing_relation is none %}\n {%- call statement('main', language=language) -%}\n {{ create_table_as(False, target_relation, compiled_code, language) }}\n {%- endcall -%}\n\n {% elif existing_relation.is_view %}\n {#-- There's no way to atomically replace a view with a table on BQ --#}\n {{ adapter.drop_relation(existing_relation) }}\n {%- call statement('main', language=language) -%}\n {{ create_table_as(False, target_relation, compiled_code, language) }}\n {%- endcall -%}\n\n {% elif full_refresh_mode %}\n {#-- If the partition/cluster config has changed, then we must drop and recreate --#}\n {% if not adapter.is_replaceable(existing_relation, partition_by, cluster_by) %}\n {% do log(\"Hard refreshing \" ~ existing_relation ~ \" because it is not replaceable\") %}\n {{ adapter.drop_relation(existing_relation) }}\n {% endif %}\n {%- call statement('main', language=language) -%}\n {{ create_table_as(False, target_relation, compiled_code, language) }}\n {%- endcall -%}\n\n {% else %}\n {%- if language == 'python' and strategy == 'insert_overwrite' -%}\n {#-- This lets us move forward assuming no python will be directly templated into a query --#}\n {%- set python_unsupported_msg -%}\n The 'insert_overwrite' strategy is not yet supported for python models.\n {%- endset %}\n {% do exceptions.raise_compiler_error(python_unsupported_msg) %}\n {%- endif -%}\n\n {% set tmp_relation_exists = false %}\n {% if on_schema_change != 'ignore' or language == 'python' %}\n {#-- Check first, since otherwise we may not build a temp table --#}\n {#-- Python always needs to create a temp table --#}\n {%- call statement('create_tmp_relation', language=language) -%}\n {{ declare_dbt_max_partition(this, partition_by, compiled_code, language) +\n create_table_as(True, tmp_relation, compiled_code, language)\n }}\n {%- endcall -%}\n {% set tmp_relation_exists = true %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, tmp_relation, existing_relation) %}\n {% endif %}\n\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n {% set build_sql = bq_generate_incremental_build_sql(\n strategy, tmp_relation, target_relation, compiled_code, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n ) %}\n\n {%- call statement('main') -%}\n {{ build_sql }}\n {% endcall %}\n\n {%- if language == 'python' and tmp_relation -%}\n {{ adapter.drop_relation(tmp_relation) }}\n {%- endif -%}\n\n {% endif %}\n\n {{ run_hooks(post_hooks) }}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.load_relation", "macro.dbt.make_temp_relation", "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt_bigquery.declare_dbt_max_partition", "macro.dbt.process_schema_changes", "macro.dbt_bigquery.bq_generate_incremental_build_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.70636, "supported_languages": ["sql", "python"]}, "macro.dbt_bigquery.bigquery__snapshot_hash_arguments": {"unique_id": "macro.dbt_bigquery.bigquery__snapshot_hash_arguments", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__snapshot_hash_arguments", "macro_sql": "{% macro bigquery__snapshot_hash_arguments(args) -%}\n to_hex(md5(concat({%- for arg in args -%}\n coalesce(cast({{ arg }} as string), ''){% if not loop.last %}, '|',{% endif -%}\n {%- endfor -%}\n )))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.70694, "supported_languages": null}, "macro.dbt_bigquery.bigquery__create_columns": {"unique_id": "macro.dbt_bigquery.bigquery__create_columns", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__create_columns", "macro_sql": "{% macro bigquery__create_columns(relation, columns) %}\n {{ adapter.alter_table_add_columns(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.707094, "supported_languages": null}, "macro.dbt_bigquery.bigquery__post_snapshot": {"unique_id": "macro.dbt_bigquery.bigquery__post_snapshot", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__post_snapshot", "macro_sql": "{% macro bigquery__post_snapshot(staging_relation) %}\n -- Clean up the snapshot temp table\n {% do drop_relation(staging_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.707221, "supported_languages": null}, "macro.dbt_bigquery.bigquery__except": {"unique_id": "macro.dbt_bigquery.bigquery__except", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "name": "bigquery__except", "macro_sql": "{% macro bigquery__except() %}\n\n except distinct\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7073889, "supported_languages": null}, "macro.dbt_bigquery.bigquery__dateadd": {"unique_id": "macro.dbt_bigquery.bigquery__dateadd", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "name": "bigquery__dateadd", "macro_sql": "{% macro bigquery__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n datetime_add(\n cast( {{ from_date_or_timestamp }} as datetime),\n interval {{ interval }} {{ datepart }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7076669, "supported_languages": null}, "macro.dbt_bigquery.bigquery__current_timestamp": {"unique_id": "macro.dbt_bigquery.bigquery__current_timestamp", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/timestamps.sql", "original_file_path": "macros/utils/timestamps.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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7078872, "supported_languages": null}, "macro.dbt_bigquery.bigquery__snapshot_string_as_time": {"unique_id": "macro.dbt_bigquery.bigquery__snapshot_string_as_time", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/timestamps.sql", "original_file_path": "macros/utils/timestamps.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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7080588, "supported_languages": null}, "macro.dbt_bigquery.bigquery__current_timestamp_backcompat": {"unique_id": "macro.dbt_bigquery.bigquery__current_timestamp_backcompat", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/timestamps.sql", "original_file_path": "macros/utils/timestamps.sql", "name": "bigquery__current_timestamp_backcompat", "macro_sql": "{% macro bigquery__current_timestamp_backcompat() -%}\n current_timestamp\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7081301, "supported_languages": null}, "macro.dbt_bigquery.bigquery__intersect": {"unique_id": "macro.dbt_bigquery.bigquery__intersect", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "name": "bigquery__intersect", "macro_sql": "{% macro bigquery__intersect() %}\n\n intersect distinct\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7082932, "supported_languages": null}, "macro.dbt_bigquery.bigquery__escape_single_quotes": {"unique_id": "macro.dbt_bigquery.bigquery__escape_single_quotes", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "name": "bigquery__escape_single_quotes", "macro_sql": "{% macro bigquery__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\", \"\\\\'\") }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.708552, "supported_languages": null}, "macro.dbt_bigquery.bigquery__right": {"unique_id": "macro.dbt_bigquery.bigquery__right", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "name": "bigquery__right", "macro_sql": "{% macro bigquery__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0\n then ''\n else\n substr(\n {{ string_text }},\n -1 * ({{ length_expression }})\n )\n end\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.708836, "supported_languages": null}, "macro.dbt_bigquery.bigquery__listagg": {"unique_id": "macro.dbt_bigquery.bigquery__listagg", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "name": "bigquery__listagg", "macro_sql": "{% macro bigquery__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n string_agg(\n {{ measure }},\n {{ delimiter_text }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n {% if limit_num -%}\n limit {{ limit_num }}\n {%- endif %}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.709281, "supported_languages": null}, "macro.dbt_bigquery.bigquery__datediff": {"unique_id": "macro.dbt_bigquery.bigquery__datediff", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "name": "bigquery__datediff", "macro_sql": "{% macro bigquery__datediff(first_date, second_date, datepart) -%}\n\n {% if dbt_version[0] == 1 and dbt_version[2] >= 2 %}\n {{ return(dbt.datediff(first_date, second_date, datepart)) }}\n {% else %}\n\n datetime_diff(\n cast({{second_date}} as datetime),\n cast({{first_date}} as datetime),\n {{datepart}}\n )\n\n {% endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.709811, "supported_languages": null}, "macro.dbt_bigquery.bigquery__safe_cast": {"unique_id": "macro.dbt_bigquery.bigquery__safe_cast", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "name": "bigquery__safe_cast", "macro_sql": "{% macro bigquery__safe_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.710034, "supported_languages": null}, "macro.dbt_bigquery.bigquery__hash": {"unique_id": "macro.dbt_bigquery.bigquery__hash", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "name": "bigquery__hash", "macro_sql": "{% macro bigquery__hash(field) -%}\n to_hex({{dbt.default__hash(field)}})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.710263, "supported_languages": null}, "macro.dbt_bigquery.bigquery__position": {"unique_id": "macro.dbt_bigquery.bigquery__position", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "name": "bigquery__position", "macro_sql": "{% macro bigquery__position(substring_text, string_text) %}\n\n strpos(\n {{ string_text }},\n {{ substring_text }}\n\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.710488, "supported_languages": null}, "macro.dbt_bigquery.bigquery__array_concat": {"unique_id": "macro.dbt_bigquery.bigquery__array_concat", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "name": "bigquery__array_concat", "macro_sql": "{% macro bigquery__array_concat(array_1, array_2) -%}\n array_concat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.710706, "supported_languages": null}, "macro.dbt_bigquery.bigquery__bool_or": {"unique_id": "macro.dbt_bigquery.bigquery__bool_or", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "name": "bigquery__bool_or", "macro_sql": "{% macro bigquery__bool_or(expression) -%}\n\n logical_or({{ expression }})\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.71089, "supported_languages": null}, "macro.dbt_bigquery.bigquery__split_part": {"unique_id": "macro.dbt_bigquery.bigquery__split_part", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "name": "bigquery__split_part", "macro_sql": "{% macro bigquery__split_part(string_text, delimiter_text, part_number) %}\n\n {% if part_number >= 0 %}\n split(\n {{ string_text }},\n {{ delimiter_text }}\n )[safe_offset({{ part_number - 1 }})]\n {% else %}\n split(\n {{ string_text }},\n {{ delimiter_text }}\n )[safe_offset(\n length({{ string_text }})\n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 1\n )]\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.711534, "supported_languages": null}, "macro.dbt_bigquery.bigquery__date_trunc": {"unique_id": "macro.dbt_bigquery.bigquery__date_trunc", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "name": "bigquery__date_trunc", "macro_sql": "{% macro bigquery__date_trunc(datepart, date) -%}\n timestamp_trunc(\n cast({{date}} as timestamp),\n {{datepart}}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.711763, "supported_languages": null}, "macro.dbt_bigquery.bigquery__array_construct": {"unique_id": "macro.dbt_bigquery.bigquery__array_construct", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "name": "bigquery__array_construct", "macro_sql": "{% macro bigquery__array_construct(inputs, data_type) -%}\n {% if inputs|length > 0 %}\n [ {{ inputs|join(' , ') }} ]\n {% else %}\n ARRAY<{{data_type}}>[]\n {% endif %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.712123, "supported_languages": null}, "macro.dbt_bigquery.bigquery__array_append": {"unique_id": "macro.dbt_bigquery.bigquery__array_append", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "name": "bigquery__array_append", "macro_sql": "{% macro bigquery__array_append(array, new_element) -%}\n {{ array_concat(array, array_construct([new_element])) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.array_concat", "macro.dbt.array_construct"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.712379, "supported_languages": null}, "macro.dbt_bigquery.bigquery__get_show_grant_sql": {"unique_id": "macro.dbt_bigquery.bigquery__get_show_grant_sql", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "bigquery__get_show_grant_sql", "macro_sql": "{% macro bigquery__get_show_grant_sql(relation) %}\n {% set location = adapter.get_dataset_location(relation) %}\n {% set relation = relation.incorporate(location=location) %}\n\n select privilege_type, grantee\n from {{ relation.information_schema(\"OBJECT_PRIVILEGES\") }}\n where object_schema = \"{{ relation.dataset }}\"\n and object_name = \"{{ relation.identifier }}\"\n -- filter out current user\n and split(grantee, ':')[offset(1)] != session_user()\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7130392, "supported_languages": null}, "macro.dbt_bigquery.bigquery__get_grant_sql": {"unique_id": "macro.dbt_bigquery.bigquery__get_grant_sql", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "bigquery__get_grant_sql", "macro_sql": "\n\n\n{%- macro bigquery__get_grant_sql(relation, privilege, grantee) -%}\n grant `{{ privilege }}` on {{ relation.type }} {{ relation }} to {{ '\\\"' + grantee|join('\\\", \\\"') + '\\\"' }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.713273, "supported_languages": null}, "macro.dbt_bigquery.bigquery__get_revoke_sql": {"unique_id": "macro.dbt_bigquery.bigquery__get_revoke_sql", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "bigquery__get_revoke_sql", "macro_sql": "{%- macro bigquery__get_revoke_sql(relation, privilege, grantee) -%}\n revoke `{{ privilege }}` on {{ relation.type }} {{ relation }} from {{ '\\\"' + grantee|join('\\\", \\\"') + '\\\"' }}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.713514, "supported_languages": null}, "macro.dbt.run_hooks": {"unique_id": "macro.dbt.run_hooks", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.714599, "supported_languages": null}, "macro.dbt.make_hook_config": {"unique_id": "macro.dbt.make_hook_config", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7147892, "supported_languages": null}, "macro.dbt.before_begin": {"unique_id": "macro.dbt.before_begin", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7149272, "supported_languages": null}, "macro.dbt.in_transaction": {"unique_id": "macro.dbt.in_transaction", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.715064, "supported_languages": null}, "macro.dbt.after_commit": {"unique_id": "macro.dbt.after_commit", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.71525, "supported_languages": null}, "macro.dbt.set_sql_header": {"unique_id": "macro.dbt.set_sql_header", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.715743, "supported_languages": null}, "macro.dbt.should_full_refresh": {"unique_id": "macro.dbt.should_full_refresh", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7160509, "supported_languages": null}, "macro.dbt.should_store_failures": {"unique_id": "macro.dbt.should_store_failures", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7163541, "supported_languages": null}, "macro.dbt.snapshot_merge_sql": {"unique_id": "macro.dbt.snapshot_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "name": "snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.716846, "supported_languages": null}, "macro.dbt.default__snapshot_merge_sql": {"unique_id": "macro.dbt.default__snapshot_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "name": "default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.dbt_scd_id = DBT_INTERNAL_DEST.dbt_scd_id\n\n when matched\n and DBT_INTERNAL_DEST.dbt_valid_to is null\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.717129, "supported_languages": null}, "macro.dbt.strategy_dispatch": {"unique_id": "macro.dbt.strategy_dispatch", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "strategy_dispatch", "macro_sql": "{% macro strategy_dispatch(name) -%}\n{% set original_name = name %}\n {% if '.' in name %}\n {% set package_name, name = name.split(\".\", 1) %}\n {% else %}\n {% set package_name = none %}\n {% endif %}\n\n {% if package_name is none %}\n {% set package_context = context %}\n {% elif package_name in context %}\n {% set package_context = context[package_name] %}\n {% else %}\n {% set error_msg %}\n Could not find package '{{package_name}}', called with '{{original_name}}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n\n {%- set search_name = 'snapshot_' ~ name ~ '_strategy' -%}\n\n {% if search_name not in package_context %}\n {% set error_msg %}\n The specified strategy macro '{{name}}' was not found in package '{{ package_name }}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n {{ return(package_context[search_name]) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.720622, "supported_languages": null}, "macro.dbt.snapshot_hash_arguments": {"unique_id": "macro.dbt.snapshot_hash_arguments", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments', 'dbt')(args) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.720798, "supported_languages": null}, "macro.dbt.default__snapshot_hash_arguments": {"unique_id": "macro.dbt.default__snapshot_hash_arguments", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "default__snapshot_hash_arguments", "macro_sql": "{% macro default__snapshot_hash_arguments(args) -%}\n md5({%- for arg in args -%}\n coalesce(cast({{ arg }} as varchar ), '')\n {% if not loop.last %} || '|' || {% endif %}\n {%- endfor -%})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.721014, "supported_languages": null}, "macro.dbt.snapshot_timestamp_strategy": {"unique_id": "macro.dbt.snapshot_timestamp_strategy", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_timestamp_strategy", "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set primary_key = config['unique_key'] %}\n {% set updated_at = config['updated_at'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/dbt-labs/dbt-core/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.dbt_valid_from < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.721717, "supported_languages": null}, "macro.dbt.snapshot_string_as_time": {"unique_id": "macro.dbt.snapshot_string_as_time", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time', 'dbt')(timestamp) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.721876, "supported_languages": null}, "macro.dbt.default__snapshot_string_as_time": {"unique_id": "macro.dbt.default__snapshot_string_as_time", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "default__snapshot_string_as_time", "macro_sql": "{% macro default__snapshot_string_as_time(timestamp) %}\n {% do exceptions.raise_not_implemented(\n 'snapshot_string_as_time macro not implemented for adapter '+adapter.type()\n ) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.722045, "supported_languages": null}, "macro.dbt.snapshot_check_all_get_existing_columns": {"unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) -%}\n {%- if not target_exists -%}\n {#-- no table yet -> return whatever the query does --#}\n {{ return((false, query_columns)) }}\n {%- endif -%}\n\n {#-- handle any schema changes --#}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=node.alias) -%}\n\n {% if check_cols_config == 'all' %}\n {%- set query_columns = get_columns_in_query(node['compiled_code']) -%}\n\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {#-- query for proper casing/quoting, to support comparison below --#}\n {%- set select_check_cols_from_target -%}\n select {{ check_cols_config | join(', ') }} from ({{ node['compiled_code'] }}) subq\n {%- endset -%}\n {% set query_columns = get_columns_in_query(select_check_cols_from_target) %}\n\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set existing_cols = adapter.get_columns_in_relation(target_relation) | map(attribute = 'name') | list -%}\n {%- set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(adapter.quote(col)) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return((ns.column_added, intersection)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.723435, "supported_languages": null}, "macro.dbt.snapshot_check_strategy": {"unique_id": "macro.dbt.snapshot_check_strategy", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set check_cols_config = config['check_cols'] %}\n {% set primary_key = config['unique_key'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n {% set updated_at = config.get('updated_at', snapshot_get_time()) %}\n\n {% set column_added = false %}\n\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n {{ get_true_sql() }}\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.get_true_sql", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.724736, "supported_languages": null}, "macro.dbt.create_columns": {"unique_id": "macro.dbt.create_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns', 'dbt')(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7285812, "supported_languages": null}, "macro.dbt.default__create_columns": {"unique_id": "macro.dbt.default__create_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation }} add column \"{{ column.name }}\" {{ column.data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.728866, "supported_languages": null}, "macro.dbt.post_snapshot": {"unique_id": "macro.dbt.post_snapshot", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.72903, "supported_languages": null}, "macro.dbt.default__post_snapshot": {"unique_id": "macro.dbt.default__post_snapshot", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7291179, "supported_languages": null}, "macro.dbt.get_true_sql": {"unique_id": "macro.dbt.get_true_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "get_true_sql", "macro_sql": "{% macro get_true_sql() %}\n {{ adapter.dispatch('get_true_sql', 'dbt')() }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_true_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.72926, "supported_languages": null}, "macro.dbt.default__get_true_sql": {"unique_id": "macro.dbt.default__get_true_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__get_true_sql", "macro_sql": "{% macro default__get_true_sql() %}\n {{ return('TRUE') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.729384, "supported_languages": null}, "macro.dbt.snapshot_staging_table": {"unique_id": "macro.dbt.snapshot_staging_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "snapshot_staging_table", "macro_sql": "{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {{ adapter.dispatch('snapshot_staging_table', 'dbt')(strategy, source_sql, target_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_staging_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.729592, "supported_languages": null}, "macro.dbt.default__snapshot_staging_table": {"unique_id": "macro.dbt.default__snapshot_staging_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__snapshot_staging_table", "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *,\n {{ strategy.unique_key }} as dbt_unique_key\n\n from {{ target_relation }}\n where dbt_valid_to is null\n\n ),\n\n insertions_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to,\n {{ strategy.scd_id }} as dbt_scd_id\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n {{ strategy.updated_at }} as dbt_valid_to\n\n from snapshot_query\n ),\n\n {%- if strategy.invalidate_hard_deletes %}\n\n deletes_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from insertions_source_data as source_data\n left outer join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_unique_key is null\n or (\n snapshotted_data.dbt_unique_key is not null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.dbt_scd_id\n\n from updates_source_data as source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where (\n {{ strategy.row_changed }}\n )\n )\n\n {%- if strategy.invalidate_hard_deletes -%}\n ,\n\n deletes as (\n\n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as dbt_valid_from,\n {{ snapshot_get_time() }} as dbt_updated_at,\n {{ snapshot_get_time() }} as dbt_valid_to,\n snapshotted_data.dbt_scd_id\n\n from snapshotted_data\n left join deletes_source_data as source_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where source_data.dbt_unique_key is null\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.invalidate_hard_deletes %}\n union all\n select * from deletes\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.730432, "supported_languages": null}, "macro.dbt.build_snapshot_table": {"unique_id": "macro.dbt.build_snapshot_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) -%}\n {{ adapter.dispatch('build_snapshot_table', 'dbt')(strategy, sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__build_snapshot_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.730618, "supported_languages": null}, "macro.dbt.default__build_snapshot_table": {"unique_id": "macro.dbt.default__build_snapshot_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__build_snapshot_table", "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.730864, "supported_languages": null}, "macro.dbt.build_snapshot_staging_table": {"unique_id": "macro.dbt.build_snapshot_staging_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set temp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, temp_relation, select) }}\n {% endcall %}\n\n {% do return(temp_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.73129, "supported_languages": null}, "macro.dbt.materialization_snapshot_default": {"unique_id": "macro.dbt.materialization_snapshot_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot.sql", "original_file_path": "macros/materializations/snapshots/snapshot.sql", "name": "materialization_snapshot_default", "macro_sql": "{% materialization snapshot, default %}\n {%- set config = model['config'] -%}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\n\n {% set target_relation_exists, target_relation = get_or_create_relation(\n database=model.database,\n schema=model.schema,\n identifier=target_table,\n type='table') -%}\n\n {%- if not target_relation.is_table -%}\n {% do exceptions.relation_wrong_type(target_relation, 'table') %}\n {%- endif -%}\n\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set strategy_macro = strategy_dispatch(strategy_name) %}\n {% set strategy = strategy_macro(model, \"snapshotted_data\", \"source_data\", config, target_relation_exists) %}\n\n {% if not target_relation_exists %}\n\n {% set build_sql = build_snapshot_table(strategy, model['compiled_code']) %}\n {% set final_sql = create_table_as(False, target_relation, build_sql) %}\n\n {% else %}\n\n {{ adapter.valid_snapshot_target(target_relation) }}\n\n {% set staging_table = build_snapshot_staging_table(strategy, sql, target_relation) %}\n\n -- this may no-op if the database does not require column expansion\n {% do adapter.expand_target_column_types(from_relation=staging_table,\n to_relation=target_relation) %}\n\n {% set missing_columns = adapter.get_missing_columns(staging_table, target_relation)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% do create_columns(target_relation, missing_columns) %}\n\n {% set source_columns = adapter.get_columns_in_relation(staging_table)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% set quoted_source_columns = [] %}\n {% for column in source_columns %}\n {% do quoted_source_columns.append(adapter.quote(column.name)) %}\n {% endfor %}\n\n {% set final_sql = snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n %}\n\n {% endif %}\n\n {% call statement('main') %}\n {{ final_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(target_relation_exists, full_refresh_mode=False) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if not target_relation_exists %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if staging_table is defined %}\n {% do post_snapshot(staging_table) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_or_create_relation", "macro.dbt.run_hooks", "macro.dbt.strategy_dispatch", "macro.dbt.build_snapshot_table", "macro.dbt.create_table_as", "macro.dbt.build_snapshot_staging_table", "macro.dbt.create_columns", "macro.dbt.snapshot_merge_sql", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes", "macro.dbt.post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.737076, "supported_languages": ["sql"]}, "macro.dbt.materialization_test_default": {"unique_id": "macro.dbt.materialization_test_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/test.sql", "original_file_path": "macros/materializations/tests/test.sql", "name": "materialization_test_default", "macro_sql": "{%- materialization test, default -%}\n\n {% set relations = [] %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type='table') -%} %}\n\n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n\n {% call statement(auto_begin=True) %}\n {{ create_table_as(False, target_relation, sql) }}\n {% endcall %}\n\n {% do relations.append(target_relation) %}\n\n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n\n {{ adapter.commit() }}\n\n {% else %}\n\n {% set main_sql = sql %}\n\n {% endif %}\n\n {% set limit = config.get('limit') %}\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit)}}\n\n {%- endcall %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7391229, "supported_languages": ["sql"]}, "macro.dbt.get_test_sql": {"unique_id": "macro.dbt.get_test_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "name": "get_test_sql", "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql', 'dbt')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.739626, "supported_languages": null}, "macro.dbt.default__get_test_sql": {"unique_id": "macro.dbt.default__get_test_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "name": "default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.739925, "supported_languages": null}, "macro.dbt.get_where_subquery": {"unique_id": "macro.dbt.get_where_subquery", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "name": "get_where_subquery", "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_where_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.740375, "supported_languages": null}, "macro.dbt.default__get_where_subquery": {"unique_id": "macro.dbt.default__get_where_subquery", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "name": "default__get_where_subquery", "macro_sql": "{% macro default__get_where_subquery(relation) -%}\n {% set where = config.get('where', '') %}\n {% if where %}\n {%- set filtered -%}\n (select * from {{ relation }} where {{ where }}) dbt_subquery\n {%- endset -%}\n {% do return(filtered) %}\n {%- else -%}\n {% do return(relation) %}\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.740768, "supported_languages": null}, "macro.dbt.get_quoted_csv": {"unique_id": "macro.dbt.get_quoted_csv", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\n\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.742374, "supported_languages": null}, "macro.dbt.diff_columns": {"unique_id": "macro.dbt.diff_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "diff_columns", "macro_sql": "{% macro diff_columns(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% set source_names = source_columns | map(attribute = 'column') | list %}\n {% set target_names = target_columns | map(attribute = 'column') | list %}\n\n {# --check whether the name attribute exists in the target - this does not perform a data type check #}\n {% for sc in source_columns %}\n {% if sc.name not in target_names %}\n {{ result.append(sc) }}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.742901, "supported_languages": null}, "macro.dbt.diff_column_data_types": {"unique_id": "macro.dbt.diff_column_data_types", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "diff_column_data_types", "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.data_type != tc.data_type and not sc.can_expand_to(other_column=tc) %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.data_type } ) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7435641, "supported_languages": null}, "macro.dbt.get_merge_update_columns": {"unique_id": "macro.dbt.get_merge_update_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "get_merge_update_columns", "macro_sql": "{% macro get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {{ return(adapter.dispatch('get_merge_update_columns', 'dbt')(merge_update_columns, merge_exclude_columns, dest_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.743807, "supported_languages": null}, "macro.dbt.default__get_merge_update_columns": {"unique_id": "macro.dbt.default__get_merge_update_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "default__get_merge_update_columns", "macro_sql": "{% macro default__get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {%- set default_cols = dest_columns | map(attribute=\"quoted\") | list -%}\n\n {%- if merge_update_columns and merge_exclude_columns -%}\n {{ exceptions.raise_compiler_error(\n 'Model cannot specify merge_update_columns and merge_exclude_columns. Please update model to use only one config'\n )}}\n {%- elif merge_update_columns -%}\n {%- set update_columns = merge_update_columns -%}\n {%- elif merge_exclude_columns -%}\n {%- set update_columns = [] -%}\n {%- for column in dest_columns -%}\n {% if column.column | lower not in merge_exclude_columns | map(\"lower\") | list %}\n {%- do update_columns.append(column.quoted) -%}\n {% endif %}\n {%- endfor -%}\n {%- else -%}\n {%- set update_columns = default_cols -%}\n {%- endif -%}\n\n {{ return(update_columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.744521, "supported_languages": null}, "macro.dbt.get_merge_sql": {"unique_id": "macro.dbt.get_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, predicates=none) -%}\n {{ adapter.dispatch('get_merge_sql', 'dbt')(target, source, unique_key, dest_columns, predicates) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.748619, "supported_languages": null}, "macro.dbt.default__get_merge_sql": {"unique_id": "macro.dbt.default__get_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, predicates) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set merge_update_columns = config.get('merge_update_columns') -%}\n {%- set merge_exclude_columns = config.get('merge_exclude_columns') -%}\n {%- set update_columns = get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not mapping and unique_key is not string %}\n {% for key in unique_key %}\n {% set this_key_match %}\n DBT_INTERNAL_SOURCE.{{ key }} = DBT_INTERNAL_DEST.{{ key }}\n {% endset %}\n {% do predicates.append(this_key_match) %}\n {% endfor %}\n {% else %}\n {% set unique_key_match %}\n DBT_INTERNAL_SOURCE.{{ unique_key }} = DBT_INTERNAL_DEST.{{ unique_key }}\n {% endset %}\n {% do predicates.append(unique_key_match) %}\n {% endif %}\n {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\n\n {{ sql_header if sql_header is not none }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on {{ predicates | join(' and ') }}\n\n {% if unique_key %}\n when matched then update set\n {% for column_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv", "macro.dbt.get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.750189, "supported_languages": null}, "macro.dbt.get_delete_insert_merge_sql": {"unique_id": "macro.dbt.get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql', 'dbt')(target, source, unique_key, dest_columns) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.750422, "supported_languages": null}, "macro.dbt.default__get_delete_insert_merge_sql": {"unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not string %}\n delete from {{target }}\n using {{ source }}\n where (\n {% for key in unique_key %}\n {{ source }}.{{ key }} = {{ target }}.{{ key }}\n {{ \"and \" if not loop.last }}\n {% endfor %}\n );\n {% else %}\n delete from {{ target }}\n where (\n {{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n );\n\n {% endif %}\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.751143, "supported_languages": null}, "macro.dbt.get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql', 'dbt')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.751416, "supported_languages": null}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {#-- The only time include_sql_header is True: --#}\n {#-- BigQuery + insert_overwrite strategy + \"static\" partitions config --#}\n {#-- We should consider including the sql header at the materialization level instead --#}\n\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7520618, "supported_languages": null}, "macro.dbt.is_incremental": {"unique_id": "macro.dbt.is_incremental", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/is_incremental.sql", "original_file_path": "macros/materializations/models/incremental/is_incremental.sql", "name": "is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7527769, "supported_languages": null}, "macro.dbt.get_incremental_append_sql": {"unique_id": "macro.dbt.get_incremental_append_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_append_sql", "macro_sql": "{% macro get_incremental_append_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_append_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.753643, "supported_languages": null}, "macro.dbt.default__get_incremental_append_sql": {"unique_id": "macro.dbt.default__get_incremental_append_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_append_sql", "macro_sql": "{% macro default__get_incremental_append_sql(arg_dict) %}\n\n {% do return(get_insert_into_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_insert_into_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.753876, "supported_languages": null}, "macro.dbt.get_incremental_delete_insert_sql": {"unique_id": "macro.dbt.get_incremental_delete_insert_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_delete_insert_sql", "macro_sql": "{% macro get_incremental_delete_insert_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_delete_insert_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_delete_insert_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.754056, "supported_languages": null}, "macro.dbt.default__get_incremental_delete_insert_sql": {"unique_id": "macro.dbt.default__get_incremental_delete_insert_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_delete_insert_sql", "macro_sql": "{% macro default__get_incremental_delete_insert_sql(arg_dict) %}\n\n {% do return(get_delete_insert_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.754317, "supported_languages": null}, "macro.dbt.get_incremental_merge_sql": {"unique_id": "macro.dbt.get_incremental_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_merge_sql", "macro_sql": "{% macro get_incremental_merge_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.754497, "supported_languages": null}, "macro.dbt.default__get_incremental_merge_sql": {"unique_id": "macro.dbt.default__get_incremental_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_merge_sql", "macro_sql": "{% macro default__get_incremental_merge_sql(arg_dict) %}\n\n {% do return(get_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.75475, "supported_languages": null}, "macro.dbt.get_incremental_insert_overwrite_sql": {"unique_id": "macro.dbt.get_incremental_insert_overwrite_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_insert_overwrite_sql", "macro_sql": "{% macro get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_insert_overwrite_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_insert_overwrite_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.754932, "supported_languages": null}, "macro.dbt.default__get_incremental_insert_overwrite_sql": {"unique_id": "macro.dbt.default__get_incremental_insert_overwrite_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_insert_overwrite_sql", "macro_sql": "{% macro default__get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {% do return(get_insert_overwrite_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"], arg_dict[\"predicates\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.755203, "supported_languages": null}, "macro.dbt.get_incremental_default_sql": {"unique_id": "macro.dbt.get_incremental_default_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_default_sql", "macro_sql": "{% macro get_incremental_default_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_default_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_default_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7553852, "supported_languages": null}, "macro.dbt.default__get_incremental_default_sql": {"unique_id": "macro.dbt.default__get_incremental_default_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_default_sql", "macro_sql": "{% macro default__get_incremental_default_sql(arg_dict) %}\n\n {% do return(get_incremental_append_sql(arg_dict)) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7555299, "supported_languages": null}, "macro.dbt.get_insert_into_sql": {"unique_id": "macro.dbt.get_insert_into_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_insert_into_sql", "macro_sql": "{% macro get_insert_into_sql(target_relation, temp_relation, dest_columns) %}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ temp_relation }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.755795, "supported_languages": null}, "macro.dbt.materialization_incremental_default": {"unique_id": "macro.dbt.materialization_incremental_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/incremental.sql", "original_file_path": "macros/materializations/models/incremental/incremental.sql", "name": "materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% if existing_relation is none %}\n {% set build_sql = get_create_table_as_sql(False, target_relation, sql) %}\n {% elif full_refresh_mode %}\n {% set build_sql = get_create_table_as_sql(False, intermediate_relation, sql) %}\n {% set need_swap = true %}\n {% else %}\n {% do run_query(get_create_table_as_sql(True, temp_relation, sql)) %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set incremental_predicates = config.get('incremental_predicates', none) %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.get_create_table_as_sql", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7606678, "supported_languages": ["sql"]}, "macro.dbt.incremental_validate_on_schema_change": {"unique_id": "macro.dbt.incremental_validate_on_schema_change", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "incremental_validate_on_schema_change", "macro_sql": "{% macro incremental_validate_on_schema_change(on_schema_change, default='ignore') %}\n\n {% if on_schema_change not in ['sync_all_columns', 'append_new_columns', 'fail', 'ignore'] %}\n\n {% set log_message = 'Invalid value for on_schema_change (%s) specified. Setting default value of %s.' % (on_schema_change, default) %}\n {% do log(log_message) %}\n\n {{ return(default) }}\n\n {% else %}\n\n {{ return(on_schema_change) }}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.765741, "supported_languages": null}, "macro.dbt.check_for_schema_changes": {"unique_id": "macro.dbt.check_for_schema_changes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "check_for_schema_changes", "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n\n {% set schema_changed = False %}\n\n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n\n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n\n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.diff_columns", "macro.dbt.diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7669902, "supported_languages": null}, "macro.dbt.sync_column_schemas": {"unique_id": "macro.dbt.sync_column_schemas", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "sync_column_schemas", "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n\n {% elif on_schema_change == 'sync_all_columns' %}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n\n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n\n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n\n {% do log(schema_change_message) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.alter_relation_add_remove_columns", "macro.dbt.alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.768197, "supported_languages": null}, "macro.dbt.process_schema_changes": {"unique_id": "macro.dbt.process_schema_changes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "process_schema_changes", "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n\n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n\n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n\n {% if schema_changes_dict['schema_changed'] %}\n\n {% if on_schema_change == 'fail' %}\n\n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways:\n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n\n Additional troubleshooting context:\n Source columns not in target: {{ schema_changes_dict['source_not_in_target'] }}\n Target columns not in source: {{ schema_changes_dict['target_not_in_source'] }}\n New column types: {{ schema_changes_dict['new_target_types'] }}\n {% endset %}\n\n {% do exceptions.raise_compiler_error(fail_msg) %}\n\n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n\n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {% endif %}\n\n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.769065, "supported_languages": null}, "macro.dbt.materialization_table_default": {"unique_id": "macro.dbt.materialization_table_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/table.sql", "original_file_path": "macros/materializations/models/table/table.sql", "name": "materialization_table_default", "macro_sql": "{% materialization table, default %}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do create_indexes(target_relation) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.get_create_table_as_sql", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7716858, "supported_languages": ["sql"]}, "macro.dbt.get_create_table_as_sql": {"unique_id": "macro.dbt.get_create_table_as_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "get_create_table_as_sql", "macro_sql": "{% macro get_create_table_as_sql(temporary, relation, sql) -%}\n {{ adapter.dispatch('get_create_table_as_sql', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_table_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.772243, "supported_languages": null}, "macro.dbt.default__get_create_table_as_sql": {"unique_id": "macro.dbt.default__get_create_table_as_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "default__get_create_table_as_sql", "macro_sql": "{% macro default__get_create_table_as_sql(temporary, relation, sql) -%}\n {{ return(create_table_as(temporary, relation, sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.772427, "supported_languages": null}, "macro.dbt.create_table_as": {"unique_id": "macro.dbt.create_table_as", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {# backward compatibility for create_table_as that does not support language #}\n {% if language == \"sql\" %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code)}}\n {% else %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code, language) }}\n {% endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.772842, "supported_languages": null}, "macro.dbt.default__create_table_as": {"unique_id": "macro.dbt.default__create_table_as", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.773258, "supported_languages": null}, "macro.dbt.materialization_view_default": {"unique_id": "macro.dbt.materialization_view_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/view.sql", "original_file_path": "macros/materializations/models/view/view.sql", "name": "materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='view') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n This relation (probably) doesn't exist yet. If it does exist, it's a leftover from\n a previous run, and we're going to try to drop it immediately. At the end of this\n materialization, we're going to rename the \"existing_relation\" to this identifier,\n and then we're going to drop it. In order to make sure we run the correct one of:\n - drop view ...\n - drop table ...\n\n We need to set the type of this relation to be the type of the existing_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the existing_relation does not\n exist, then there is nothing to move out of the way and subsequentally drop. In that case,\n this relation will be effectively unused.\n */\n {%- set backup_relation_type = 'view' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.775755, "supported_languages": ["sql"]}, "macro.dbt.handle_existing_table": {"unique_id": "macro.dbt.handle_existing_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/helpers.sql", "original_file_path": "macros/materializations/models/view/helpers.sql", "name": "handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7761102, "supported_languages": null}, "macro.dbt.default__handle_existing_table": {"unique_id": "macro.dbt.default__handle_existing_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/helpers.sql", "original_file_path": "macros/materializations/models/view/helpers.sql", "name": "default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7763379, "supported_languages": null}, "macro.dbt.create_or_replace_view": {"unique_id": "macro.dbt.create_or_replace_view", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/models/view/create_or_replace_view.sql", "name": "create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {% set should_revoke = should_revoke(exists_as_view, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=True) %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7778199, "supported_languages": null}, "macro.dbt.get_create_view_as_sql": {"unique_id": "macro.dbt.get_create_view_as_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "get_create_view_as_sql", "macro_sql": "{% macro get_create_view_as_sql(relation, sql) -%}\n {{ adapter.dispatch('get_create_view_as_sql', 'dbt')(relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.778223, "supported_languages": null}, "macro.dbt.default__get_create_view_as_sql": {"unique_id": "macro.dbt.default__get_create_view_as_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "default__get_create_view_as_sql", "macro_sql": "{% macro default__get_create_view_as_sql(relation, sql) -%}\n {{ return(create_view_as(relation, sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.778389, "supported_languages": null}, "macro.dbt.create_view_as": {"unique_id": "macro.dbt.create_view_as", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.778572, "supported_languages": null}, "macro.dbt.default__create_view_as": {"unique_id": "macro.dbt.default__create_view_as", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation }} as (\n {{ sql }}\n );\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.778822, "supported_languages": null}, "macro.dbt.materialization_seed_default": {"unique_id": "macro.dbt.materialization_seed_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/seed.sql", "original_file_path": "macros/materializations/seeds/seed.sql", "name": "materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set grant_config = config.get('grants') -%}\n {%- set agate_table = load_agate_table() -%}\n -- grab current tables grants config for comparision later on\n\n {%- do store_result('agate_table', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation)) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', code ~ ' ' ~ rows_affected, code, rows_affected) %}\n {{ get_csv_sql(create_table_sql, sql) }};\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if full_refresh_mode or not exists_as_table %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.run_hooks", "macro.dbt.reset_csv_table", "macro.dbt.create_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.noop_statement", "macro.dbt.get_csv_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7820559, "supported_languages": ["sql"]}, "macro.dbt.create_csv_table": {"unique_id": "macro.dbt.create_csv_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.786925, "supported_languages": null}, "macro.dbt.default__create_csv_table": {"unique_id": "macro.dbt.default__create_csv_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.787877, "supported_languages": null}, "macro.dbt.reset_csv_table": {"unique_id": "macro.dbt.reset_csv_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table', 'dbt')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.788117, "supported_languages": null}, "macro.dbt.default__reset_csv_table": {"unique_id": "macro.dbt.default__reset_csv_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.788589, "supported_languages": null}, "macro.dbt.get_csv_sql": {"unique_id": "macro.dbt.get_csv_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_csv_sql", "macro_sql": "{% macro get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ adapter.dispatch('get_csv_sql', 'dbt')(create_or_truncate_sql, insert_sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_csv_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7887812, "supported_languages": null}, "macro.dbt.default__get_csv_sql": {"unique_id": "macro.dbt.default__get_csv_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_csv_sql", "macro_sql": "{% macro default__get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ create_or_truncate_sql }};\n -- dbt seed --\n {{ insert_sql }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.788911, "supported_languages": null}, "macro.dbt.get_binding_char": {"unique_id": "macro.dbt.get_binding_char", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_binding_char", "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7890549, "supported_languages": null}, "macro.dbt.default__get_binding_char": {"unique_id": "macro.dbt.default__get_binding_char", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_binding_char", "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7891688, "supported_languages": null}, "macro.dbt.get_batch_size": {"unique_id": "macro.dbt.get_batch_size", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_batch_size", "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_batch_size"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.789334, "supported_languages": null}, "macro.dbt.default__get_batch_size": {"unique_id": "macro.dbt.default__get_batch_size", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_batch_size", "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.78945, "supported_languages": null}, "macro.dbt.get_seed_column_quoted_csv": {"unique_id": "macro.dbt.get_seed_column_quoted_csv", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.789919, "supported_languages": null}, "macro.dbt.load_csv_rows": {"unique_id": "macro.dbt.load_csv_rows", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.790105, "supported_languages": null}, "macro.dbt.default__load_csv_rows": {"unique_id": "macro.dbt.default__load_csv_rows", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n\n {% set batch_size = get_batch_size() %}\n\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.791332, "supported_languages": null}, "macro.dbt.generate_alias_name": {"unique_id": "macro.dbt.generate_alias_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "name": "generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_alias_name', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_alias_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.791904, "supported_languages": null}, "macro.dbt.default__generate_alias_name": {"unique_id": "macro.dbt.default__generate_alias_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "name": "default__generate_alias_name", "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name is none -%}\n\n {{ node.name }}\n\n {%- else -%}\n\n {{ custom_alias_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7922292, "supported_languages": null}, "macro.dbt.generate_schema_name": {"unique_id": "macro.dbt.generate_schema_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name=none, node=none) -%}\n {{ return(adapter.dispatch('generate_schema_name', 'dbt')(custom_schema_name, node)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7928908, "supported_languages": null}, "macro.dbt.default__generate_schema_name": {"unique_id": "macro.dbt.default__generate_schema_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.793171, "supported_languages": null}, "macro.dbt.generate_schema_name_for_env": {"unique_id": "macro.dbt.generate_schema_name_for_env", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7934568, "supported_languages": null}, "macro.dbt.generate_database_name": {"unique_id": "macro.dbt.generate_database_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "name": "generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name', 'dbt')(custom_database_name, node)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.793919, "supported_languages": null}, "macro.dbt.default__generate_database_name": {"unique_id": "macro.dbt.default__generate_database_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "name": "default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.794168, "supported_languages": null}, "macro.dbt.default__test_relationships": {"unique_id": "macro.dbt.default__test_relationships", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/relationships.sql", "original_file_path": "macros/generic_test_sql/relationships.sql", "name": "default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7945778, "supported_languages": null}, "macro.dbt.default__test_not_null": {"unique_id": "macro.dbt.default__test_not_null", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/not_null.sql", "original_file_path": "macros/generic_test_sql/not_null.sql", "name": "default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else column_name %}\n\nselect {{ column_list }}\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.794942, "supported_languages": null}, "macro.dbt.default__test_unique": {"unique_id": "macro.dbt.default__test_unique", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/unique.sql", "original_file_path": "macros/generic_test_sql/unique.sql", "name": "default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.795253, "supported_languages": null}, "macro.dbt.default__test_accepted_values": {"unique_id": "macro.dbt.default__test_accepted_values", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/accepted_values.sql", "original_file_path": "macros/generic_test_sql/accepted_values.sql", "name": "default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by {{ column_name }}\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.795897, "supported_languages": null}, "macro.dbt.statement": {"unique_id": "macro.dbt.statement", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "statement", "macro_sql": "\n{%- macro statement(name=None, fetch_result=False, auto_begin=True, language='sql') -%}\n {%- if execute: -%}\n {%- set compiled_code = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime {} for node \"{}\"'.format(language, model['unique_id'])) }}\n {{ write(compiled_code) }}\n {%- endif -%}\n {%- if language == 'sql'-%}\n {%- set res, table = adapter.execute(compiled_code, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- elif language == 'python' -%}\n {%- set res = submit_python_job(model, compiled_code) -%}\n {#-- TODO: What should table be for python models? --#}\n {%- set table = None -%}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"statement macro didn't get supported language\") %}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7973928, "supported_languages": null}, "macro.dbt.noop_statement": {"unique_id": "macro.dbt.noop_statement", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.7982368, "supported_languages": null}, "macro.dbt.run_query": {"unique_id": "macro.dbt.run_query", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.798539, "supported_languages": null}, "macro.dbt.convert_datetime": {"unique_id": "macro.dbt.convert_datetime", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "convert_datetime", "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8003368, "supported_languages": null}, "macro.dbt.dates_in_range": {"unique_id": "macro.dbt.dates_in_range", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "dates_in_range", "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n Partiton start date is after the end date ({{ start_date }}, {{ end_date }})\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg, model) }}\n {% endif %}\n\n {% set date_list = [] %}\n {% for i in range(0, day_count + 1) %}\n {% set the_date = (modules.datetime.timedelta(days=i) + start_date) %}\n {% if not out_fmt %}\n {% set _ = date_list.append(the_date) %}\n {% else %}\n {% set _ = date_list.append(the_date.strftime(out_fmt)) %}\n {% endif %}\n {% endfor %}\n\n {{ return(date_list) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.801549, "supported_languages": null}, "macro.dbt.partition_range": {"unique_id": "macro.dbt.partition_range", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "partition_range", "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8023522, "supported_languages": null}, "macro.dbt.py_current_timestring": {"unique_id": "macro.dbt.py_current_timestring", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "py_current_timestring", "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.802581, "supported_languages": null}, "macro.dbt.except": {"unique_id": "macro.dbt.except", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "name": "except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.802971, "supported_languages": null}, "macro.dbt.default__except": {"unique_id": "macro.dbt.default__except", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "name": "default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.803045, "supported_languages": null}, "macro.dbt.replace": {"unique_id": "macro.dbt.replace", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "name": "replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt') (field, old_chars, new_chars)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8034172, "supported_languages": null}, "macro.dbt.default__replace": {"unique_id": "macro.dbt.default__replace", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "name": "default__replace", "macro_sql": "{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8035781, "supported_languages": null}, "macro.dbt.concat": {"unique_id": "macro.dbt.concat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "name": "concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt')(fields)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8038762, "supported_languages": null}, "macro.dbt.default__concat": {"unique_id": "macro.dbt.default__concat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "name": "default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n {{ fields|join(' || ') }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.803997, "supported_languages": null}, "macro.dbt.length": {"unique_id": "macro.dbt.length", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "name": "length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__length"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.804307, "supported_languages": null}, "macro.dbt.default__length": {"unique_id": "macro.dbt.default__length", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "name": "default__length", "macro_sql": "{% macro default__length(expression) %}\n\n length(\n {{ expression }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.804411, "supported_languages": null}, "macro.dbt.dateadd": {"unique_id": "macro.dbt.dateadd", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "name": "dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.80481, "supported_languages": null}, "macro.dbt.default__dateadd": {"unique_id": "macro.dbt.default__dateadd", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "name": "default__dateadd", "macro_sql": "{% macro default__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_date_or_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.804969, "supported_languages": null}, "macro.dbt.intersect": {"unique_id": "macro.dbt.intersect", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "name": "intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__intersect"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.805244, "supported_languages": null}, "macro.dbt.default__intersect": {"unique_id": "macro.dbt.default__intersect", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "name": "default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8053188, "supported_languages": null}, "macro.dbt.escape_single_quotes": {"unique_id": "macro.dbt.escape_single_quotes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "name": "escape_single_quotes", "macro_sql": "{% macro escape_single_quotes(expression) %}\n {{ return(adapter.dispatch('escape_single_quotes', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__escape_single_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.80563, "supported_languages": null}, "macro.dbt.default__escape_single_quotes": {"unique_id": "macro.dbt.default__escape_single_quotes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "name": "default__escape_single_quotes", "macro_sql": "{% macro default__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\",\"''\") }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8057668, "supported_languages": null}, "macro.dbt.right": {"unique_id": "macro.dbt.right", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "name": "right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt') (string_text, length_expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__right"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8061068, "supported_languages": null}, "macro.dbt.default__right": {"unique_id": "macro.dbt.default__right", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "name": "default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.806319, "supported_languages": null}, "macro.dbt.listagg": {"unique_id": "macro.dbt.listagg", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "name": "listagg", "macro_sql": "{% macro listagg(measure, delimiter_text=\"','\", order_by_clause=none, limit_num=none) -%}\n {{ return(adapter.dispatch('listagg', 'dbt') (measure, delimiter_text, order_by_clause, limit_num)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__listagg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8069792, "supported_languages": null}, "macro.dbt.default__listagg": {"unique_id": "macro.dbt.default__listagg", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "name": "default__listagg", "macro_sql": "{% macro default__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n array_slice(\n array_agg(\n {{ measure }}\n ){% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n ,0\n ,{{ limit_num }}\n ),\n {{ delimiter_text }}\n )\n {%- else %}\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.807366, "supported_languages": null}, "macro.dbt.datediff": {"unique_id": "macro.dbt.datediff", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "name": "datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt')(first_date, second_date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.807748, "supported_languages": null}, "macro.dbt.default__datediff": {"unique_id": "macro.dbt.default__datediff", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "name": "default__datediff", "macro_sql": "{% macro default__datediff(first_date, second_date, datepart) -%}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.807904, "supported_languages": null}, "macro.dbt.safe_cast": {"unique_id": "macro.dbt.safe_cast", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "name": "safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt') (field, type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.808238, "supported_languages": null}, "macro.dbt.default__safe_cast": {"unique_id": "macro.dbt.default__safe_cast", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "name": "default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.808374, "supported_languages": null}, "macro.dbt.hash": {"unique_id": "macro.dbt.hash", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "name": "hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt') (field)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8086798, "supported_languages": null}, "macro.dbt.default__hash": {"unique_id": "macro.dbt.default__hash", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "name": "default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{ field }} as {{ api.Column.translate_type('string') }}))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.808835, "supported_languages": null}, "macro.dbt.cast_bool_to_text": {"unique_id": "macro.dbt.cast_bool_to_text", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "name": "cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', 'dbt') (field) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.809123, "supported_languages": null}, "macro.dbt.default__cast_bool_to_text": {"unique_id": "macro.dbt.default__cast_bool_to_text", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "name": "default__cast_bool_to_text", "macro_sql": "{% macro default__cast_bool_to_text(field) %}\n cast({{ field }} as {{ api.Column.translate_type('string') }})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8092742, "supported_languages": null}, "macro.dbt.any_value": {"unique_id": "macro.dbt.any_value", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "name": "any_value", "macro_sql": "{% macro any_value(expression) -%}\n {{ return(adapter.dispatch('any_value', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__any_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8095648, "supported_languages": null}, "macro.dbt.default__any_value": {"unique_id": "macro.dbt.default__any_value", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "name": "default__any_value", "macro_sql": "{% macro default__any_value(expression) -%}\n\n any_value({{ expression }})\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8096662, "supported_languages": null}, "macro.dbt.position": {"unique_id": "macro.dbt.position", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "name": "position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt') (substring_text, string_text)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__position"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.81, "supported_languages": null}, "macro.dbt.default__position": {"unique_id": "macro.dbt.default__position", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "name": "default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.81013, "supported_languages": null}, "macro.dbt.string_literal": {"unique_id": "macro.dbt.string_literal", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "name": "string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt') (value)) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.810417, "supported_languages": null}, "macro.dbt.default__string_literal": {"unique_id": "macro.dbt.default__string_literal", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "name": "default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.810518, "supported_languages": null}, "macro.dbt.type_string": {"unique_id": "macro.dbt.type_string", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.811456, "supported_languages": null}, "macro.dbt.default__type_string": {"unique_id": "macro.dbt.default__type_string", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_string", "macro_sql": "{% macro default__type_string() %}\n {{ return(api.Column.translate_type(\"string\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8116019, "supported_languages": null}, "macro.dbt.type_timestamp": {"unique_id": "macro.dbt.type_timestamp", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8118231, "supported_languages": null}, "macro.dbt.default__type_timestamp": {"unique_id": "macro.dbt.default__type_timestamp", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n {{ return(api.Column.translate_type(\"timestamp\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.811973, "supported_languages": null}, "macro.dbt.type_float": {"unique_id": "macro.dbt.type_float", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8121269, "supported_languages": null}, "macro.dbt.default__type_float": {"unique_id": "macro.dbt.default__type_float", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_float", "macro_sql": "{% macro default__type_float() %}\n {{ return(api.Column.translate_type(\"float\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.812276, "supported_languages": null}, "macro.dbt.type_numeric": {"unique_id": "macro.dbt.type_numeric", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.812433, "supported_languages": null}, "macro.dbt.default__type_numeric": {"unique_id": "macro.dbt.default__type_numeric", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n {{ return(api.Column.numeric_type(\"numeric\", 28, 6)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.812611, "supported_languages": null}, "macro.dbt.type_bigint": {"unique_id": "macro.dbt.type_bigint", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.812769, "supported_languages": null}, "macro.dbt.default__type_bigint": {"unique_id": "macro.dbt.default__type_bigint", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n {{ return(api.Column.translate_type(\"bigint\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.812918, "supported_languages": null}, "macro.dbt.type_int": {"unique_id": "macro.dbt.type_int", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.813086, "supported_languages": null}, "macro.dbt.default__type_int": {"unique_id": "macro.dbt.default__type_int", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_int", "macro_sql": "{%- macro default__type_int() -%}\n {{ return(api.Column.translate_type(\"integer\")) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8132339, "supported_languages": null}, "macro.dbt.type_boolean": {"unique_id": "macro.dbt.type_boolean", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_boolean", "macro_sql": "\n\n{%- macro type_boolean() -%}\n {{ return(adapter.dispatch('type_boolean', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_boolean"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.813397, "supported_languages": null}, "macro.dbt.default__type_boolean": {"unique_id": "macro.dbt.default__type_boolean", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_boolean", "macro_sql": "{%- macro default__type_boolean() -%}\n {{ return(api.Column.translate_type(\"boolean\")) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.813535, "supported_languages": null}, "macro.dbt.array_concat": {"unique_id": "macro.dbt.array_concat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "name": "array_concat", "macro_sql": "{% macro array_concat(array_1, array_2) -%}\n {{ return(adapter.dispatch('array_concat', 'dbt')(array_1, array_2)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__array_concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.813886, "supported_languages": null}, "macro.dbt.default__array_concat": {"unique_id": "macro.dbt.default__array_concat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "name": "default__array_concat", "macro_sql": "{% macro default__array_concat(array_1, array_2) -%}\n array_cat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.814014, "supported_languages": null}, "macro.dbt.bool_or": {"unique_id": "macro.dbt.bool_or", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "name": "bool_or", "macro_sql": "{% macro bool_or(expression) -%}\n {{ return(adapter.dispatch('bool_or', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__bool_or"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.814307, "supported_languages": null}, "macro.dbt.default__bool_or": {"unique_id": "macro.dbt.default__bool_or", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "name": "default__bool_or", "macro_sql": "{% macro default__bool_or(expression) -%}\n\n bool_or({{ expression }})\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.814412, "supported_languages": null}, "macro.dbt.last_day": {"unique_id": "macro.dbt.last_day", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "name": "last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt') (date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.814789, "supported_languages": null}, "macro.dbt.default_last_day": {"unique_id": "macro.dbt.default_last_day", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "name": "default_last_day", "macro_sql": "\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd(datepart, '1', dbt.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.815061, "supported_languages": null}, "macro.dbt.default__last_day": {"unique_id": "macro.dbt.default__last_day", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "name": "default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt.default_last_day(date, datepart)}}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8152142, "supported_languages": null}, "macro.dbt.split_part": {"unique_id": "macro.dbt.split_part", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "name": "split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ return(adapter.dispatch('split_part', 'dbt') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.815809, "supported_languages": null}, "macro.dbt.default__split_part": {"unique_id": "macro.dbt.default__split_part", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "name": "default__split_part", "macro_sql": "{% macro default__split_part(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n {{ part_number }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8160331, "supported_languages": null}, "macro.dbt._split_part_negative": {"unique_id": "macro.dbt._split_part_negative", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "name": "_split_part_negative", "macro_sql": "{% macro _split_part_negative(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n length({{ string_text }})\n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 2 {{ part_number }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.816364, "supported_languages": null}, "macro.dbt.date_trunc": {"unique_id": "macro.dbt.date_trunc", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "name": "date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt') (datepart, date)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.816774, "supported_languages": null}, "macro.dbt.default__date_trunc": {"unique_id": "macro.dbt.default__date_trunc", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "name": "default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) -%}\n date_trunc('{{datepart}}', {{date}})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8169081, "supported_languages": null}, "macro.dbt.array_construct": {"unique_id": "macro.dbt.array_construct", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "name": "array_construct", "macro_sql": "{% macro array_construct(inputs=[], data_type=api.Column.translate_type('integer')) -%}\n {{ return(adapter.dispatch('array_construct', 'dbt')(inputs, data_type)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__array_construct"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.817344, "supported_languages": null}, "macro.dbt.default__array_construct": {"unique_id": "macro.dbt.default__array_construct", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "name": "default__array_construct", "macro_sql": "{% macro default__array_construct(inputs, data_type) -%}\n {% if inputs|length > 0 %}\n array[ {{ inputs|join(' , ') }} ]\n {% else %}\n array[]::{{data_type}}[]\n {% endif %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.81759, "supported_languages": null}, "macro.dbt.array_append": {"unique_id": "macro.dbt.array_append", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "name": "array_append", "macro_sql": "{% macro array_append(array, new_element) -%}\n {{ return(adapter.dispatch('array_append', 'dbt')(array, new_element)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__array_append"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.817927, "supported_languages": null}, "macro.dbt.default__array_append": {"unique_id": "macro.dbt.default__array_append", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "name": "default__array_append", "macro_sql": "{% macro default__array_append(array, new_element) -%}\n array_append({{ array }}, {{ new_element }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.81806, "supported_languages": null}, "macro.dbt.create_schema": {"unique_id": "macro.dbt.create_schema", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema', 'dbt')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.818482, "supported_languages": null}, "macro.dbt.default__create_schema": {"unique_id": "macro.dbt.default__create_schema", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.818662, "supported_languages": null}, "macro.dbt.drop_schema": {"unique_id": "macro.dbt.drop_schema", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.818824, "supported_languages": null}, "macro.dbt.default__drop_schema": {"unique_id": "macro.dbt.default__drop_schema", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.81901, "supported_languages": null}, "macro.dbt.current_timestamp": {"unique_id": "macro.dbt.current_timestamp", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "current_timestamp", "macro_sql": "{%- macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8195221, "supported_languages": null}, "macro.dbt.default__current_timestamp": {"unique_id": "macro.dbt.default__current_timestamp", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter ' + adapter.type()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.819668, "supported_languages": null}, "macro.dbt.snapshot_get_time": {"unique_id": "macro.dbt.snapshot_get_time", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "snapshot_get_time", "macro_sql": "\n\n{%- macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.819804, "supported_languages": null}, "macro.dbt.default__snapshot_get_time": {"unique_id": "macro.dbt.default__snapshot_get_time", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() %}\n {{ current_timestamp() }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8199072, "supported_languages": null}, "macro.dbt.current_timestamp_backcompat": {"unique_id": "macro.dbt.current_timestamp_backcompat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "current_timestamp_backcompat", "macro_sql": "{% macro current_timestamp_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.820079, "supported_languages": null}, "macro.dbt.default__current_timestamp_backcompat": {"unique_id": "macro.dbt.default__current_timestamp_backcompat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "default__current_timestamp_backcompat", "macro_sql": "{% macro default__current_timestamp_backcompat() %}\n current_timestamp::timestamp\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.820153, "supported_languages": null}, "macro.dbt.current_timestamp_in_utc_backcompat": {"unique_id": "macro.dbt.current_timestamp_in_utc_backcompat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "current_timestamp_in_utc_backcompat", "macro_sql": "{% macro current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_in_utc_backcompat', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__current_timestamp_in_utc_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.820311, "supported_languages": null}, "macro.dbt.default__current_timestamp_in_utc_backcompat": {"unique_id": "macro.dbt.default__current_timestamp_in_utc_backcompat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "default__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro default__current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt_bigquery.bigquery__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.820468, "supported_languages": null}, "macro.dbt.get_create_index_sql": {"unique_id": "macro.dbt.get_create_index_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.820962, "supported_languages": null}, "macro.dbt.default__get_create_index_sql": {"unique_id": "macro.dbt.default__get_create_index_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.821161, "supported_languages": null}, "macro.dbt.create_indexes": {"unique_id": "macro.dbt.create_indexes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes', 'dbt')(relation) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8213131, "supported_languages": null}, "macro.dbt.default__create_indexes": {"unique_id": "macro.dbt.default__create_indexes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.821704, "supported_languages": null}, "macro.dbt.make_intermediate_relation": {"unique_id": "macro.dbt.make_intermediate_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "make_intermediate_relation", "macro_sql": "{% macro make_intermediate_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_intermediate_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_intermediate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.824727, "supported_languages": null}, "macro.dbt.default__make_intermediate_relation": {"unique_id": "macro.dbt.default__make_intermediate_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__make_intermediate_relation", "macro_sql": "{% macro default__make_intermediate_relation(base_relation, suffix) %}\n {{ return(default__make_temp_relation(base_relation, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8248892, "supported_languages": null}, "macro.dbt.make_temp_relation": {"unique_id": "macro.dbt.make_temp_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.825099, "supported_languages": null}, "macro.dbt.default__make_temp_relation": {"unique_id": "macro.dbt.default__make_temp_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {%- set temp_identifier = base_relation.identifier ~ suffix -%}\n {%- set temp_relation = base_relation.incorporate(\n path={\"identifier\": temp_identifier}) -%}\n\n {{ return(temp_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8253849, "supported_languages": null}, "macro.dbt.make_backup_relation": {"unique_id": "macro.dbt.make_backup_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "make_backup_relation", "macro_sql": "{% macro make_backup_relation(base_relation, backup_relation_type, suffix='__dbt_backup') %}\n {{ return(adapter.dispatch('make_backup_relation', 'dbt')(base_relation, backup_relation_type, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_backup_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.825624, "supported_languages": null}, "macro.dbt.default__make_backup_relation": {"unique_id": "macro.dbt.default__make_backup_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__make_backup_relation", "macro_sql": "{% macro default__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {%- set backup_identifier = base_relation.identifier ~ suffix -%}\n {%- set backup_relation = base_relation.incorporate(\n path={\"identifier\": backup_identifier},\n type=backup_relation_type\n ) -%}\n {{ return(backup_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8259468, "supported_languages": null}, "macro.dbt.drop_relation": {"unique_id": "macro.dbt.drop_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8261461, "supported_languages": null}, "macro.dbt.default__drop_relation": {"unique_id": "macro.dbt.default__drop_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__drop_relation", "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8263512, "supported_languages": null}, "macro.dbt.truncate_relation": {"unique_id": "macro.dbt.truncate_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8265269, "supported_languages": null}, "macro.dbt.default__truncate_relation": {"unique_id": "macro.dbt.default__truncate_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.82668, "supported_languages": null}, "macro.dbt.rename_relation": {"unique_id": "macro.dbt.rename_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.826874, "supported_languages": null}, "macro.dbt.default__rename_relation": {"unique_id": "macro.dbt.default__rename_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.82714, "supported_languages": null}, "macro.dbt.get_or_create_relation": {"unique_id": "macro.dbt.get_or_create_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) -%}\n {{ return(adapter.dispatch('get_or_create_relation', 'dbt')(database, schema, identifier, type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_or_create_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8273878, "supported_languages": null}, "macro.dbt.default__get_or_create_relation": {"unique_id": "macro.dbt.default__get_or_create_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__get_or_create_relation", "macro_sql": "{% macro default__get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.827923, "supported_languages": null}, "macro.dbt.load_cached_relation": {"unique_id": "macro.dbt.load_cached_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "load_cached_relation", "macro_sql": "{% macro load_cached_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.828204, "supported_languages": null}, "macro.dbt.load_relation": {"unique_id": "macro.dbt.load_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {{ return(load_cached_relation(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.82835, "supported_languages": null}, "macro.dbt.drop_relation_if_exists": {"unique_id": "macro.dbt.drop_relation_if_exists", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.828547, "supported_languages": null}, "macro.dbt.collect_freshness": {"unique_id": "macro.dbt.collect_freshness", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness', 'dbt')(source, loaded_at_field, filter))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.829025, "supported_languages": null}, "macro.dbt.default__collect_freshness": {"unique_id": "macro.dbt.default__collect_freshness", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.82943, "supported_languages": null}, "macro.dbt.copy_grants": {"unique_id": "macro.dbt.copy_grants", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "copy_grants", "macro_sql": "{% macro copy_grants() %}\n {{ return(adapter.dispatch('copy_grants', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8310258, "supported_languages": null}, "macro.dbt.default__copy_grants": {"unique_id": "macro.dbt.default__copy_grants", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__copy_grants", "macro_sql": "{% macro default__copy_grants() %}\n {{ return(True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.831142, "supported_languages": null}, "macro.dbt.support_multiple_grantees_per_dcl_statement": {"unique_id": "macro.dbt.support_multiple_grantees_per_dcl_statement", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "support_multiple_grantees_per_dcl_statement", "macro_sql": "{% macro support_multiple_grantees_per_dcl_statement() %}\n {{ return(adapter.dispatch('support_multiple_grantees_per_dcl_statement', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.831302, "supported_languages": null}, "macro.dbt.default__support_multiple_grantees_per_dcl_statement": {"unique_id": "macro.dbt.default__support_multiple_grantees_per_dcl_statement", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__support_multiple_grantees_per_dcl_statement", "macro_sql": "\n\n{%- macro default__support_multiple_grantees_per_dcl_statement() -%}\n {{ return(True) }}\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.831412, "supported_languages": null}, "macro.dbt.should_revoke": {"unique_id": "macro.dbt.should_revoke", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "should_revoke", "macro_sql": "{% macro should_revoke(existing_relation, full_refresh_mode=True) %}\n\n {% if not existing_relation %}\n {#-- The table doesn't already exist, so no grants to copy over --#}\n {{ return(False) }}\n {% elif full_refresh_mode %}\n {#-- The object is being REPLACED -- whether grants are copied over depends on the value of user config --#}\n {{ return(copy_grants()) }}\n {% else %}\n {#-- The table is being merged/upserted/inserted -- grants will be carried over --#}\n {{ return(True) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.831743, "supported_languages": null}, "macro.dbt.get_show_grant_sql": {"unique_id": "macro.dbt.get_show_grant_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_show_grant_sql", "macro_sql": "{% macro get_show_grant_sql(relation) %}\n {{ return(adapter.dispatch(\"get_show_grant_sql\", \"dbt\")(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_show_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.831924, "supported_languages": null}, "macro.dbt.default__get_show_grant_sql": {"unique_id": "macro.dbt.default__get_show_grant_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_show_grant_sql", "macro_sql": "{% macro default__get_show_grant_sql(relation) %}\n show grants on {{ relation }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.832021, "supported_languages": null}, "macro.dbt.get_grant_sql": {"unique_id": "macro.dbt.get_grant_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_grant_sql", "macro_sql": "{% macro get_grant_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_grant_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8322508, "supported_languages": null}, "macro.dbt.default__get_grant_sql": {"unique_id": "macro.dbt.default__get_grant_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_grant_sql", "macro_sql": "\n\n{%- macro default__get_grant_sql(relation, privilege, grantees) -%}\n grant {{ privilege }} on {{ relation }} to {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.832434, "supported_languages": null}, "macro.dbt.get_revoke_sql": {"unique_id": "macro.dbt.get_revoke_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_revoke_sql", "macro_sql": "{% macro get_revoke_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_revoke_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_revoke_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.83265, "supported_languages": null}, "macro.dbt.default__get_revoke_sql": {"unique_id": "macro.dbt.default__get_revoke_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_revoke_sql", "macro_sql": "\n\n{%- macro default__get_revoke_sql(relation, privilege, grantees) -%}\n revoke {{ privilege }} on {{ relation }} from {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.83283, "supported_languages": null}, "macro.dbt.get_dcl_statement_list": {"unique_id": "macro.dbt.get_dcl_statement_list", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_dcl_statement_list", "macro_sql": "{% macro get_dcl_statement_list(relation, grant_config, get_dcl_macro) %}\n {{ return(adapter.dispatch('get_dcl_statement_list', 'dbt')(relation, grant_config, get_dcl_macro)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_dcl_statement_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8330472, "supported_languages": null}, "macro.dbt.default__get_dcl_statement_list": {"unique_id": "macro.dbt.default__get_dcl_statement_list", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_dcl_statement_list", "macro_sql": "\n\n{%- macro default__get_dcl_statement_list(relation, grant_config, get_dcl_macro) -%}\n {#\n -- Unpack grant_config into specific privileges and the set of users who need them granted/revoked.\n -- Depending on whether this database supports multiple grantees per statement, pass in the list of\n -- all grantees per privilege, or (if not) template one statement per privilege-grantee pair.\n -- `get_dcl_macro` will be either `get_grant_sql` or `get_revoke_sql`\n #}\n {%- set dcl_statements = [] -%}\n {%- for privilege, grantees in grant_config.items() %}\n {%- if support_multiple_grantees_per_dcl_statement() and grantees -%}\n {%- set dcl = get_dcl_macro(relation, privilege, grantees) -%}\n {%- do dcl_statements.append(dcl) -%}\n {%- else -%}\n {%- for grantee in grantees -%}\n {% set dcl = get_dcl_macro(relation, privilege, [grantee]) %}\n {%- do dcl_statements.append(dcl) -%}\n {% endfor -%}\n {%- endif -%}\n {%- endfor -%}\n {{ return(dcl_statements) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8337102, "supported_languages": null}, "macro.dbt.call_dcl_statements": {"unique_id": "macro.dbt.call_dcl_statements", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "call_dcl_statements", "macro_sql": "{% macro call_dcl_statements(dcl_statement_list) %}\n {{ return(adapter.dispatch(\"call_dcl_statements\", \"dbt\")(dcl_statement_list)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.833952, "supported_languages": null}, "macro.dbt.default__call_dcl_statements": {"unique_id": "macro.dbt.default__call_dcl_statements", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__call_dcl_statements", "macro_sql": "{% macro default__call_dcl_statements(dcl_statement_list) %}\n {#\n -- By default, supply all grant + revoke statements in a single semicolon-separated block,\n -- so that they're all processed together.\n\n -- Some databases do not support this. Those adapters will need to override this macro\n -- to run each statement individually.\n #}\n {% call statement('grants') %}\n {% for dcl_statement in dcl_statement_list %}\n {{ dcl_statement }};\n {% endfor %}\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.834191, "supported_languages": null}, "macro.dbt.apply_grants": {"unique_id": "macro.dbt.apply_grants", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "apply_grants", "macro_sql": "{% macro apply_grants(relation, grant_config, should_revoke) %}\n {{ return(adapter.dispatch(\"apply_grants\", \"dbt\")(relation, grant_config, should_revoke)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.834425, "supported_languages": null}, "macro.dbt.default__apply_grants": {"unique_id": "macro.dbt.default__apply_grants", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__apply_grants", "macro_sql": "{% macro default__apply_grants(relation, grant_config, should_revoke=True) %}\n {#-- If grant_config is {} or None, this is a no-op --#}\n {% if grant_config %}\n {% if should_revoke %}\n {#-- We think previous grants may have carried over --#}\n {#-- Show current grants and calculate diffs --#}\n {% set current_grants_table = run_query(get_show_grant_sql(relation)) %}\n {% set current_grants_dict = adapter.standardize_grants_dict(current_grants_table) %}\n {% set needs_granting = diff_of_two_dicts(grant_config, current_grants_dict) %}\n {% set needs_revoking = diff_of_two_dicts(current_grants_dict, grant_config) %}\n {% if not (needs_granting or needs_revoking) %}\n {{ log('On ' ~ relation ~': All grants are in place, no revocation or granting needed.')}}\n {% endif %}\n {% else %}\n {#-- We don't think there's any chance of previous grants having carried over. --#}\n {#-- Jump straight to granting what the user has configured. --#}\n {% set needs_revoking = {} %}\n {% set needs_granting = grant_config %}\n {% endif %}\n {% if needs_granting or needs_revoking %}\n {% set revoke_statement_list = get_dcl_statement_list(relation, needs_revoking, get_revoke_sql) %}\n {% set grant_statement_list = get_dcl_statement_list(relation, needs_granting, get_grant_sql) %}\n {% set dcl_statement_list = revoke_statement_list + grant_statement_list %}\n {% if dcl_statement_list %}\n {{ call_dcl_statements(dcl_statement_list) }}\n {% endif %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_grant_sql", "macro.dbt.get_dcl_statement_list", "macro.dbt.call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8356202, "supported_languages": null}, "macro.dbt.alter_column_comment": {"unique_id": "macro.dbt.alter_column_comment", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment', 'dbt')(relation, column_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.836381, "supported_languages": null}, "macro.dbt.default__alter_column_comment": {"unique_id": "macro.dbt.default__alter_column_comment", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.836545, "supported_languages": null}, "macro.dbt.alter_relation_comment": {"unique_id": "macro.dbt.alter_relation_comment", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment', 'dbt')(relation, relation_comment)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8367438, "supported_languages": null}, "macro.dbt.default__alter_relation_comment": {"unique_id": "macro.dbt.default__alter_relation_comment", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.836904, "supported_languages": null}, "macro.dbt.persist_docs": {"unique_id": "macro.dbt.persist_docs", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs', 'dbt')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.837161, "supported_languages": null}, "macro.dbt.default__persist_docs": {"unique_id": "macro.dbt.default__persist_docs", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do run_query(alter_column_comment(relation, model.columns)) %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8376231, "supported_languages": null}, "macro.dbt.get_catalog": {"unique_id": "macro.dbt.get_catalog", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8390248, "supported_languages": null}, "macro.dbt.default__get_catalog": {"unique_id": "macro.dbt.default__get_catalog", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.839276, "supported_languages": null}, "macro.dbt.information_schema_name": {"unique_id": "macro.dbt.information_schema_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.839455, "supported_languages": null}, "macro.dbt.default__information_schema_name": {"unique_id": "macro.dbt.default__information_schema_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.839602, "supported_languages": null}, "macro.dbt.list_schemas": {"unique_id": "macro.dbt.list_schemas", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8397708, "supported_languages": null}, "macro.dbt.default__list_schemas": {"unique_id": "macro.dbt.default__list_schemas", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.840009, "supported_languages": null}, "macro.dbt.check_schema_exists": {"unique_id": "macro.dbt.check_schema_exists", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists', 'dbt')(information_schema, schema)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.840224, "supported_languages": null}, "macro.dbt.default__check_schema_exists": {"unique_id": "macro.dbt.default__check_schema_exists", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.840512, "supported_languages": null}, "macro.dbt.list_relations_without_caching": {"unique_id": "macro.dbt.list_relations_without_caching", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.840699, "supported_languages": null}, "macro.dbt.default__list_relations_without_caching": {"unique_id": "macro.dbt.default__list_relations_without_caching", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.840852, "supported_languages": null}, "macro.dbt.get_columns_in_relation": {"unique_id": "macro.dbt.get_columns_in_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.842443, "supported_languages": null}, "macro.dbt.default__get_columns_in_relation": {"unique_id": "macro.dbt.default__get_columns_in_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8426602, "supported_languages": null}, "macro.dbt.sql_convert_columns_in_relation": {"unique_id": "macro.dbt.sql_convert_columns_in_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8429608, "supported_languages": null}, "macro.dbt.get_columns_in_query": {"unique_id": "macro.dbt.get_columns_in_query", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8431349, "supported_languages": null}, "macro.dbt.default__get_columns_in_query": {"unique_id": "macro.dbt.default__get_columns_in_query", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.843464, "supported_languages": null}, "macro.dbt.alter_column_type": {"unique_id": "macro.dbt.alter_column_type", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type', 'dbt')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8437, "supported_languages": null}, "macro.dbt.default__alter_column_type": {"unique_id": "macro.dbt.default__alter_column_type", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.844429, "supported_languages": null}, "macro.dbt.alter_relation_add_remove_columns": {"unique_id": "macro.dbt.alter_relation_add_remove_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "alter_relation_add_remove_columns", "macro_sql": "{% macro alter_relation_add_remove_columns(relation, add_columns = none, remove_columns = none) -%}\n {{ return(adapter.dispatch('alter_relation_add_remove_columns', 'dbt')(relation, add_columns, remove_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__alter_relation_add_remove_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.844748, "supported_languages": null}, "macro.dbt.default__alter_relation_add_remove_columns": {"unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__alter_relation_add_remove_columns", "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation }}\n\n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n\n {% for column in remove_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.845564, "supported_languages": null}, "macro.dbt.build_ref_function": {"unique_id": "macro.dbt.build_ref_function", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "build_ref_function", "macro_sql": "{% macro build_ref_function(model) %}\n\n {%- set ref_dict = {} -%}\n {%- for _ref in model.refs -%}\n {%- set resolved = ref(*_ref) -%}\n {%- do ref_dict.update({_ref | join(\".\"): resolved.quote(database=False, schema=False, identifier=False) | string}) -%}\n {%- endfor -%}\n\ndef ref(*args,dbt_load_df_function):\n refs = {{ ref_dict | tojson }}\n key = \".\".join(args)\n return dbt_load_df_function(refs[key])\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.847101, "supported_languages": null}, "macro.dbt.build_source_function": {"unique_id": "macro.dbt.build_source_function", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "build_source_function", "macro_sql": "{% macro build_source_function(model) %}\n\n {%- set source_dict = {} -%}\n {%- for _source in model.sources -%}\n {%- set resolved = source(*_source) -%}\n {%- do source_dict.update({_source | join(\".\"): resolved.quote(database=False, schema=False, identifier=False) | string}) -%}\n {%- endfor -%}\n\ndef source(*args, dbt_load_df_function):\n sources = {{ source_dict | tojson }}\n key = \".\".join(args)\n return dbt_load_df_function(sources[key])\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.847569, "supported_languages": null}, "macro.dbt.build_config_dict": {"unique_id": "macro.dbt.build_config_dict", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "build_config_dict", "macro_sql": "{% macro build_config_dict(model) %}\n {%- set config_dict = {} -%}\n {%- for key in model.config.config_keys_used -%}\n {# weird type testing with enum, would be much easier to write this logic in Python! #}\n {%- if key == 'language' -%}\n {%- set value = 'python' -%}\n {%- endif -%}\n {%- set value = model.config[key] -%}\n {%- do config_dict.update({key: value}) -%}\n {%- endfor -%}\nconfig_dict = {{ config_dict }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.848029, "supported_languages": null}, "macro.dbt.py_script_postfix": {"unique_id": "macro.dbt.py_script_postfix", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "py_script_postfix", "macro_sql": "{% macro py_script_postfix(model) %}\n# This part is user provided model code\n# you will need to copy the next section to run the code\n# COMMAND ----------\n# this part is dbt logic for get ref work, do not modify\n\n{{ build_ref_function(model ) }}\n{{ build_source_function(model ) }}\n{{ build_config_dict(model) }}\n\nclass config:\n def __init__(self, *args, **kwargs):\n pass\n\n @staticmethod\n def get(key, default=None):\n return config_dict.get(key, default)\n\nclass this:\n \"\"\"dbt.this() or dbt.this.identifier\"\"\"\n database = '{{ this.database }}'\n schema = '{{ this.schema }}'\n identifier = '{{ this.identifier }}'\n def __repr__(self):\n return '{{ this }}'\n\n\nclass dbtObj:\n def __init__(self, load_df_function) -> None:\n self.source = lambda *args: source(*args, dbt_load_df_function=load_df_function)\n self.ref = lambda *args: ref(*args, dbt_load_df_function=load_df_function)\n self.config = config\n self.this = this()\n self.is_incremental = {{ is_incremental() }}\n\n# COMMAND ----------\n{{py_script_comment()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.build_ref_function", "macro.dbt.build_source_function", "macro.dbt.build_config_dict", "macro.dbt.is_incremental", "macro.dbt.py_script_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.848438, "supported_languages": null}, "macro.dbt.py_script_comment": {"unique_id": "macro.dbt.py_script_comment", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "py_script_comment", "macro_sql": "{%macro py_script_comment()%}\n{%endmacro%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.84851, "supported_languages": null}, "macro.dbt.test_unique": {"unique_id": "macro.dbt.test_unique", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.849094, "supported_languages": null}, "macro.dbt.test_not_null": {"unique_id": "macro.dbt.test_not_null", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8493178, "supported_languages": null}, "macro.dbt.test_accepted_values": {"unique_id": "macro.dbt.test_accepted_values", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values', 'dbt') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.849591, "supported_languages": null}, "macro.dbt.test_relationships": {"unique_id": "macro.dbt.test_relationships", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships', 'dbt') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8498611, "supported_languages": null}, "macro.dbt_utils.xdb_deprecation_warning_without_replacement": {"unique_id": "macro.dbt_utils.xdb_deprecation_warning_without_replacement", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/deprecated/xdb_deprecation_warning.sql", "original_file_path": "macros/cross_db_utils/deprecated/xdb_deprecation_warning.sql", "name": "xdb_deprecation_warning_without_replacement", "macro_sql": "{% macro xdb_deprecation_warning_without_replacement(macro, package, model) %}\n {%- set error_message = \"Warning: the `\" ~ macro ~\"` macro is deprecated and will be removed in a future version of the package, once equivalent functionality is implemented in dbt Core. The \" ~ package ~ \".\" ~ model ~ \" model triggered this warning.\" -%}\n {%- do exceptions.warn(error_message) -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.850243, "supported_languages": null}, "macro.dbt_utils.get_url_host": {"unique_id": "macro.dbt_utils.get_url_host", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "name": "get_url_host", "macro_sql": "{% macro get_url_host(field) -%}\n {{ return(adapter.dispatch('get_url_host', 'dbt_utils')(field)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_host"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.850635, "supported_languages": null}, "macro.dbt_utils.default__get_url_host": {"unique_id": "macro.dbt_utils.default__get_url_host", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "name": "default__get_url_host", "macro_sql": "{% macro default__get_url_host(field) -%}\n\n{%- set parsed =\n split_part(\n split_part(\n replace(\n replace(\n replace(field, \"'android-app://'\", \"''\"\n ), \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n\n-%}\n\n\n {{ dbt.safe_cast(\n parsed,\n type_string()\n )}}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.split_part", "macro.dbt.replace", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.851137, "supported_languages": null}, "macro.dbt_utils.get_url_path": {"unique_id": "macro.dbt_utils.get_url_path", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "name": "get_url_path", "macro_sql": "{% macro get_url_path(field) -%}\n {{ return(adapter.dispatch('get_url_path', 'dbt_utils')(field)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_path"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.851636, "supported_languages": null}, "macro.dbt_utils.default__get_url_path": {"unique_id": "macro.dbt_utils.default__get_url_path", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "name": "default__get_url_path", "macro_sql": "{% macro default__get_url_path(field) -%}\n\n {%- set stripped_url =\n replace(\n replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{ position(\"'/'\", stripped_url) }}, 0),\n {{ position(\"'?'\", stripped_url) }} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n split_part(\n right(\n stripped_url,\n length(stripped_url) ~ \"-\" ~ first_slash_pos\n ),\n \"'?'\", 1\n )\n -%}\n\n {{ safe_cast(\n parsed_path,\n type_string()\n )}}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.position", "macro.dbt.split_part", "macro.dbt.right", "macro.dbt.length", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.852205, "supported_languages": null}, "macro.dbt_utils.get_url_parameter": {"unique_id": "macro.dbt_utils.get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "name": "get_url_parameter", "macro_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n {{ return(adapter.dispatch('get_url_parameter', 'dbt_utils')(field, url_parameter)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.852567, "supported_languages": null}, "macro.dbt_utils.default__get_url_parameter": {"unique_id": "macro.dbt_utils.default__get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "name": "default__get_url_parameter", "macro_sql": "{% macro default__get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = split_part(split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.852862, "supported_languages": null}, "macro.dbt_utils.test_fewer_rows_than": {"unique_id": "macro.dbt_utils.test_fewer_rows_than", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "name": "test_fewer_rows_than", "macro_sql": "{% test fewer_rows_than(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_fewer_rows_than', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_fewer_rows_than"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.853903, "supported_languages": null}, "macro.dbt_utils.default__test_fewer_rows_than": {"unique_id": "macro.dbt_utils.default__test_fewer_rows_than", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "name": "default__test_fewer_rows_than", "macro_sql": "{% macro default__test_fewer_rows_than(model, compare_model, group_by_columns) %}\n\n{{ config(fail_calc = 'sum(coalesce(row_count_delta, 0))') }}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in equal_rowcount. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_fewer_rows_than'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_our_model \n from {{ model }}\n {{ groupby_gb_cols }}\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_comparison_model \n from {{ compare_model }}\n {{ groupby_gb_cols }}\n\n),\ncounts as (\n\n select\n\n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_our_model,\n count_comparison_model\n from a\n full join b on \n a.id_dbtutils_test_fewer_rows_than = b.id_dbtutils_test_fewer_rows_than\n {{ join_gb_cols }}\n\n),\nfinal as (\n\n select *,\n case\n -- fail the test if we have more rows than the reference model and return the row count delta\n when count_our_model > count_comparison_model then (count_our_model - count_comparison_model)\n -- fail the test if they are the same number\n when count_our_model = count_comparison_model then 1\n -- pass the test if the delta is positive (i.e. return the number 0)\n else 0\n end as row_count_delta\n from counts\n\n)\n\nselect * from final\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8550599, "supported_languages": null}, "macro.dbt_utils.test_equal_rowcount": {"unique_id": "macro.dbt_utils.test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "name": "test_equal_rowcount", "macro_sql": "{% test equal_rowcount(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_equal_rowcount', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_equal_rowcount"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8560839, "supported_languages": null}, "macro.dbt_utils.default__test_equal_rowcount": {"unique_id": "macro.dbt_utils.default__test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "name": "default__test_equal_rowcount", "macro_sql": "{% macro default__test_equal_rowcount(model, compare_model, group_by_columns) %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = 'sum(coalesce(diff_count, 0))') }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(', ') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in fewer_rows_than. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_equal_rowcount'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_a \n from {{ model }}\n {{groupby_gb_cols}}\n\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_b \n from {{ compare_model }}\n {{groupby_gb_cols}}\n\n),\nfinal as (\n\n select\n \n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_a,\n count_b,\n abs(count_a - count_b) as diff_count\n\n from a\n full join b\n on\n a.id_dbtutils_test_equal_rowcount = b.id_dbtutils_test_equal_rowcount\n {{join_gb_cols}}\n\n\n)\n\nselect * from final\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.857192, "supported_languages": null}, "macro.dbt_utils.test_relationships_where": {"unique_id": "macro.dbt_utils.test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "name": "test_relationships_where", "macro_sql": "{% test relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n {{ return(adapter.dispatch('test_relationships_where', 'dbt_utils')(model, column_name, to, field, from_condition, to_condition)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_relationships_where"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8578959, "supported_languages": null}, "macro.dbt_utils.default__test_relationships_where": {"unique_id": "macro.dbt_utils.default__test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "name": "default__test_relationships_where", "macro_sql": "{% macro default__test_relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n\nwith left_table as (\n\n select\n {{column_name}} as id\n\n from {{model}}\n\n where {{column_name}} is not null\n and {{from_condition}}\n\n),\n\nright_table as (\n\n select\n {{field}} as id\n\n from {{to}}\n\n where {{field}} is not null\n and {{to_condition}}\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.858222, "supported_languages": null}, "macro.dbt_utils.test_recency": {"unique_id": "macro.dbt_utils.test_recency", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "name": "test_recency", "macro_sql": "{% test recency(model, field, datepart, interval, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_recency', 'dbt_utils')(model, field, datepart, interval, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_recency"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8588412, "supported_languages": null}, "macro.dbt_utils.default__test_recency": {"unique_id": "macro.dbt_utils.default__test_recency", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "name": "default__test_recency", "macro_sql": "{% macro default__test_recency(model, field, datepart, interval, group_by_columns) %}\n\n{% set threshold = dateadd(datepart, interval * -1, current_timestamp_backcompat()) %}\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nwith recency as (\n\n select \n\n {{ select_gb_cols }}\n max({{field}}) as most_recent\n\n from {{ model }}\n\n {{ groupby_gb_cols }}\n\n)\n\nselect\n\n {{ select_gb_cols }}\n most_recent,\n {{ threshold }} as threshold\n\nfrom recency\nwhere most_recent < {{ threshold }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.859479, "supported_languages": null}, "macro.dbt_utils.test_not_constant": {"unique_id": "macro.dbt_utils.test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "name": "test_not_constant", "macro_sql": "{% test not_constant(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_constant', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_constant"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8599749, "supported_languages": null}, "macro.dbt_utils.default__test_not_constant": {"unique_id": "macro.dbt_utils.default__test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "name": "default__test_not_constant", "macro_sql": "{% macro default__test_not_constant(model, column_name, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nselect\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count(distinct {{ column_name }}) as filler_column\n\nfrom {{ model }}\n\n {{groupby_gb_cols}}\n\nhaving count(distinct {{ column_name }}) = 1\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.860474, "supported_languages": null}, "macro.dbt_utils.test_accepted_range": {"unique_id": "macro.dbt_utils.test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "name": "test_accepted_range", "macro_sql": "{% test accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n {{ return(adapter.dispatch('test_accepted_range', 'dbt_utils')(model, column_name, min_value, max_value, inclusive)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_accepted_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8611772, "supported_languages": null}, "macro.dbt_utils.default__test_accepted_range": {"unique_id": "macro.dbt_utils.default__test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "name": "default__test_accepted_range", "macro_sql": "{% macro default__test_accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n\nwith meet_condition as(\n select *\n from {{ model }}\n),\n\nvalidation_errors as (\n select *\n from meet_condition\n where\n -- never true, defaults to an empty result set. Exists to ensure any combo of the `or` clauses below succeeds\n 1 = 2\n\n {%- if min_value is not none %}\n -- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} > {{- \"=\" if inclusive }} {{ min_value }}\n {%- endif %}\n\n {%- if max_value is not none %}\n -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} < {{- \"=\" if inclusive }} {{ max_value }}\n {%- endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.861645, "supported_languages": null}, "macro.dbt_utils.test_not_accepted_values": {"unique_id": "macro.dbt_utils.test_not_accepted_values", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "name": "test_not_accepted_values", "macro_sql": "{% test not_accepted_values(model, column_name, values, quote=True) %}\n {{ return(adapter.dispatch('test_not_accepted_values', 'dbt_utils')(model, column_name, values, quote)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8622332, "supported_languages": null}, "macro.dbt_utils.default__test_not_accepted_values": {"unique_id": "macro.dbt_utils.default__test_not_accepted_values", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "name": "default__test_not_accepted_values", "macro_sql": "{% macro default__test_not_accepted_values(model, column_name, values, quote=True) %}\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.862705, "supported_languages": null}, "macro.dbt_utils.test_at_least_one": {"unique_id": "macro.dbt_utils.test_at_least_one", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "name": "test_at_least_one", "macro_sql": "{% test at_least_one(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_at_least_one', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_at_least_one"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8632078, "supported_languages": null}, "macro.dbt_utils.default__test_at_least_one": {"unique_id": "macro.dbt_utils.default__test_at_least_one", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "name": "default__test_at_least_one", "macro_sql": "{% macro default__test_at_least_one(model, column_name, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nselect *\nfrom (\n select\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count({{ column_name }}) as filler_column\n\n from {{ model }}\n\n {{groupby_gb_cols}}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.86365, "supported_languages": null}, "macro.dbt_utils.test_unique_combination_of_columns": {"unique_id": "macro.dbt_utils.test_unique_combination_of_columns", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "name": "test_unique_combination_of_columns", "macro_sql": "{% test unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n {{ return(adapter.dispatch('test_unique_combination_of_columns', 'dbt_utils')(model, combination_of_columns, quote_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_combination_of_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.864301, "supported_languages": null}, "macro.dbt_utils.default__test_unique_combination_of_columns": {"unique_id": "macro.dbt_utils.default__test_unique_combination_of_columns", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "name": "default__test_unique_combination_of_columns", "macro_sql": "{% macro default__test_unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n\n{% if not quote_columns %}\n {%- set column_list=combination_of_columns %}\n{% elif quote_columns %}\n {%- set column_list=[] %}\n {% for column in combination_of_columns -%}\n {% set column_list = column_list.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set columns_csv=column_list | join(', ') %}\n\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.864922, "supported_languages": null}, "macro.dbt_utils.test_cardinality_equality": {"unique_id": "macro.dbt_utils.test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "name": "test_cardinality_equality", "macro_sql": "{% test cardinality_equality(model, column_name, to, field) %}\n {{ return(adapter.dispatch('test_cardinality_equality', 'dbt_utils')(model, column_name, to, field)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_cardinality_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.865514, "supported_languages": null}, "macro.dbt_utils.default__test_cardinality_equality": {"unique_id": "macro.dbt_utils.default__test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "name": "default__test_cardinality_equality", "macro_sql": "{% macro default__test_cardinality_equality(model, column_name, to, field) %}\n\n{# T-SQL does not let you use numbers as aliases for columns #}\n{# Thus, no \"GROUP BY 1\" #}\n\nwith table_a as (\nselect\n {{ column_name }},\n count(*) as num_rows\nfrom {{ model }}\ngroup by {{ column_name }}\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by {{ field }}\n),\n\nexcept_a as (\n select *\n from table_a\n {{ except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ except() }}\n select *\n from table_a\n),\n\nunioned as (\n select *\n from except_a\n union all\n select *\n from except_b\n)\n\nselect *\nfrom unioned\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8658261, "supported_languages": null}, "macro.dbt_utils.test_expression_is_true": {"unique_id": "macro.dbt_utils.test_expression_is_true", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "name": "test_expression_is_true", "macro_sql": "{% test expression_is_true(model, expression, column_name=None, condition='1=1') %}\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n {{ return(adapter.dispatch('test_expression_is_true', 'dbt_utils')(model, expression, column_name, condition)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.866348, "supported_languages": null}, "macro.dbt_utils.default__test_expression_is_true": {"unique_id": "macro.dbt_utils.default__test_expression_is_true", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "name": "default__test_expression_is_true", "macro_sql": "{% macro default__test_expression_is_true(model, expression, column_name, condition) %}\n\n{% set column_list = '*' if should_store_failures() else \"1\" %}\n\nwith meet_condition as (\n select * from {{ model }} where {{ condition }}\n)\n\nselect\n {{ column_list }}\nfrom meet_condition\n{% if column_name is none %}\nwhere not({{ expression }})\n{%- else %}\nwhere not({{ column_name }} {{ expression }})\n{%- endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.866724, "supported_languages": null}, "macro.dbt_utils.test_not_null_proportion": {"unique_id": "macro.dbt_utils.test_not_null_proportion", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "name": "test_not_null_proportion", "macro_sql": "{% macro test_not_null_proportion(model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_null_proportion', 'dbt_utils')(model, group_by_columns, **kwargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_proportion"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.867383, "supported_languages": null}, "macro.dbt_utils.default__test_not_null_proportion": {"unique_id": "macro.dbt_utils.default__test_not_null_proportion", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "name": "default__test_not_null_proportion", "macro_sql": "{% macro default__test_not_null_proportion(model, group_by_columns) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n{% set at_least = kwargs.get('at_least', kwargs.get('arg')) %}\n{% set at_most = kwargs.get('at_most', kwargs.get('arg', 1)) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith validation as (\n select\n {{select_gb_cols}}\n sum(case when {{ column_name }} is null then 0 else 1 end) / cast(count(*) as numeric) as not_null_proportion\n from {{ model }}\n {{groupby_gb_cols}}\n),\nvalidation_errors as (\n select\n {{select_gb_cols}}\n not_null_proportion\n from validation\n where not_null_proportion < {{ at_least }} or not_null_proportion > {{ at_most }}\n)\nselect\n *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.868204, "supported_languages": null}, "macro.dbt_utils.test_sequential_values": {"unique_id": "macro.dbt_utils.test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "name": "test_sequential_values", "macro_sql": "{% test sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n {{ return(adapter.dispatch('test_sequential_values', 'dbt_utils')(model, column_name, interval, datepart, group_by_columns)) }}\n\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_sequential_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.869205, "supported_languages": null}, "macro.dbt_utils.default__test_sequential_values": {"unique_id": "macro.dbt_utils.default__test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "name": "default__test_sequential_values", "macro_sql": "{% macro default__test_sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n{% set previous_column_name = \"previous_\" ~ dbt_utils.slugify(column_name) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(',') + ', ' %}\n {% set partition_gb_cols = 'partition by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith windowed as (\n\n select\n {{ select_gb_cols }}\n {{ column_name }},\n lag({{ column_name }}) over (\n {{partition_gb_cols}}\n order by {{ column_name }}\n ) as {{ previous_column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ type_timestamp() }})= cast({{ dateadd(datepart, interval, previous_column_name) }} as {{ type_timestamp() }}))\n {% else %}\n where not({{ column_name }} = {{ previous_column_name }} + {{ interval }})\n {% endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.slugify", "macro.dbt.type_timestamp", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.870076, "supported_languages": null}, "macro.dbt_utils.test_equality": {"unique_id": "macro.dbt_utils.test_equality", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "name": "test_equality", "macro_sql": "{% test equality(model, compare_model, compare_columns=None) %}\n {{ return(adapter.dispatch('test_equality', 'dbt_utils')(model, compare_model, compare_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.870859, "supported_languages": null}, "macro.dbt_utils.default__test_equality": {"unique_id": "macro.dbt_utils.default__test_equality", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "name": "default__test_equality", "macro_sql": "{% macro default__test_equality(model, compare_model, compare_columns=None) %}\n\n{% set set_diff %}\n count(*) + coalesce(abs(\n sum(case when which_diff = 'a_minus_b' then 1 else 0 end) -\n sum(case when which_diff = 'b_minus_a' then 1 else 0 end)\n ), 0)\n{% endset %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = set_diff) }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n-- setup\n{%- do dbt_utils._is_relation(model, 'test_equality') -%}\n\n{#-\nIf the compare_cols arg is provided, we can run this test without querying the\ninformation schema\u00a0\u2014 this allows the model to be an ephemeral model\n-#}\n\n{%- if not compare_columns -%}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set compare_columns = adapter.get_columns_in_relation(model) | map(attribute='quoted') -%}\n{%- endif -%}\n\n{% set compare_cols_csv = compare_columns | join(', ') %}\n\nwith a as (\n\n select * from {{ model }}\n\n),\n\nb as (\n\n select * from {{ compare_model }}\n\n),\n\na_minus_b as (\n\n select {{compare_cols_csv}} from a\n {{ except() }}\n select {{compare_cols_csv}} from b\n\n),\n\nb_minus_a as (\n\n select {{compare_cols_csv}} from b\n {{ except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select 'a_minus_b' as which_diff, a_minus_b.* from a_minus_b\n union all\n select 'b_minus_a' as which_diff, b_minus_a.* from b_minus_a\n\n)\n\nselect * from unioned\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.871711, "supported_languages": null}, "macro.dbt_utils.test_not_empty_string": {"unique_id": "macro.dbt_utils.test_not_empty_string", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "name": "test_not_empty_string", "macro_sql": "{% test not_empty_string(model, column_name, trim_whitespace=true) %}\n\n {{ return(adapter.dispatch('test_not_empty_string', 'dbt_utils')(model, column_name, trim_whitespace)) }}\n\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_empty_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8722649, "supported_languages": null}, "macro.dbt_utils.default__test_not_empty_string": {"unique_id": "macro.dbt_utils.default__test_not_empty_string", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "name": "default__test_not_empty_string", "macro_sql": "{% macro default__test_not_empty_string(model, column_name, trim_whitespace=true) %}\n\n with\n \n all_values as (\n\n select \n\n\n {% if trim_whitespace == true -%}\n\n trim({{ column_name }}) as {{ column_name }}\n\n {%- else -%}\n\n {{ column_name }}\n\n {%- endif %}\n \n from {{ model }}\n\n ),\n\n errors as (\n\n select * from all_values\n where {{ column_name }} = ''\n\n )\n\n select * from errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8725471, "supported_languages": null}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "name": "test_mutually_exclusive_ranges", "macro_sql": "{% test mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', 'dbt_utils')(model, lower_bound_column, upper_bound_column, partition_by, gaps, zero_length_range_allowed)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_mutually_exclusive_ranges"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8757892, "supported_languages": null}, "macro.dbt_utils.default__test_mutually_exclusive_ranges": {"unique_id": "macro.dbt_utils.default__test_mutually_exclusive_ranges", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "name": "default__test_mutually_exclusive_ranges", "macro_sql": "{% macro default__test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n{% if gaps == 'not_allowed' %}\n {% set allow_gaps_operator='=' %}\n {% set allow_gaps_operator_in_words='equal_to' %}\n{% elif gaps == 'allowed' %}\n {% set allow_gaps_operator='<=' %}\n {% set allow_gaps_operator_in_words='less_than_or_equal_to' %}\n{% elif gaps == 'required' %}\n {% set allow_gaps_operator='<' %}\n {% set allow_gaps_operator_in_words='less_than' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '\" ~ gaps ~\"'.'\"\n ) }}\n{% endif %}\n{% if not zero_length_range_allowed %}\n {% set allow_zero_length_operator='<' %}\n {% set allow_zero_length_operator_in_words='less_than' %}\n{% elif zero_length_range_allowed %}\n {% set allow_zero_length_operator='<=' %}\n {% set allow_zero_length_operator_in_words='less_than_or_equal_to' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`zero_length_range_allowed` argument for mutually_exclusive_ranges test must be one of [true, false] Got: '\" ~ zero_length_range_allowed ~\"'.'\"\n ) }}\n{% endif %}\n\n{% set partition_clause=\"partition by \" ~ partition_by if partition_by else '' %}\n\nwith window_functions as (\n\n select\n {% if partition_by %}\n {{ partition_by }} as partition_by_col,\n {% endif %}\n {{ lower_bound_column }} as lower_bound,\n {{ upper_bound_column }} as upper_bound,\n\n lead({{ lower_bound_column }}) over (\n {{ partition_clause }}\n order by {{ lower_bound_column }}, {{ upper_bound_column }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_bound_column }} desc, {{ upper_bound_column }} desc\n ) = 1 as is_last_record\n\n from {{ model }}\n\n),\n\ncalc as (\n -- We want to return records where one of our assumptions fails, so we'll use\n -- the `not` function with `and` statements so we can write our assumptions more cleanly\n select\n *,\n\n -- For each record: lower_bound should be < upper_bound.\n -- Coalesce it to return an error on the null case (implicit assumption\n -- these columns are not_null)\n coalesce(\n lower_bound {{ allow_zero_length_operator }} upper_bound,\n false\n ) as lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect * from validation_errors\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.877408, "supported_languages": null}, "macro.dbt_utils.pretty_log_format": {"unique_id": "macro.dbt_utils.pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "name": "pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n {{ return(adapter.dispatch('pretty_log_format', 'dbt_utils')(message)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.877815, "supported_languages": null}, "macro.dbt_utils.default__pretty_log_format": {"unique_id": "macro.dbt_utils.default__pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "name": "default__pretty_log_format", "macro_sql": "{% macro default__pretty_log_format(message) %}\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.877989, "supported_languages": null}, "macro.dbt_utils._is_relation": {"unique_id": "macro.dbt_utils._is_relation", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/_is_relation.sql", "original_file_path": "macros/jinja_helpers/_is_relation.sql", "name": "_is_relation", "macro_sql": "{% macro _is_relation(obj, macro) %}\n {%- if not (obj is mapping and obj.get('metadata', {}).get('type', '').endswith('Relation')) -%}\n {%- do exceptions.raise_compiler_error(\"Macro \" ~ macro ~ \" expected a Relation but received the value: \" ~ obj) -%}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8785121, "supported_languages": null}, "macro.dbt_utils.pretty_time": {"unique_id": "macro.dbt_utils.pretty_time", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "name": "pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n {{ return(adapter.dispatch('pretty_time', 'dbt_utils')(format)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.878845, "supported_languages": null}, "macro.dbt_utils.default__pretty_time": {"unique_id": "macro.dbt_utils.default__pretty_time", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "name": "default__pretty_time", "macro_sql": "{% macro default__pretty_time(format='%H:%M:%S') %}\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8790421, "supported_languages": null}, "macro.dbt_utils.log_info": {"unique_id": "macro.dbt_utils.log_info", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "name": "log_info", "macro_sql": "{% macro log_info(message) %}\n {{ return(adapter.dispatch('log_info', 'dbt_utils')(message)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__log_info"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.879354, "supported_languages": null}, "macro.dbt_utils.default__log_info": {"unique_id": "macro.dbt_utils.default__log_info", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "name": "default__log_info", "macro_sql": "{% macro default__log_info(message) %}\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.879522, "supported_languages": null}, "macro.dbt_utils.slugify": {"unique_id": "macro.dbt_utils.slugify", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/slugify.sql", "original_file_path": "macros/jinja_helpers/slugify.sql", "name": "slugify", "macro_sql": "{% macro slugify(string) %}\n\n{#- Lower case the string -#}\n{% set string = string | lower %}\n{#- Replace spaces and dashes with underscores -#}\n{% set string = modules.re.sub('[ -]+', '_', string) %}\n{#- Only take letters, numbers, and underscores -#}\n{% set string = modules.re.sub('[^a-z0-9_]+', '', string) %}\n\n{{ return(string) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.880039, "supported_languages": null}, "macro.dbt_utils._is_ephemeral": {"unique_id": "macro.dbt_utils._is_ephemeral", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/_is_ephemeral.sql", "original_file_path": "macros/jinja_helpers/_is_ephemeral.sql", "name": "_is_ephemeral", "macro_sql": "{% macro _is_ephemeral(obj, macro) %}\n {%- if obj.is_cte -%}\n {% set ephemeral_prefix = api.Relation.add_ephemeral_prefix('') %}\n {% if obj.name.startswith(ephemeral_prefix) %}\n {% set model_name = obj.name[(ephemeral_prefix|length):] %}\n {% else %}\n {% set model_name = obj.name %}\n {%- endif -%}\n {% set error_message %}\nThe `{{ macro }}` macro cannot be used with ephemeral models, as it relies on the information schema.\n\n`{{ model_name }}` is an ephemeral model. Consider making it a view or table instead.\n {% endset %}\n {%- do exceptions.raise_compiler_error(error_message) -%}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8808901, "supported_languages": null}, "macro.dbt_utils.get_intervals_between": {"unique_id": "macro.dbt_utils.get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_utils')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.881589, "supported_languages": null}, "macro.dbt_utils.default__get_intervals_between": {"unique_id": "macro.dbt_utils.default__get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.882171, "supported_languages": null}, "macro.dbt_utils.date_spine": {"unique_id": "macro.dbt_utils.date_spine", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_utils')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.882401, "supported_languages": null}, "macro.dbt_utils.default__date_spine": {"unique_id": "macro.dbt_utils.default__date_spine", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{dbt_utils.generate_series(\n dbt_utils.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n),\n\nall_periods as (\n\n select (\n {{\n dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.generate_series", "macro.dbt_utils.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.882752, "supported_languages": null}, "macro.dbt_utils.nullcheck_table": {"unique_id": "macro.dbt_utils.nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "name": "nullcheck_table", "macro_sql": "{% macro nullcheck_table(relation) %}\n {{ return(adapter.dispatch('nullcheck_table', 'dbt_utils')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.883142, "supported_languages": null}, "macro.dbt_utils.default__nullcheck_table": {"unique_id": "macro.dbt_utils.default__nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "name": "default__nullcheck_table", "macro_sql": "{% macro default__nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(relation, 'nullcheck_table') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'nullcheck_table') -%}\n {% set cols = adapter.get_columns_in_relation(relation) %}\n\n select {{ dbt_utils.nullcheck(cols) }}\n from {{relation}}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.883498, "supported_languages": null}, "macro.dbt_utils.get_relations_by_pattern": {"unique_id": "macro.dbt_utils.get_relations_by_pattern", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "name": "get_relations_by_pattern", "macro_sql": "{% macro get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_pattern', 'dbt_utils')(schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.884325, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_pattern": {"unique_id": "macro.dbt_utils.default__get_relations_by_pattern", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "name": "default__get_relations_by_pattern", "macro_sql": "{% macro default__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8852842, "supported_languages": null}, "macro.dbt_utils.get_powers_of_two": {"unique_id": "macro.dbt_utils.get_powers_of_two", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8862028, "supported_languages": null}, "macro.dbt_utils.default__get_powers_of_two": {"unique_id": "macro.dbt_utils.default__get_powers_of_two", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.886629, "supported_languages": null}, "macro.dbt_utils.generate_series": {"unique_id": "macro.dbt_utils.generate_series", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.886816, "supported_languages": null}, "macro.dbt_utils.default__generate_series": {"unique_id": "macro.dbt_utils.default__generate_series", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_utils.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8873138, "supported_languages": null}, "macro.dbt_utils.get_relations_by_prefix": {"unique_id": "macro.dbt_utils.get_relations_by_prefix", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "name": "get_relations_by_prefix", "macro_sql": "{% macro get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_prefix', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.888022, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_prefix": {"unique_id": "macro.dbt_utils.default__get_relations_by_prefix", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "name": "default__get_relations_by_prefix", "macro_sql": "{% macro default__get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_prefix_sql(schema, prefix, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.888832, "supported_languages": null}, "macro.dbt_utils.get_tables_by_prefix_sql": {"unique_id": "macro.dbt_utils.get_tables_by_prefix_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "name": "get_tables_by_prefix_sql", "macro_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_prefix_sql', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8892941, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_prefix_sql": {"unique_id": "macro.dbt_utils.default__get_tables_by_prefix_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "name": "default__get_tables_by_prefix_sql", "macro_sql": "{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(\n schema_pattern = schema,\n table_pattern = prefix ~ '%',\n exclude = exclude,\n database = database\n ) }}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.889586, "supported_languages": null}, "macro.dbt_utils.star": {"unique_id": "macro.dbt_utils.star", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "name": "star", "macro_sql": "{% macro star(from, relation_alias=False, except=[], prefix='', suffix='') -%}\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, prefix, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.8903198, "supported_languages": null}, "macro.dbt_utils.default__star": {"unique_id": "macro.dbt_utils.default__star", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "name": "default__star", "macro_sql": "{% macro default__star(from, relation_alias=False, except=[], prefix='', suffix='') -%}\n {%- do dbt_utils._is_relation(from, 'star') -%}\n {%- do dbt_utils._is_ephemeral(from, 'star') -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return('*') }}\n {%- endif -%}\n\n {% set cols = dbt_utils.get_filtered_columns_in_relation(from, except) %}\n\n {%- if cols|length <= 0 -%}\n {{- return('*') -}}\n {%- else -%}\n {%- for col in cols %}\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}{{ adapter.quote(col)|trim }} {%- if prefix!='' or suffix!='' %} as {{ adapter.quote(prefix ~ col ~ suffix)|trim }} {%- endif -%}\n {%- if not loop.last %},{{ '\\n ' }}{% endif %}\n {%- endfor -%}\n {% endif %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.891268, "supported_languages": null}, "macro.dbt_utils.unpivot": {"unique_id": "macro.dbt_utils.unpivot", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "name": "unpivot", "macro_sql": "{% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value') -%}\n {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.892538, "supported_languages": null}, "macro.dbt_utils.default__unpivot": {"unique_id": "macro.dbt_utils.default__unpivot", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "name": "default__unpivot", "macro_sql": "{% macro default__unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value') -%}\n\n {% if not relation %}\n {{ exceptions.raise_compiler_error(\"Error: argument `relation` is required for `unpivot` macro.\") }}\n {% endif %}\n\n {%- set exclude = exclude if exclude is not none else [] %}\n {%- set remove = remove if remove is not none else [] %}\n\n {%- set include_cols = [] %}\n\n {%- set table_columns = {} %}\n\n {%- do table_columns.update({relation: []}) %}\n\n {%- do dbt_utils._is_relation(relation, 'unpivot') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'unpivot') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) %}\n\n {%- for col in cols -%}\n {%- if col.column.lower() not in remove|map('lower') and col.column.lower() not in exclude|map('lower') -%}\n {% do include_cols.append(col) %}\n {%- endif %}\n {%- endfor %}\n\n\n {%- for col in include_cols -%}\n select\n {%- for exclude_col in exclude %}\n {{ exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ type_string() }}) as {{ field_name }},\n cast( {% if col.data_type == 'boolean' %}\n {{ cast_bool_to_text(col.column) }}\n {% else %}\n {{ col.column }}\n {% endif %}\n as {{ cast_to }}) as {{ value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_string", "macro.dbt.cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.89451, "supported_languages": null}, "macro.dbt_utils.union_relations": {"unique_id": "macro.dbt_utils.union_relations", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "name": "union_relations", "macro_sql": "{%- macro union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n {{ return(adapter.dispatch('union_relations', 'dbt_utils')(relations, column_override, include, exclude, source_column_name, where)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.897519, "supported_languages": null}, "macro.dbt_utils.default__union_relations": {"unique_id": "macro.dbt_utils.default__union_relations", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "name": "default__union_relations", "macro_sql": "\n\n{%- macro default__union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n cast({{ string_literal(relation) }} as {{ type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ relation }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9008808, "supported_languages": null}, "macro.dbt_utils.group_by": {"unique_id": "macro.dbt_utils.group_by", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "name": "group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_utils')(n)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.901247, "supported_languages": null}, "macro.dbt_utils.default__group_by": {"unique_id": "macro.dbt_utils.default__group_by", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "name": "default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }} \n {%- endfor -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.901493, "supported_languages": null}, "macro.dbt_utils.deduplicate": {"unique_id": "macro.dbt_utils.deduplicate", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "deduplicate", "macro_sql": "{%- macro deduplicate(relation, partition_by, order_by) -%}\n {{ return(adapter.dispatch('deduplicate', 'dbt_utils')(relation, partition_by, order_by)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.902269, "supported_languages": null}, "macro.dbt_utils.default__deduplicate": {"unique_id": "macro.dbt_utils.default__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "default__deduplicate", "macro_sql": "\n\n{%- macro default__deduplicate(relation, partition_by, order_by) -%}\n\n with row_numbered as (\n select\n _inner.*,\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) as rn\n from {{ relation }} as _inner\n )\n\n select\n distinct data.*\n from {{ relation }} as data\n {#\n -- Not all DBs will support natural joins but the ones that do include:\n -- Oracle, MySQL, SQLite, Redshift, Teradata, Materialize, Databricks\n -- Apache Spark, SingleStore, Vertica\n -- Those that do not appear to support natural joins include:\n -- SQLServer, Trino, Presto, Rockset, Athena\n #}\n natural join row_numbered\n where row_numbered.rn = 1\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9024792, "supported_languages": null}, "macro.dbt_utils.redshift__deduplicate": {"unique_id": "macro.dbt_utils.redshift__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "redshift__deduplicate", "macro_sql": "{% macro redshift__deduplicate(relation, partition_by, order_by) -%}\n\n {{ return(dbt_utils.default__deduplicate(relation, partition_by, order_by=order_by)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.902677, "supported_languages": null}, "macro.dbt_utils.postgres__deduplicate": {"unique_id": "macro.dbt_utils.postgres__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "postgres__deduplicate", "macro_sql": "\n{%- macro postgres__deduplicate(relation, partition_by, order_by) -%}\n\n select\n distinct on ({{ partition_by }}) *\n from {{ relation }}\n order by {{ partition_by }}{{ ',' ~ order_by }}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.902865, "supported_languages": null}, "macro.dbt_utils.snowflake__deduplicate": {"unique_id": "macro.dbt_utils.snowflake__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "snowflake__deduplicate", "macro_sql": "\n{%- macro snowflake__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.903027, "supported_languages": null}, "macro.dbt_utils.bigquery__deduplicate": {"unique_id": "macro.dbt_utils.bigquery__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "bigquery__deduplicate", "macro_sql": "\n{%- macro bigquery__deduplicate(relation, partition_by, order_by) -%}\n\n select unique.*\n from (\n select\n array_agg (\n original\n order by {{ order_by }}\n limit 1\n )[offset(0)] unique\n from {{ relation }} original\n group by {{ partition_by }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.903193, "supported_languages": null}, "macro.dbt_utils.surrogate_key": {"unique_id": "macro.dbt_utils.surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "name": "surrogate_key", "macro_sql": "{%- macro surrogate_key(field_list) -%}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('surrogate_key', 'dbt_utils')(field_list, *varargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9036312, "supported_languages": null}, "macro.dbt_utils.default__surrogate_key": {"unique_id": "macro.dbt_utils.default__surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "name": "default__surrogate_key", "macro_sql": "\n\n{%- macro default__surrogate_key(field_list) -%}\n\n{%- set error_message = '\nWarning: `dbt_utils.surrogate_key` has been replaced by \\\n`dbt_utils.generate_surrogate_key`. The new macro treats null values \\\ndifferently to empty strings. To restore the behaviour of the original \\\nmacro, add a variable scoped to the dbt_utils package called \\\n`surrogate_key_treat_nulls_as_empty_strings` to your \\\ndbt_project.yml file with a value of True. \\\nThe {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9039848, "supported_languages": null}, "macro.dbt_utils.safe_add": {"unique_id": "macro.dbt_utils.safe_add", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "name": "safe_add", "macro_sql": "{%- macro safe_add(field_list) -%}\n {{ return(adapter.dispatch('safe_add', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__safe_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9045918, "supported_languages": null}, "macro.dbt_utils.default__safe_add": {"unique_id": "macro.dbt_utils.default__safe_add", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "name": "default__safe_add", "macro_sql": "\n\n{%- macro default__safe_add(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_add` macro now takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.warn(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9051762, "supported_languages": null}, "macro.dbt_utils.nullcheck": {"unique_id": "macro.dbt_utils.nullcheck", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "name": "nullcheck", "macro_sql": "{% macro nullcheck(cols) %}\n {{ return(adapter.dispatch('nullcheck', 'dbt_utils')(cols)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9056, "supported_languages": null}, "macro.dbt_utils.default__nullcheck": {"unique_id": "macro.dbt_utils.default__nullcheck", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "name": "default__nullcheck", "macro_sql": "{% macro default__nullcheck(cols) %}\n{%- for col in cols %}\n\n {% if col.is_string() -%}\n\n nullif({{col.name}},'') as {{col.name}}\n\n {%- else -%}\n\n {{col.name}}\n\n {%- endif -%}\n\n{%- if not loop.last -%} , {%- endif -%}\n\n{%- endfor -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9059331, "supported_languages": null}, "macro.dbt_utils.get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "get_tables_by_pattern_sql", "macro_sql": "{% macro get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_pattern_sql', 'dbt_utils')\n (schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.907543, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.default__get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "default__get_tables_by_pattern_sql", "macro_sql": "{% macro default__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.907915, "supported_languages": null}, "macro.dbt_utils.bigquery__get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.bigquery__get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "bigquery__get_tables_by_pattern_sql", "macro_sql": "{% macro bigquery__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% if '%' in schema_pattern %}\n {% set schemata=dbt_utils._bigquery__get_matching_schemata(schema_pattern, database) %}\n {% else %}\n {% set schemata=[schema_pattern] %}\n {% endif %}\n\n {% set sql %}\n {% for schema in schemata %}\n select distinct\n table_schema,\n table_name,\n {{ dbt_utils.get_table_types_sql() }}\n\n from {{ adapter.quote(database) }}.{{ schema }}.INFORMATION_SCHEMA.TABLES\n where lower(table_name) like lower ('{{ table_pattern }}')\n and lower(table_name) not like lower ('{{ exclude }}')\n\n {% if not loop.last %} union all {% endif %}\n\n {% endfor %}\n {% endset %}\n\n {{ return(sql) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._bigquery__get_matching_schemata", "macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.908704, "supported_languages": null}, "macro.dbt_utils._bigquery__get_matching_schemata": {"unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "_bigquery__get_matching_schemata", "macro_sql": "{% macro _bigquery__get_matching_schemata(schema_pattern, database) %}\n {% if execute %}\n\n {% set sql %}\n select schema_name from {{ adapter.quote(database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like lower('{{ schema_pattern }}')\n {% endset %}\n\n {% set results=run_query(sql) %}\n\n {% set schemata=results.columns['schema_name'].values() %}\n\n {{ return(schemata) }}\n\n {% else %}\n\n {{ return([]) }}\n\n {% endif %}\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.909206, "supported_languages": null}, "macro.dbt_utils.get_column_values": {"unique_id": "macro.dbt_utils.get_column_values", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "name": "get_column_values", "macro_sql": "{% macro get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {{ return(adapter.dispatch('get_column_values', 'dbt_utils')(table, column, order_by, max_records, default, where)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_column_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9103029, "supported_languages": null}, "macro.dbt_utils.default__get_column_values": {"unique_id": "macro.dbt_utils.default__get_column_values", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "name": "default__get_column_values", "macro_sql": "{% macro default__get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {% set default = [] if not default %}\n {{ return(default) }}\n {% endif %}\n\n {%- do dbt_utils._is_ephemeral(table, 'get_column_values') -%}\n\n {# Not all relations are tables. Renaming for internal clarity without breaking functionality for anyone using named arguments #}\n {# TODO: Change the method signature in a future 0.x.0 release #}\n {%- set target_relation = table -%}\n\n {# adapter.load_relation is a convenience wrapper to avoid building a Relation when we already have one #}\n {% set relation_exists = (load_relation(target_relation)) is not none %}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not relation_exists and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ target_relation ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not relation_exists and default is not none -%}\n\n {{ log(\"Relation \" ~ target_relation ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n\n {% if where is not none %}\n where {{ where }}\n {% endif %}\n\n group by {{ column }}\n order by {{ order_by }}\n\n {% if max_records is not none %}\n limit {{ max_records }}\n {% endif %}\n\n {% endif %}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_column_values') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values) }}\n {%- else -%}\n {{ return(default) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_ephemeral", "macro.dbt.load_relation", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.911798, "supported_languages": null}, "macro.dbt_utils.pivot": {"unique_id": "macro.dbt_utils.pivot", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "name": "pivot", "macro_sql": "{% macro pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {{ return(adapter.dispatch('pivot', 'dbt_utils')(column, values, alias, agg, cmp, prefix, suffix, then_value, else_value, quote_identifiers, distinct)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.912878, "supported_languages": null}, "macro.dbt_utils.default__pivot": {"unique_id": "macro.dbt_utils.default__pivot", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "name": "default__pivot", "macro_sql": "{% macro default__pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {% for value in values %}\n {{ agg }}(\n {% if distinct %} distinct {% endif %}\n case\n when {{ column }} {{ cmp }} '{{ escape_single_quotes(value) }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ value ~ suffix) }}\n {% else %}\n as {{ dbt_utils.slugify(prefix ~ value ~ suffix) }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.escape_single_quotes", "macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.913687, "supported_languages": null}, "macro.dbt_utils.get_filtered_columns_in_relation": {"unique_id": "macro.dbt_utils.get_filtered_columns_in_relation", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "name": "get_filtered_columns_in_relation", "macro_sql": "{% macro get_filtered_columns_in_relation(from, except=[]) -%}\n {{ return(adapter.dispatch('get_filtered_columns_in_relation', 'dbt_utils')(from, except)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.914192, "supported_languages": null}, "macro.dbt_utils.default__get_filtered_columns_in_relation": {"unique_id": "macro.dbt_utils.default__get_filtered_columns_in_relation", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "name": "default__get_filtered_columns_in_relation", "macro_sql": "{% macro default__get_filtered_columns_in_relation(from, except=[]) -%}\n {%- do dbt_utils._is_relation(from, 'get_filtered_columns_in_relation') -%}\n {%- do dbt_utils._is_ephemeral(from, 'get_filtered_columns_in_relation') -%}\n\n {# -- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return('') }}\n {% endif %}\n\n {%- set include_cols = [] %}\n {%- set cols = adapter.get_columns_in_relation(from) -%}\n {%- set except = except | map(\"lower\") | list %}\n {%- for col in cols -%}\n {%- if col.column|lower not in except -%}\n {% do include_cols.append(col.column) %}\n {%- endif %}\n {%- endfor %}\n\n {{ return(include_cols) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9149, "supported_languages": null}, "macro.dbt_utils.width_bucket": {"unique_id": "macro.dbt_utils.width_bucket", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "name": "width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ return(adapter.dispatch('width_bucket', 'dbt_utils') (expr, min_value, max_value, num_buckets)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__width_bucket"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.916281, "supported_languages": null}, "macro.dbt_utils.default__width_bucket": {"unique_id": "macro.dbt_utils.default__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "name": "default__width_bucket", "macro_sql": "{% macro default__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is eaxtly at the bucket egde\n case\n when\n mod(\n {{ dbt.safe_cast(expr, type_numeric() ) }},\n {{ dbt.safe_cast(bin_size, type_numeric() ) }}\n ) = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.916712, "supported_languages": null}, "macro.dbt_utils.redshift__width_bucket": {"unique_id": "macro.dbt_utils.redshift__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "name": "redshift__width_bucket", "macro_sql": "{% macro redshift__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is exactly at the bucket edge\n case\n when\n {{ dbt.safe_cast(expr, type_numeric() ) }} %\n {{ dbt.safe_cast(bin_size, type_numeric() ) }}\n = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.917154, "supported_languages": null}, "macro.dbt_utils.snowflake__width_bucket": {"unique_id": "macro.dbt_utils.snowflake__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "name": "snowflake__width_bucket", "macro_sql": "{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.917347, "supported_languages": null}, "macro.dbt_utils.get_query_results_as_dict": {"unique_id": "macro.dbt_utils.get_query_results_as_dict", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "name": "get_query_results_as_dict", "macro_sql": "{% macro get_query_results_as_dict(query) %}\n {{ return(adapter.dispatch('get_query_results_as_dict', 'dbt_utils')(query)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_query_results_as_dict"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9177759, "supported_languages": null}, "macro.dbt_utils.default__get_query_results_as_dict": {"unique_id": "macro.dbt_utils.default__get_query_results_as_dict", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "name": "default__get_query_results_as_dict", "macro_sql": "{% macro default__get_query_results_as_dict(query) %}\n\n{# This macro returns a dictionary of the form {column_name: (tuple_of_results)} #}\n\n {%- call statement('get_query_results', fetch_result=True,auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {% set sql_results={} %}\n\n {%- if execute -%}\n {% set sql_results_table = load_result('get_query_results').table.columns %}\n {% for column_name, column in sql_results_table.items() %}\n {% do sql_results.update({column_name: column.values()}) %}\n {% endfor %}\n {%- endif -%}\n\n {{ return(sql_results) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.918365, "supported_languages": null}, "macro.dbt_utils.generate_surrogate_key": {"unique_id": "macro.dbt_utils.generate_surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "name": "generate_surrogate_key", "macro_sql": "{%- macro generate_surrogate_key(field_list) -%}\n {{ return(adapter.dispatch('generate_surrogate_key', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__generate_surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.918856, "supported_languages": null}, "macro.dbt_utils.default__generate_surrogate_key": {"unique_id": "macro.dbt_utils.default__generate_surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "name": "default__generate_surrogate_key", "macro_sql": "\n\n{%- macro default__generate_surrogate_key(field_list) -%}\n\n{% if var('surrogate_key_treat_nulls_as_empty_strings', False) %}\n {% set default_null_value = \"\" %}\n{% else %}\n {% set default_null_value = '_dbt_utils_surrogate_key_null_'%}\n{% endif %}\n\n{%- set fields = [] -%}\n\n{%- for field in field_list -%}\n\n {%- do fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ type_string() ~ \"), '\" ~ default_null_value ~\"')\"\n ) -%}\n\n {%- if not loop.last %}\n {%- do fields.append(\"'-'\") -%}\n {%- endif -%}\n\n{%- endfor -%}\n\n{{ hash(concat(fields)) }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.hash", "macro.dbt.concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.919489, "supported_languages": null}, "macro.dbt_utils.get_table_types_sql": {"unique_id": "macro.dbt_utils.get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "name": "get_table_types_sql", "macro_sql": "{%- macro get_table_types_sql() -%}\n {{ return(adapter.dispatch('get_table_types_sql', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.919935, "supported_languages": null}, "macro.dbt_utils.default__get_table_types_sql": {"unique_id": "macro.dbt_utils.default__get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "name": "default__get_table_types_sql", "macro_sql": "{% macro default__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.92008, "supported_languages": null}, "macro.dbt_utils.postgres__get_table_types_sql": {"unique_id": "macro.dbt_utils.postgres__get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "name": "postgres__get_table_types_sql", "macro_sql": "{% macro postgres__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'FOREIGN' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.920226, "supported_languages": null}, "macro.dbt_utils.degrees_to_radians": {"unique_id": "macro.dbt_utils.degrees_to_radians", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "degrees_to_radians", "macro_sql": "{% macro degrees_to_radians(degrees) -%}\n acos(-1) * {{degrees}} / 180\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.921268, "supported_languages": null}, "macro.dbt_utils.haversine_distance": {"unique_id": "macro.dbt_utils.haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "haversine_distance", "macro_sql": "{% macro haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n {{ return(adapter.dispatch('haversine_distance', 'dbt_utils')(lat1,lon1,lat2,lon2,unit)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.921655, "supported_languages": null}, "macro.dbt_utils.default__haversine_distance": {"unique_id": "macro.dbt_utils.default__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n\n 2 * 3961 * asin(sqrt(power((sin(radians(({{ lat2 }} - {{ lat1 }}) / 2))), 2) +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n power((sin(radians(({{ lon2 }} - {{ lon1 }}) / 2))), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9222121, "supported_languages": null}, "macro.dbt_utils.bigquery__haversine_distance": {"unique_id": "macro.dbt_utils.bigquery__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "bigquery__haversine_distance", "macro_sql": "{% macro bigquery__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{% set radians_lat1 = dbt_utils.degrees_to_radians(lat1) %}\n{% set radians_lat2 = dbt_utils.degrees_to_radians(lat2) %}\n{% set radians_lon1 = dbt_utils.degrees_to_radians(lon1) %}\n{% set radians_lon2 = dbt_utils.degrees_to_radians(lon2) %}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n 2 * 3961 * asin(sqrt(power(sin(({{ radians_lat2 }} - {{ radians_lat1 }}) / 2), 2) +\n cos({{ radians_lat1 }}) * cos({{ radians_lat2 }}) *\n power(sin(({{ radians_lon2 }} - {{ radians_lon1 }}) / 2), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.degrees_to_radians"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.923002, "supported_languages": null}, "macro.fivetran_utils.enabled_vars": {"unique_id": "macro.fivetran_utils.enabled_vars", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/enabled_vars.sql", "original_file_path": "macros/enabled_vars.sql", "name": "enabled_vars", "macro_sql": "{% macro enabled_vars(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, True) == False %}\n {{ return(False) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(True) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9234781, "supported_languages": null}, "macro.fivetran_utils.percentile": {"unique_id": "macro.fivetran_utils.percentile", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "percentile", "macro_sql": "{% macro percentile(percentile_field, partition_field, percent) -%}\n\n{{ adapter.dispatch('percentile', 'fivetran_utils') (percentile_field, partition_field, percent) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__percentile"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9243991, "supported_languages": null}, "macro.fivetran_utils.default__percentile": {"unique_id": "macro.fivetran_utils.default__percentile", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "default__percentile", "macro_sql": "{% macro default__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.924562, "supported_languages": null}, "macro.fivetran_utils.redshift__percentile": {"unique_id": "macro.fivetran_utils.redshift__percentile", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "redshift__percentile", "macro_sql": "{% macro redshift__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.924722, "supported_languages": null}, "macro.fivetran_utils.bigquery__percentile": {"unique_id": "macro.fivetran_utils.bigquery__percentile", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "bigquery__percentile", "macro_sql": "{% macro bigquery__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.924882, "supported_languages": null}, "macro.fivetran_utils.postgres__percentile": {"unique_id": "macro.fivetran_utils.postgres__percentile", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "postgres__percentile", "macro_sql": "{% macro postgres__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n /* have to group by partition field */\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.925023, "supported_languages": null}, "macro.fivetran_utils.spark__percentile": {"unique_id": "macro.fivetran_utils.spark__percentile", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "spark__percentile", "macro_sql": "{% macro spark__percentile(percentile_field, partition_field, percent) %}\n\n percentile( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9251761, "supported_languages": null}, "macro.fivetran_utils.pivot_json_extract": {"unique_id": "macro.fivetran_utils.pivot_json_extract", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/pivot_json_extract.sql", "original_file_path": "macros/pivot_json_extract.sql", "name": "pivot_json_extract", "macro_sql": "{% macro pivot_json_extract(string, list_of_properties) %}\n\n{%- for property in list_of_properties -%}\n\nreplace( {{ fivetran_utils.json_extract(string, property) }}, '\"', '') as {{ property | replace(' ', '_') | lower }}\n\n{%- if not loop.last -%},{%- endif %}\n{% endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.925647, "supported_languages": null}, "macro.fivetran_utils.persist_pass_through_columns": {"unique_id": "macro.fivetran_utils.persist_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/persist_pass_through_columns.sql", "original_file_path": "macros/persist_pass_through_columns.sql", "name": "persist_pass_through_columns", "macro_sql": "{% macro persist_pass_through_columns(pass_through_variable, identifier=none, transform='') %}\n\n{% if var(pass_through_variable, none) %}\n {% for field in var(pass_through_variable) %}\n , {{ transform ~ '(' ~ (identifier ~ '.' if identifier else '') ~ (field.alias if field.alias else field.name) ~ ')' }} as {{ field.alias if field.alias else field.name }}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.926322, "supported_languages": null}, "macro.fivetran_utils.json_parse": {"unique_id": "macro.fivetran_utils.json_parse", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "json_parse", "macro_sql": "{% macro json_parse(string, string_path) -%}\n\n{{ adapter.dispatch('json_parse', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__json_parse"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.927418, "supported_languages": null}, "macro.fivetran_utils.default__json_parse": {"unique_id": "macro.fivetran_utils.default__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "default__json_parse", "macro_sql": "{% macro default__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.927666, "supported_languages": null}, "macro.fivetran_utils.redshift__json_parse": {"unique_id": "macro.fivetran_utils.redshift__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "redshift__json_parse", "macro_sql": "{% macro redshift__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.927916, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_parse": {"unique_id": "macro.fivetran_utils.bigquery__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "bigquery__json_parse", "macro_sql": "{% macro bigquery__json_parse(string, string_path) %}\n\n \n json_extract_scalar({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9281678, "supported_languages": null}, "macro.fivetran_utils.postgres__json_parse": {"unique_id": "macro.fivetran_utils.postgres__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "postgres__json_parse", "macro_sql": "{% macro postgres__json_parse(string, string_path) %}\n\n {{string}}::json #>> '{ {%- for s in string_path -%}{{ s }}{%- if not loop.last -%},{%- endif -%}{%- endfor -%} }'\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.92841, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_parse": {"unique_id": "macro.fivetran_utils.snowflake__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "snowflake__json_parse", "macro_sql": "{% macro snowflake__json_parse(string, string_path) %}\n\n parse_json( {{string}} ) {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.928689, "supported_languages": null}, "macro.fivetran_utils.spark__json_parse": {"unique_id": "macro.fivetran_utils.spark__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "spark__json_parse", "macro_sql": "{% macro spark__json_parse(string, string_path) %}\n\n {{string}} : {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.928942, "supported_languages": null}, "macro.fivetran_utils.max_bool": {"unique_id": "macro.fivetran_utils.max_bool", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "max_bool", "macro_sql": "{% macro max_bool(boolean_field) -%}\n\n{{ adapter.dispatch('max_bool', 'fivetran_utils') (boolean_field) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__max_bool"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9293709, "supported_languages": null}, "macro.fivetran_utils.default__max_bool": {"unique_id": "macro.fivetran_utils.default__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "default__max_bool", "macro_sql": "{% macro default__max_bool(boolean_field) %}\n\n bool_or( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.929476, "supported_languages": null}, "macro.fivetran_utils.snowflake__max_bool": {"unique_id": "macro.fivetran_utils.snowflake__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "snowflake__max_bool", "macro_sql": "{% macro snowflake__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.929661, "supported_languages": null}, "macro.fivetran_utils.bigquery__max_bool": {"unique_id": "macro.fivetran_utils.bigquery__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "bigquery__max_bool", "macro_sql": "{% macro bigquery__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.929763, "supported_languages": null}, "macro.fivetran_utils.calculated_fields": {"unique_id": "macro.fivetran_utils.calculated_fields", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/calculated_fields.sql", "original_file_path": "macros/calculated_fields.sql", "name": "calculated_fields", "macro_sql": "{% macro calculated_fields(variable) -%}\n\n{% if var(variable, none) %}\n {% for field in var(variable) %}\n , {{ field.transform_sql }} as {{ field.name }} \n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.930179, "supported_languages": null}, "macro.fivetran_utils.seed_data_helper": {"unique_id": "macro.fivetran_utils.seed_data_helper", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/seed_data_helper.sql", "original_file_path": "macros/seed_data_helper.sql", "name": "seed_data_helper", "macro_sql": "{% macro seed_data_helper(seed_name, warehouses) %}\n\n{% if target.type in warehouses %}\n {% for w in warehouses %}\n {% if target.type == w %}\n {{ return(ref(seed_name ~ \"_\" ~ w ~ \"\")) }}\n {% endif %}\n {% endfor %}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9308002, "supported_languages": null}, "macro.fivetran_utils.fill_pass_through_columns": {"unique_id": "macro.fivetran_utils.fill_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/fill_pass_through_columns.sql", "original_file_path": "macros/fill_pass_through_columns.sql", "name": "fill_pass_through_columns", "macro_sql": "{% macro fill_pass_through_columns(pass_through_variable) %}\n\n{% if var(pass_through_variable) %}\n {% for field in var(pass_through_variable) %}\n {% if field.transform_sql %}\n , {{ field.transform_sql }} as {{ field.alias if field.alias else field.name }}\n {% else %}\n , {{ field.alias if field.alias else field.name }}\n {% endif %}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.931445, "supported_languages": null}, "macro.fivetran_utils.string_agg": {"unique_id": "macro.fivetran_utils.string_agg", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "string_agg", "macro_sql": "{% macro string_agg(field_to_agg, delimiter) -%}\n\n{{ adapter.dispatch('string_agg', 'fivetran_utils') (field_to_agg, delimiter) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__string_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.931967, "supported_languages": null}, "macro.fivetran_utils.default__string_agg": {"unique_id": "macro.fivetran_utils.default__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "default__string_agg", "macro_sql": "{% macro default__string_agg(field_to_agg, delimiter) %}\n string_agg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.932096, "supported_languages": null}, "macro.fivetran_utils.snowflake__string_agg": {"unique_id": "macro.fivetran_utils.snowflake__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "snowflake__string_agg", "macro_sql": "{% macro snowflake__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.932223, "supported_languages": null}, "macro.fivetran_utils.redshift__string_agg": {"unique_id": "macro.fivetran_utils.redshift__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "redshift__string_agg", "macro_sql": "{% macro redshift__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9323468, "supported_languages": null}, "macro.fivetran_utils.spark__string_agg": {"unique_id": "macro.fivetran_utils.spark__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "spark__string_agg", "macro_sql": "{% macro spark__string_agg(field_to_agg, delimiter) %}\n -- collect set will remove duplicates\n replace(replace(replace(cast( collect_set({{ field_to_agg }}) as string), '[', ''), ']', ''), ', ', {{ delimiter }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9324741, "supported_languages": null}, "macro.fivetran_utils.timestamp_diff": {"unique_id": "macro.fivetran_utils.timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "timestamp_diff", "macro_sql": "{% macro timestamp_diff(first_date, second_date, datepart) %}\n {{ adapter.dispatch('timestamp_diff', 'fivetran_utils')(first_date, second_date, datepart) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__timestamp_diff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.935201, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_diff": {"unique_id": "macro.fivetran_utils.default__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "default__timestamp_diff", "macro_sql": "{% macro default__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.935371, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_diff": {"unique_id": "macro.fivetran_utils.redshift__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "redshift__timestamp_diff", "macro_sql": "{% macro redshift__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.935529, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_diff": {"unique_id": "macro.fivetran_utils.bigquery__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "bigquery__timestamp_diff", "macro_sql": "{% macro bigquery__timestamp_diff(first_date, second_date, datepart) %}\n\n timestamp_diff(\n {{second_date}},\n {{first_date}},\n {{datepart}}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9356852, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_diff": {"unique_id": "macro.fivetran_utils.postgres__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "postgres__timestamp_diff", "macro_sql": "{% macro postgres__timestamp_diff(first_date, second_date, datepart) %}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ dbt.datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.937407, "supported_languages": null}, "macro.fivetran_utils.try_cast": {"unique_id": "macro.fivetran_utils.try_cast", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "try_cast", "macro_sql": "{% macro try_cast(field, type) %}\n {{ adapter.dispatch('try_cast', 'fivetran_utils') (field, type) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__try_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.938296, "supported_languages": null}, "macro.fivetran_utils.default__safe_cast": {"unique_id": "macro.fivetran_utils.default__safe_cast", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.938432, "supported_languages": null}, "macro.fivetran_utils.redshift__try_cast": {"unique_id": "macro.fivetran_utils.redshift__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "redshift__try_cast", "macro_sql": "{% macro redshift__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when trim({{field}}) ~ '^(0|[1-9][0-9]*)$' then trim({{field}})\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.938695, "supported_languages": null}, "macro.fivetran_utils.postgres__try_cast": {"unique_id": "macro.fivetran_utils.postgres__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "postgres__try_cast", "macro_sql": "{% macro postgres__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar)) ~ '^(0|[1-9][0-9]*)$' \n then replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar))\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9389691, "supported_languages": null}, "macro.fivetran_utils.snowflake__try_cast": {"unique_id": "macro.fivetran_utils.snowflake__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "snowflake__try_cast", "macro_sql": "{% macro snowflake__try_cast(field, type) %}\n try_cast(cast({{field}} as varchar) as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.939094, "supported_languages": null}, "macro.fivetran_utils.bigquery__try_cast": {"unique_id": "macro.fivetran_utils.bigquery__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "bigquery__try_cast", "macro_sql": "{% macro bigquery__try_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9392169, "supported_languages": null}, "macro.fivetran_utils.spark__try_cast": {"unique_id": "macro.fivetran_utils.spark__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "spark__try_cast", "macro_sql": "{% macro spark__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9393349, "supported_languages": null}, "macro.fivetran_utils.source_relation": {"unique_id": "macro.fivetran_utils.source_relation", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "name": "source_relation", "macro_sql": "{% macro source_relation(union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('source_relation', 'fivetran_utils') (union_schema_variable, union_database_variable) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.939851, "supported_languages": null}, "macro.fivetran_utils.default__source_relation": {"unique_id": "macro.fivetran_utils.default__source_relation", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "name": "default__source_relation", "macro_sql": "{% macro default__source_relation(union_schema_variable, union_database_variable) %}\n\n{% if var(union_schema_variable, none) %}\n, case\n {% for schema in var(union_schema_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%.{{ schema|lower }}.%' then '{{ schema|lower }}'\n {% endfor %}\n end as source_relation\n{% elif var(union_database_variable, none) %}\n, case\n {% for database in var(union_database_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%{{ database|lower }}.%' then '{{ database|lower }}'\n {% endfor %}\n end as source_relation\n{% else %}\n, cast('' as {{ dbt.type_string() }}) as source_relation\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.940431, "supported_languages": null}, "macro.fivetran_utils.first_value": {"unique_id": "macro.fivetran_utils.first_value", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "first_value", "macro_sql": "{% macro first_value(first_value_field, partition_field, order_by_field, order=\"asc\") -%}\n\n{{ adapter.dispatch('first_value', 'fivetran_utils') (first_value_field, partition_field, order_by_field, order) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__first_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.940958, "supported_languages": null}, "macro.fivetran_utils.default__first_value": {"unique_id": "macro.fivetran_utils.default__first_value", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "default__first_value", "macro_sql": "{% macro default__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.941153, "supported_languages": null}, "macro.fivetran_utils.redshift__first_value": {"unique_id": "macro.fivetran_utils.redshift__first_value", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "redshift__first_value", "macro_sql": "{% macro redshift__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} , {{ partition_field }} rows unbounded preceding )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9413671, "supported_languages": null}, "macro.fivetran_utils.add_dbt_source_relation": {"unique_id": "macro.fivetran_utils.add_dbt_source_relation", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/add_dbt_source_relation.sql", "original_file_path": "macros/add_dbt_source_relation.sql", "name": "add_dbt_source_relation", "macro_sql": "{% macro add_dbt_source_relation() %}\n\n{% if var('union_schemas', none) or var('union_databases', none) %}\n, _dbt_source_relation\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.941675, "supported_languages": null}, "macro.fivetran_utils.add_pass_through_columns": {"unique_id": "macro.fivetran_utils.add_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/add_pass_through_columns.sql", "original_file_path": "macros/add_pass_through_columns.sql", "name": "add_pass_through_columns", "macro_sql": "{% macro add_pass_through_columns(base_columns, pass_through_var) %}\n\n {% if pass_through_var %}\n\n {% for column in pass_through_var %}\n\n {% if column.alias %}\n\n {% do base_columns.append({ \"name\": column.name, \"alias\": column.alias, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column.name, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n \n {% endif %}\n\n {% endfor %}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.942527, "supported_languages": null}, "macro.fivetran_utils.union_relations": {"unique_id": "macro.fivetran_utils.union_relations", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "name": "union_relations", "macro_sql": "{%- macro union_relations(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n {%- set source_column_name = source_column_name if source_column_name is not none else '_dbt_source_relation' -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt_utils.string_literal(relation) }} as {{ dbt_utils.type_string() }}) as {{ source_column_name }},\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ aliases[loop.index0] if aliases else relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.946688, "supported_languages": null}, "macro.fivetran_utils.union_tables": {"unique_id": "macro.fivetran_utils.union_tables", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "name": "union_tables", "macro_sql": "{%- macro union_tables(tables, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_table') -%}\n\n {%- do exceptions.warn(\"Warning: the `union_tables` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use the `union_relations` macro instead\") -%}\n\n {{ return(dbt_utils.union_relations(tables, column_override, include, exclude, source_column_name)) }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.947063, "supported_languages": null}, "macro.fivetran_utils.snowflake_seed_data": {"unique_id": "macro.fivetran_utils.snowflake_seed_data", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/snowflake_seed_data.sql", "original_file_path": "macros/snowflake_seed_data.sql", "name": "snowflake_seed_data", "macro_sql": "{% macro snowflake_seed_data(seed_name) %}\n\n{% if target.type == 'snowflake' %}\n{{ return(ref(seed_name ~ '_snowflake')) }}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9475808, "supported_languages": null}, "macro.fivetran_utils.fill_staging_columns": {"unique_id": "macro.fivetran_utils.fill_staging_columns", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "name": "fill_staging_columns", "macro_sql": "{% macro fill_staging_columns(source_columns, staging_columns) -%}\n\n{%- set source_column_names = source_columns|map(attribute='name')|map('lower')|list -%}\n\n{%- for column in staging_columns %}\n {% if column.name|lower in source_column_names -%}\n {{ fivetran_utils.quote_column(column) }} as \n {%- if 'alias' in column %} {{ column.alias }} {% else %} {{ fivetran_utils.quote_column(column) }} {%- endif -%}\n {%- else -%}\n cast(null as {{ column.datatype }})\n {%- if 'alias' in column %} as {{ column.alias }} {% else %} as {{ fivetran_utils.quote_column(column) }} {% endif -%}\n {%- endif -%}\n {%- if not loop.last -%} , {% endif -%}\n{% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.quote_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.94913, "supported_languages": null}, "macro.fivetran_utils.quote_column": {"unique_id": "macro.fivetran_utils.quote_column", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "name": "quote_column", "macro_sql": "{% macro quote_column(column) %}\n {% if 'quote' in column %}\n {% if column.quote %}\n {% if target.type in ('bigquery', 'spark') %}\n `{{ column.name }}`\n {% elif target.type == 'snowflake' %}\n \"{{ column.name | upper }}\"\n {% else %}\n \"{{ column.name }}\"\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9496598, "supported_languages": null}, "macro.fivetran_utils.json_extract": {"unique_id": "macro.fivetran_utils.json_extract", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "json_extract", "macro_sql": "{% macro json_extract(string, string_path) -%}\n\n{{ adapter.dispatch('json_extract', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.950256, "supported_languages": null}, "macro.fivetran_utils.default__json_extract": {"unique_id": "macro.fivetran_utils.default__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "default__json_extract", "macro_sql": "{% macro default__json_extract(string, string_path) %}\n\n json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} )\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.950419, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_extract": {"unique_id": "macro.fivetran_utils.snowflake__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "snowflake__json_extract", "macro_sql": "{% macro snowflake__json_extract(string, string_path) %}\n\n json_extract_path_text(try_parse_json( {{string}} ), {{ \"'\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.950575, "supported_languages": null}, "macro.fivetran_utils.redshift__json_extract": {"unique_id": "macro.fivetran_utils.redshift__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "redshift__json_extract", "macro_sql": "{% macro redshift__json_extract(string, string_path) %}\n\n case when is_valid_json( {{string}} ) then json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} ) else null end\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.950742, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_extract": {"unique_id": "macro.fivetran_utils.bigquery__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "bigquery__json_extract", "macro_sql": "{% macro bigquery__json_extract(string, string_path) %}\n\n json_extract_scalar({{string}}, {{ \"'$.\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.950899, "supported_languages": null}, "macro.fivetran_utils.postgres__json_extract": {"unique_id": "macro.fivetran_utils.postgres__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "postgres__json_extract", "macro_sql": "{% macro postgres__json_extract(string, string_path) %}\n\n {{string}}::json->>{{\"'\" ~ string_path ~ \"'\" }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9510558, "supported_languages": null}, "macro.fivetran_utils.collect_freshness": {"unique_id": "macro.fivetran_utils.collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "name": "collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness')(source, loaded_at_field, filter))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.951861, "supported_languages": null}, "macro.fivetran_utils.default__collect_freshness": {"unique_id": "macro.fivetran_utils.default__collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "name": "default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n\n {%- set enabled_array = [] -%}\n {% for node in graph.sources.values() %}\n {% if node.identifier == source.identifier %}\n {% if (node.meta['is_enabled'] | default(true)) %}\n {%- do enabled_array.append(1) -%}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% set is_enabled = (enabled_array != []) %}\n\n select\n {% if is_enabled %}\n max({{ loaded_at_field }})\n {% else %} \n {{ current_timestamp() }} {% endif %} as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n\n {% if is_enabled %}\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endif %}\n\n {% endcall %}\n {{ return(load_result('collect_freshness').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.952857, "supported_languages": null}, "macro.fivetran_utils.timestamp_add": {"unique_id": "macro.fivetran_utils.timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "timestamp_add", "macro_sql": "{% macro timestamp_add(datepart, interval, from_timestamp) -%}\n\n{{ adapter.dispatch('timestamp_add', 'fivetran_utils') (datepart, interval, from_timestamp) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__timestamp_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.953598, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_add": {"unique_id": "macro.fivetran_utils.default__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "default__timestamp_add", "macro_sql": "{% macro default__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestampadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.953761, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_add": {"unique_id": "macro.fivetran_utils.bigquery__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "bigquery__timestamp_add", "macro_sql": "{% macro bigquery__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestamp_add({{ from_timestamp }}, interval {{ interval }} {{ datepart }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.953912, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_add": {"unique_id": "macro.fivetran_utils.redshift__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "redshift__timestamp_add", "macro_sql": "{% macro redshift__timestamp_add(datepart, interval, from_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9540749, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_add": {"unique_id": "macro.fivetran_utils.postgres__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "postgres__timestamp_add", "macro_sql": "{% macro postgres__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ from_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9542348, "supported_languages": null}, "macro.fivetran_utils.spark__timestamp_add": {"unique_id": "macro.fivetran_utils.spark__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "spark__timestamp_add", "macro_sql": "{% macro spark__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ dbt.dateadd(datepart, interval, from_timestamp) }}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.954407, "supported_languages": null}, "macro.fivetran_utils.ceiling": {"unique_id": "macro.fivetran_utils.ceiling", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "ceiling", "macro_sql": "{% macro ceiling(num) -%}\n\n{{ adapter.dispatch('ceiling', 'fivetran_utils') (num) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__ceiling"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.954719, "supported_languages": null}, "macro.fivetran_utils.default__ceiling": {"unique_id": "macro.fivetran_utils.default__ceiling", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "default__ceiling", "macro_sql": "{% macro default__ceiling(num) %}\n ceiling({{ num }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.954825, "supported_languages": null}, "macro.fivetran_utils.snowflake__ceiling": {"unique_id": "macro.fivetran_utils.snowflake__ceiling", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "snowflake__ceiling", "macro_sql": "{% macro snowflake__ceiling(num) %}\n ceil({{ num }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.955004, "supported_languages": null}, "macro.fivetran_utils.remove_prefix_from_columns": {"unique_id": "macro.fivetran_utils.remove_prefix_from_columns", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/remove_prefix_from_columns.sql", "original_file_path": "macros/remove_prefix_from_columns.sql", "name": "remove_prefix_from_columns", "macro_sql": "{% macro remove_prefix_from_columns(columns, prefix='', exclude=[]) %}\n\n {%- for col in columns if col.name not in exclude -%}\n {%- if col.name[:prefix|length]|lower == prefix -%}\n {{ col.name }} as {{ col.name[prefix|length:] }}\n {%- else -%}\n {{ col.name }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {% endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.955692, "supported_languages": null}, "macro.fivetran_utils.union_data": {"unique_id": "macro.fivetran_utils.union_data", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "name": "union_data", "macro_sql": "{% macro union_data(table_identifier, database_variable, schema_variable, default_database, default_schema, default_variable, union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('union_data', 'fivetran_utils') (\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__union_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9570408, "supported_languages": null}, "macro.fivetran_utils.default__union_data": {"unique_id": "macro.fivetran_utils.default__union_data", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "name": "default__union_data", "macro_sql": "{% macro default__union_data(\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) %}\n\n{% if var(union_schema_variable, none) %}\n\n {% set relations = [] %}\n \n {% if var(union_schema_variable) is string %}\n {% set trimmed = var(union_schema_variable)|trim('[')|trim(']') %}\n {% set schemas = trimmed.split(',')|map('trim',\" \")|map('trim','\"')|map('trim',\"'\") %}\n {% else %}\n {% set schemas = var(union_schema_variable) %}\n {% endif %}\n\n {% for schema in var(union_schema_variable) %}\n {% set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else var(database_variable, default_database),\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else schema,\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n \n {% set relation_exists=relation is not none %}\n\n {% if relation_exists %}\n\n {% do relations.append(relation) %}\n \n {% endif %}\n\n {% endfor %}\n\n {{ dbt_utils.union_relations(relations) }}\n\n{% elif var(union_database_variable, none) %}\n\n {% set relations = [] %}\n\n {% for database in var(union_database_variable) %}\n\n {% set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else database,\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else var(schema_variable, default_schema),\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n\n {% set relation_exists=relation is not none %}\n\n {% if relation_exists %}\n\n {% do relations.append(relation) %}\n \n {% endif %}\n\n {% endfor %}\n\n {{ dbt_utils.union_relations(relations) }}\n\n{% else %}\n\n select * \n from {{ var(default_variable) }}\n\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.959337, "supported_languages": null}, "macro.fivetran_utils.dummy_coalesce_value": {"unique_id": "macro.fivetran_utils.dummy_coalesce_value", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/dummy_coalesce_value.sql", "original_file_path": "macros/dummy_coalesce_value.sql", "name": "dummy_coalesce_value", "macro_sql": "{% macro dummy_coalesce_value(column) %}\n\n{% set coalesce_value = {\n 'STRING': \"'DUMMY_STRING'\",\n 'BOOLEAN': 'null',\n 'INT': 999999999,\n 'FLOAT': 999999999.99,\n 'TIMESTAMP': 'cast(\"2099-12-31\" as timestamp)',\n 'DATE': 'cast(\"2099-12-31\" as date)',\n} %}\n\n{% if column.is_float() %}\n{{ return(coalesce_value['FLOAT']) }}\n\n{% elif column.is_numeric() %}\n{{ return(coalesce_value['INT']) }}\n\n{% elif column.is_string() %}\n{{ return(coalesce_value['STRING']) }}\n\n{% elif column.data_type|lower == 'boolean' %}\n{{ return(coalesce_value['BOOLEAN']) }}\n\n{% elif 'timestamp' in column.data_type|lower %}\n{{ return(coalesce_value['TIMESTAMP']) }}\n\n{% elif 'date' in column.data_type|lower %}\n{{ return(coalesce_value['DATE']) }}\n\n{% elif 'int' in column.data_type|lower %}\n{{ return(coalesce_value['INT']) }}\n\n{% endif %}\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.960752, "supported_languages": null}, "macro.fivetran_utils.array_agg": {"unique_id": "macro.fivetran_utils.array_agg", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "array_agg", "macro_sql": "{% macro array_agg(field_to_agg) -%}\n\n{{ adapter.dispatch('array_agg', 'fivetran_utils') (field_to_agg) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__array_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.961099, "supported_languages": null}, "macro.fivetran_utils.default__array_agg": {"unique_id": "macro.fivetran_utils.default__array_agg", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "default__array_agg", "macro_sql": "{% macro default__array_agg(field_to_agg) %}\n array_agg({{ field_to_agg }})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.961208, "supported_languages": null}, "macro.fivetran_utils.redshift__array_agg": {"unique_id": "macro.fivetran_utils.redshift__array_agg", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "redshift__array_agg", "macro_sql": "{% macro redshift__array_agg(field_to_agg) %}\n listagg({{ field_to_agg }}, ',')\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.961382, "supported_languages": null}, "macro.fivetran_utils.empty_variable_warning": {"unique_id": "macro.fivetran_utils.empty_variable_warning", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/empty_variable_warning.sql", "original_file_path": "macros/empty_variable_warning.sql", "name": "empty_variable_warning", "macro_sql": "{% macro empty_variable_warning(variable, downstream_model) %}\n\n{% if not var(variable) %}\n{{ log(\n \"\"\"\n Warning: You have passed an empty list to the \"\"\" ~ variable ~ \"\"\".\n As a result, you won't see the history of any columns in the \"\"\" ~ downstream_model ~ \"\"\" model.\n \"\"\",\n info=True\n) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9619179, "supported_languages": null}, "macro.fivetran_utils.enabled_vars_one_true": {"unique_id": "macro.fivetran_utils.enabled_vars_one_true", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/enabled_vars_one_true.sql", "original_file_path": "macros/enabled_vars_one_true.sql", "name": "enabled_vars_one_true", "macro_sql": "{% macro enabled_vars_one_true(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, False) == True %}\n {{ return(True) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(False) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.962392, "supported_languages": null}, "macro.github_source.get_issue_columns": {"unique_id": "macro.github_source.get_issue_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_columns.sql", "original_file_path": "macros/get_issue_columns.sql", "name": "get_issue_columns", "macro_sql": "{% macro get_issue_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"body\", \"datatype\": dbt.type_string()},\n {\"name\": \"closed_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"locked\", \"datatype\": \"boolean\"},\n {\"name\": \"milestone_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"number\", \"datatype\": dbt.type_int()},\n {\"name\": \"pull_request\", \"datatype\": \"boolean\"},\n {\"name\": \"repository_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"state\", \"datatype\": dbt.type_string()},\n {\"name\": \"title\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"user_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9639559, "supported_languages": null}, "macro.github_source.get_issue_comment_columns": {"unique_id": "macro.github_source.get_issue_comment_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_comment_columns.sql", "original_file_path": "macros/get_issue_comment_columns.sql", "name": "get_issue_comment_columns", "macro_sql": "{% macro get_issue_comment_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"body\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"user_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.964865, "supported_languages": null}, "macro.github_source.get_repository_columns": {"unique_id": "macro.github_source.get_repository_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_repository_columns.sql", "original_file_path": "macros/get_repository_columns.sql", "name": "get_repository_columns", "macro_sql": "{% macro get_repository_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"archived\", \"datatype\": \"boolean\"},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"default_branch\", \"datatype\": dbt.type_string()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"fork\", \"datatype\": \"boolean\"},\n {\"name\": \"full_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"homepage\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"language\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"owner_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"private\", \"datatype\": \"boolean\"}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9663, "supported_languages": null}, "macro.github_source.get_issue_merged_columns": {"unique_id": "macro.github_source.get_issue_merged_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_merged_columns.sql", "original_file_path": "macros/get_issue_merged_columns.sql", "name": "get_issue_merged_columns", "macro_sql": "{% macro get_issue_merged_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"actor_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"commit_sha\", \"datatype\": dbt.type_string()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"merged_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9670131, "supported_languages": null}, "macro.github_source.get_pull_request_review_columns": {"unique_id": "macro.github_source.get_pull_request_review_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_pull_request_review_columns.sql", "original_file_path": "macros/get_pull_request_review_columns.sql", "name": "get_pull_request_review_columns", "macro_sql": "{% macro get_pull_request_review_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"body\", \"datatype\": dbt.type_string()},\n {\"name\": \"commit_sha\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"pull_request_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"state\", \"datatype\": dbt.type_string()},\n {\"name\": \"submitted_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"user_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.968013, "supported_languages": null}, "macro.github_source.get_team_columns": {"unique_id": "macro.github_source.get_team_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_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_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"org_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"parent_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"privacy\", \"datatype\": dbt.type_string()},\n {\"name\": \"slug\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9690208, "supported_languages": null}, "macro.github_source.get_issue_assignee_columns": {"unique_id": "macro.github_source.get_issue_assignee_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_assignee_columns.sql", "original_file_path": "macros/get_issue_assignee_columns.sql", "name": "get_issue_assignee_columns", "macro_sql": "{% macro get_issue_assignee_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"user_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.969611, "supported_languages": null}, "macro.github_source.get_user_columns": {"unique_id": "macro.github_source.get_user_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_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\": \"company\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"login\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.970243, "supported_languages": null}, "macro.github_source.get_label_columns": {"unique_id": "macro.github_source.get_label_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_label_columns.sql", "original_file_path": "macros/get_label_columns.sql", "name": "get_label_columns", "macro_sql": "{% macro get_label_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"color\", \"datatype\": dbt.type_string()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"is_default\", \"datatype\": \"boolean\"},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"url\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.971116, "supported_languages": null}, "macro.github_source.get_pull_request_columns": {"unique_id": "macro.github_source.get_pull_request_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_pull_request_columns.sql", "original_file_path": "macros/get_pull_request_columns.sql", "name": "get_pull_request_columns", "macro_sql": "{% macro get_pull_request_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"base_label\", \"datatype\": dbt.type_string()},\n {\"name\": \"base_ref\", \"datatype\": dbt.type_string()},\n {\"name\": \"base_repo_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"base_sha\", \"datatype\": dbt.type_string()},\n {\"name\": \"base_user_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"head_label\", \"datatype\": dbt.type_string()},\n {\"name\": \"head_ref\", \"datatype\": dbt.type_string()},\n {\"name\": \"head_repo_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"head_sha\", \"datatype\": dbt.type_string()},\n {\"name\": \"head_user_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"merge_commit_sha\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9727612, "supported_languages": null}, "macro.github_source.get_requested_reviewer_history_columns": {"unique_id": "macro.github_source.get_requested_reviewer_history_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_requested_reviewer_history_columns.sql", "original_file_path": "macros/get_requested_reviewer_history_columns.sql", "name": "get_requested_reviewer_history_columns", "macro_sql": "{% macro get_requested_reviewer_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"actor_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"pull_request_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"removed\", \"datatype\": \"boolean\"},\n {\"name\": \"requested_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.973564, "supported_languages": null}, "macro.github_source.get_issue_closed_history_columns": {"unique_id": "macro.github_source.get_issue_closed_history_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_closed_history_columns.sql", "original_file_path": "macros/get_issue_closed_history_columns.sql", "name": "get_issue_closed_history_columns", "macro_sql": "{% macro get_issue_closed_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"actor_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"closed\", \"datatype\": \"boolean\"},\n {\"name\": \"commit_sha\", \"datatype\": dbt.type_string()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.9743528, "supported_languages": null}, "macro.github_source.get_repo_team_columns": {"unique_id": "macro.github_source.get_repo_team_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_repo_team_columns.sql", "original_file_path": "macros/get_repo_team_columns.sql", "name": "get_repo_team_columns", "macro_sql": "{% macro get_repo_team_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"permission\", \"datatype\": dbt.type_string()},\n {\"name\": \"repository_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"team_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.974963, "supported_languages": null}, "macro.github_source.get_issue_label_columns": {"unique_id": "macro.github_source.get_issue_label_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_label_columns.sql", "original_file_path": "macros/get_issue_label_columns.sql", "name": "get_issue_label_columns", "macro_sql": "{% macro get_issue_label_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"label_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1666812438.975481, "supported_languages": null}}, "docs": {"dbt.__overview__": {"unique_id": "dbt.__overview__", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "overview.md", "original_file_path": "docs/overview.md", "name": "__overview__", "block_contents": "### Welcome!\n\nWelcome to the auto-generated documentation for your dbt project!\n\n### Navigation\n\nYou can use the `Project` and `Database` navigation tabs on the left side of the window to explore the models\nin your project.\n\n#### Project Tab\nThe `Project` tab mirrors the directory structure of your dbt project. In this tab, you can see all of the\nmodels defined in your dbt project, as well as models imported from dbt packages.\n\n#### Database Tab\nThe `Database` tab also exposes your models, but in a format that looks more like a database explorer. This view\nshows relations (tables and views) grouped into database schemas. Note that ephemeral models are _not_ shown\nin this interface, as they do not exist in the database.\n\n### Graph Exploration\nYou can click the blue icon on the bottom-right corner of the page to view the lineage graph of your models.\n\nOn model pages, you'll see the immediate parents and children of the model you're exploring. By clicking the `Expand`\nbutton at the top-right of this lineage pane, you'll be able to see all of the models that are used to build,\nor are built from, the model you're exploring.\n\nOnce expanded, you'll be able to use the `--select` and `--exclude` model selection syntax to filter the\nmodels in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax).\n\nNote that you can also right-click on models to interactively filter and explore the graph.\n\n---\n\n### More information\n\n- [What is dbt](https://docs.getdbt.com/docs/introduction)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [dbt Community](https://www.getdbt.com/community/) for questions and discussion"}}, "exposures": {}, "metrics": {}, "selectors": {}, "disabled": {}, "parent_map": {"seed.github_integration_tests.github_pull_request_review_data": [], "seed.github_integration_tests.github_label_data": [], "seed.github_integration_tests.github_repository_data": [], "seed.github_integration_tests.github_issue_merged_data": [], "seed.github_integration_tests.github_issue_data": [], "seed.github_integration_tests.github_repo_team_data": [], "seed.github_integration_tests.github_requested_reviewer_history_data": [], "seed.github_integration_tests.github_issue_label_data": [], "seed.github_integration_tests.github_issue_comment_data": [], "seed.github_integration_tests.github_issue_assignee_data": [], "seed.github_integration_tests.github_issue_closed_history_data": [], "seed.github_integration_tests.github_pull_request_data": [], "seed.github_integration_tests.github_team_data": [], "seed.github_integration_tests.github_user_data": [], "model.github.github__weekly_metrics": ["model.github.github__daily_metrics"], "model.github.github__monthly_metrics": ["model.github.github__daily_metrics"], "model.github.github__quarterly_metrics": ["model.github.github__daily_metrics"], "model.github.github__pull_requests": ["model.github.int_github__issue_joined"], "model.github.github__daily_metrics": ["model.github.github__issues", "model.github.github__pull_requests"], "model.github.github__issues": ["model.github.int_github__issue_joined"], "model.github.int_github__pull_request_times": ["model.github_source.stg_github__issue", "model.github_source.stg_github__issue_merged", "model.github_source.stg_github__pull_request", "model.github_source.stg_github__pull_request_review", "model.github_source.stg_github__requested_reviewer_history"], "model.github.int_github__pull_request_reviewers": ["model.github_source.stg_github__pull_request_review", "model.github_source.stg_github__user"], "model.github.int_github__issue_label_joined": ["model.github_source.stg_github__issue_label", "model.github_source.stg_github__label"], "model.github.int_github__issue_joined": ["model.github.int_github__issue_assignees", "model.github.int_github__issue_comments", "model.github.int_github__issue_labels", "model.github.int_github__issue_open_length", "model.github.int_github__pull_request_reviewers", "model.github.int_github__pull_request_times", "model.github.int_github__repository_teams", "model.github_source.stg_github__issue", "model.github_source.stg_github__pull_request", "model.github_source.stg_github__user"], "model.github.int_github__issue_labels": ["model.github.int_github__issue_label_joined"], "model.github.int_github__issue_assignees": ["model.github_source.stg_github__issue_assignee", "model.github_source.stg_github__user"], "model.github.int_github__issue_comments": ["model.github_source.stg_github__issue_comment"], "model.github.int_github__issue_open_length": ["model.github_source.stg_github__issue", "model.github_source.stg_github__issue_closed_history"], "model.github.int_github__repository_teams": ["model.github_source.stg_github__repo_team", "model.github_source.stg_github__repository", "model.github_source.stg_github__team"], "model.github_source.stg_github__issue_comment": ["model.github_source.stg_github__issue_comment_tmp", "model.github_source.stg_github__issue_comment_tmp"], "model.github_source.stg_github__requested_reviewer_history": ["model.github_source.stg_github__requested_reviewer_history_tmp", "model.github_source.stg_github__requested_reviewer_history_tmp"], "model.github_source.stg_github__issue_label": ["model.github_source.stg_github__issue_label_tmp", "model.github_source.stg_github__issue_label_tmp"], "model.github_source.stg_github__issue_merged": ["model.github_source.stg_github__issue_merged_tmp", "model.github_source.stg_github__issue_merged_tmp"], "model.github_source.stg_github__issue_closed_history": ["model.github_source.stg_github__issue_closed_history_tmp", "model.github_source.stg_github__issue_closed_history_tmp"], "model.github_source.stg_github__issue_assignee": ["model.github_source.stg_github__issue_assignee_tmp", "model.github_source.stg_github__issue_assignee_tmp"], "model.github_source.stg_github__repository": ["model.github_source.stg_github__repository_tmp", "model.github_source.stg_github__repository_tmp"], "model.github_source.stg_github__user": ["model.github_source.stg_github__user_tmp", "model.github_source.stg_github__user_tmp"], "model.github_source.stg_github__pull_request_review": ["model.github_source.stg_github__pull_request_review_tmp", "model.github_source.stg_github__pull_request_review_tmp"], "model.github_source.stg_github__repo_team": ["model.github_source.stg_github__repo_team_tmp", "model.github_source.stg_github__repo_team_tmp"], "model.github_source.stg_github__label": ["model.github_source.stg_github__label_tmp", "model.github_source.stg_github__label_tmp"], "model.github_source.stg_github__issue": ["model.github_source.stg_github__issue_tmp", "model.github_source.stg_github__issue_tmp"], "model.github_source.stg_github__team": ["model.github_source.stg_github__team_tmp", "model.github_source.stg_github__team_tmp"], "model.github_source.stg_github__pull_request": ["model.github_source.stg_github__pull_request_tmp", "model.github_source.stg_github__pull_request_tmp"], "model.github_source.stg_github__repository_tmp": ["seed.github_integration_tests.github_repository_data"], "model.github_source.stg_github__label_tmp": ["seed.github_integration_tests.github_label_data"], "model.github_source.stg_github__requested_reviewer_history_tmp": ["seed.github_integration_tests.github_requested_reviewer_history_data"], "model.github_source.stg_github__issue_comment_tmp": ["seed.github_integration_tests.github_issue_comment_data"], "model.github_source.stg_github__pull_request_review_tmp": ["seed.github_integration_tests.github_pull_request_review_data"], "model.github_source.stg_github__issue_label_tmp": ["seed.github_integration_tests.github_issue_label_data"], "model.github_source.stg_github__team_tmp": ["seed.github_integration_tests.github_team_data"], "model.github_source.stg_github__pull_request_tmp": ["seed.github_integration_tests.github_pull_request_data"], "model.github_source.stg_github__issue_merged_tmp": ["seed.github_integration_tests.github_issue_merged_data"], "model.github_source.stg_github__user_tmp": ["seed.github_integration_tests.github_user_data"], "model.github_source.stg_github__issue_closed_history_tmp": ["seed.github_integration_tests.github_issue_closed_history_data"], "model.github_source.stg_github__issue_assignee_tmp": ["seed.github_integration_tests.github_issue_assignee_data"], "model.github_source.stg_github__issue_tmp": ["seed.github_integration_tests.github_issue_data"], "model.github_source.stg_github__repo_team_tmp": ["seed.github_integration_tests.github_repo_team_data"], "test.github.unique_github__issues_issue_id.6723b9b1db": ["model.github.github__issues"], "test.github.not_null_github__issues_issue_id.fed0631e25": ["model.github.github__issues"], "test.github.unique_github__pull_requests_issue_id.ce23997907": ["model.github.github__pull_requests"], "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f": ["model.github.github__pull_requests"], "test.github.unique_github__daily_metrics_day.f98cab9456": ["model.github.github__daily_metrics"], "test.github.not_null_github__daily_metrics_day.647e494434": ["model.github.github__daily_metrics"], "test.github.unique_github__weekly_metrics_week.6794858a8e": ["model.github.github__weekly_metrics"], "test.github.not_null_github__weekly_metrics_week.4b0b928243": ["model.github.github__weekly_metrics"], "test.github.unique_github__monthly_metrics_month.3076284fbb": ["model.github.github__monthly_metrics"], "test.github.not_null_github__monthly_metrics_month.9e4fba84df": ["model.github.github__monthly_metrics"], "test.github.unique_github__quarterly_metrics_quarter.9165a921c1": ["model.github.github__quarterly_metrics"], "test.github.not_null_github__quarterly_metrics_quarter.92394d46dc": ["model.github.github__quarterly_metrics"], "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4": ["model.github_source.stg_github__issue_assignee"], "test.github_source.not_null_stg_github__label_label_id.9f07379974": ["model.github_source.stg_github__label"], "test.github_source.unique_stg_github__label_label_id.74d3c21466": ["model.github_source.stg_github__label"], "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d": ["model.github_source.stg_github__issue_closed_history"], "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a": ["model.github_source.stg_github__issue_comment"], "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f": ["model.github_source.stg_github__issue_comment"], "test.github_source.unique_stg_github__issue_issue_id.84891aeece": ["model.github_source.stg_github__issue"], "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7": ["model.github_source.stg_github__issue"], "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508": ["model.github_source.stg_github__pull_request_review"], "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790": ["model.github_source.stg_github__pull_request_review"], "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa": ["model.github_source.stg_github__pull_request"], "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71": ["model.github_source.stg_github__pull_request"], "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503": ["model.github_source.stg_github__repo_team"], "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c": ["model.github_source.stg_github__repo_team"], "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d": ["model.github_source.stg_github__repository"], "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f": ["model.github_source.stg_github__repository"], "test.github_source.unique_stg_github__team_team_id.94e9716ab4": ["model.github_source.stg_github__team"], "test.github_source.not_null_stg_github__team_team_id.440aefe7a7": ["model.github_source.stg_github__team"], "test.github_source.unique_stg_github__user_user_id.5c1a00cd90": ["model.github_source.stg_github__user"], "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b": ["model.github_source.stg_github__user"], "source.github_source.github.issue_assignee": [], "source.github_source.github.label": [], "source.github_source.github.issue_closed_history": [], "source.github_source.github.issue_label": [], "source.github_source.github.issue_comment": [], "source.github_source.github.issue_merged": [], "source.github_source.github.issue": [], "source.github_source.github.pull_request_review": [], "source.github_source.github.pull_request": [], "source.github_source.github.repo_team": [], "source.github_source.github.repository": [], "source.github_source.github.requested_reviewer_history": [], "source.github_source.github.team": [], "source.github_source.github.user": []}, "child_map": {"seed.github_integration_tests.github_pull_request_review_data": ["model.github_source.stg_github__pull_request_review_tmp"], "seed.github_integration_tests.github_label_data": ["model.github_source.stg_github__label_tmp"], "seed.github_integration_tests.github_repository_data": ["model.github_source.stg_github__repository_tmp"], "seed.github_integration_tests.github_issue_merged_data": ["model.github_source.stg_github__issue_merged_tmp"], "seed.github_integration_tests.github_issue_data": ["model.github_source.stg_github__issue_tmp"], "seed.github_integration_tests.github_repo_team_data": ["model.github_source.stg_github__repo_team_tmp"], "seed.github_integration_tests.github_requested_reviewer_history_data": ["model.github_source.stg_github__requested_reviewer_history_tmp"], "seed.github_integration_tests.github_issue_label_data": ["model.github_source.stg_github__issue_label_tmp"], "seed.github_integration_tests.github_issue_comment_data": ["model.github_source.stg_github__issue_comment_tmp"], "seed.github_integration_tests.github_issue_assignee_data": ["model.github_source.stg_github__issue_assignee_tmp"], "seed.github_integration_tests.github_issue_closed_history_data": ["model.github_source.stg_github__issue_closed_history_tmp"], "seed.github_integration_tests.github_pull_request_data": ["model.github_source.stg_github__pull_request_tmp"], "seed.github_integration_tests.github_team_data": ["model.github_source.stg_github__team_tmp"], "seed.github_integration_tests.github_user_data": ["model.github_source.stg_github__user_tmp"], "model.github.github__weekly_metrics": ["test.github.not_null_github__weekly_metrics_week.4b0b928243", "test.github.unique_github__weekly_metrics_week.6794858a8e"], "model.github.github__monthly_metrics": ["test.github.not_null_github__monthly_metrics_month.9e4fba84df", "test.github.unique_github__monthly_metrics_month.3076284fbb"], "model.github.github__quarterly_metrics": ["test.github.not_null_github__quarterly_metrics_quarter.92394d46dc", "test.github.unique_github__quarterly_metrics_quarter.9165a921c1"], "model.github.github__pull_requests": ["model.github.github__daily_metrics", "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f", "test.github.unique_github__pull_requests_issue_id.ce23997907"], "model.github.github__daily_metrics": ["model.github.github__monthly_metrics", "model.github.github__quarterly_metrics", "model.github.github__weekly_metrics", "test.github.not_null_github__daily_metrics_day.647e494434", "test.github.unique_github__daily_metrics_day.f98cab9456"], "model.github.github__issues": ["model.github.github__daily_metrics", "test.github.not_null_github__issues_issue_id.fed0631e25", "test.github.unique_github__issues_issue_id.6723b9b1db"], "model.github.int_github__pull_request_times": ["model.github.int_github__issue_joined"], "model.github.int_github__pull_request_reviewers": ["model.github.int_github__issue_joined"], "model.github.int_github__issue_label_joined": ["model.github.int_github__issue_labels"], "model.github.int_github__issue_joined": ["model.github.github__issues", "model.github.github__pull_requests"], "model.github.int_github__issue_labels": ["model.github.int_github__issue_joined"], "model.github.int_github__issue_assignees": ["model.github.int_github__issue_joined"], "model.github.int_github__issue_comments": ["model.github.int_github__issue_joined"], "model.github.int_github__issue_open_length": ["model.github.int_github__issue_joined"], "model.github.int_github__repository_teams": ["model.github.int_github__issue_joined"], "model.github_source.stg_github__issue_comment": ["model.github.int_github__issue_comments", "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f", "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a"], "model.github_source.stg_github__requested_reviewer_history": ["model.github.int_github__pull_request_times"], "model.github_source.stg_github__issue_label": ["model.github.int_github__issue_label_joined"], "model.github_source.stg_github__issue_merged": ["model.github.int_github__pull_request_times"], "model.github_source.stg_github__issue_closed_history": ["model.github.int_github__issue_open_length", "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d"], "model.github_source.stg_github__issue_assignee": ["model.github.int_github__issue_assignees", "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4"], "model.github_source.stg_github__repository": ["model.github.int_github__repository_teams", "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f", "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d"], "model.github_source.stg_github__user": ["model.github.int_github__issue_assignees", "model.github.int_github__issue_joined", "model.github.int_github__pull_request_reviewers", "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b", "test.github_source.unique_stg_github__user_user_id.5c1a00cd90"], "model.github_source.stg_github__pull_request_review": ["model.github.int_github__pull_request_reviewers", "model.github.int_github__pull_request_times", "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790", "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508"], "model.github_source.stg_github__repo_team": ["model.github.int_github__repository_teams", "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503", "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c"], "model.github_source.stg_github__label": ["model.github.int_github__issue_label_joined", "test.github_source.not_null_stg_github__label_label_id.9f07379974", "test.github_source.unique_stg_github__label_label_id.74d3c21466"], "model.github_source.stg_github__issue": ["model.github.int_github__issue_joined", "model.github.int_github__issue_open_length", "model.github.int_github__pull_request_times", "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7", "test.github_source.unique_stg_github__issue_issue_id.84891aeece"], "model.github_source.stg_github__team": ["model.github.int_github__repository_teams", "test.github_source.not_null_stg_github__team_team_id.440aefe7a7", "test.github_source.unique_stg_github__team_team_id.94e9716ab4"], "model.github_source.stg_github__pull_request": ["model.github.int_github__issue_joined", "model.github.int_github__pull_request_times", "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71", "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa"], "model.github_source.stg_github__repository_tmp": ["model.github_source.stg_github__repository", "model.github_source.stg_github__repository"], "model.github_source.stg_github__label_tmp": ["model.github_source.stg_github__label", "model.github_source.stg_github__label"], "model.github_source.stg_github__requested_reviewer_history_tmp": ["model.github_source.stg_github__requested_reviewer_history", "model.github_source.stg_github__requested_reviewer_history"], "model.github_source.stg_github__issue_comment_tmp": ["model.github_source.stg_github__issue_comment", "model.github_source.stg_github__issue_comment"], "model.github_source.stg_github__pull_request_review_tmp": ["model.github_source.stg_github__pull_request_review", "model.github_source.stg_github__pull_request_review"], "model.github_source.stg_github__issue_label_tmp": ["model.github_source.stg_github__issue_label", "model.github_source.stg_github__issue_label"], "model.github_source.stg_github__team_tmp": ["model.github_source.stg_github__team", "model.github_source.stg_github__team"], "model.github_source.stg_github__pull_request_tmp": ["model.github_source.stg_github__pull_request", "model.github_source.stg_github__pull_request"], "model.github_source.stg_github__issue_merged_tmp": ["model.github_source.stg_github__issue_merged", "model.github_source.stg_github__issue_merged"], "model.github_source.stg_github__user_tmp": ["model.github_source.stg_github__user", "model.github_source.stg_github__user"], "model.github_source.stg_github__issue_closed_history_tmp": ["model.github_source.stg_github__issue_closed_history", "model.github_source.stg_github__issue_closed_history"], "model.github_source.stg_github__issue_assignee_tmp": ["model.github_source.stg_github__issue_assignee", "model.github_source.stg_github__issue_assignee"], "model.github_source.stg_github__issue_tmp": ["model.github_source.stg_github__issue", "model.github_source.stg_github__issue"], "model.github_source.stg_github__repo_team_tmp": ["model.github_source.stg_github__repo_team", "model.github_source.stg_github__repo_team"], "test.github.unique_github__issues_issue_id.6723b9b1db": [], "test.github.not_null_github__issues_issue_id.fed0631e25": [], "test.github.unique_github__pull_requests_issue_id.ce23997907": [], "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f": [], "test.github.unique_github__daily_metrics_day.f98cab9456": [], "test.github.not_null_github__daily_metrics_day.647e494434": [], "test.github.unique_github__weekly_metrics_week.6794858a8e": [], "test.github.not_null_github__weekly_metrics_week.4b0b928243": [], "test.github.unique_github__monthly_metrics_month.3076284fbb": [], "test.github.not_null_github__monthly_metrics_month.9e4fba84df": [], "test.github.unique_github__quarterly_metrics_quarter.9165a921c1": [], "test.github.not_null_github__quarterly_metrics_quarter.92394d46dc": [], "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4": [], "test.github_source.not_null_stg_github__label_label_id.9f07379974": [], "test.github_source.unique_stg_github__label_label_id.74d3c21466": [], "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d": [], "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a": [], "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f": [], "test.github_source.unique_stg_github__issue_issue_id.84891aeece": [], "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7": [], "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508": [], "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790": [], "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa": [], "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71": [], "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503": [], "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c": [], "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d": [], "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f": [], "test.github_source.unique_stg_github__team_team_id.94e9716ab4": [], "test.github_source.not_null_stg_github__team_team_id.440aefe7a7": [], "test.github_source.unique_stg_github__user_user_id.5c1a00cd90": [], "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b": [], "source.github_source.github.issue_assignee": [], "source.github_source.github.label": [], "source.github_source.github.issue_closed_history": [], "source.github_source.github.issue_label": [], "source.github_source.github.issue_comment": [], "source.github_source.github.issue_merged": [], "source.github_source.github.issue": [], "source.github_source.github.pull_request_review": [], "source.github_source.github.pull_request": [], "source.github_source.github.repo_team": [], "source.github_source.github.repository": [], "source.github_source.github.requested_reviewer_history": [], "source.github_source.github.team": [], "source.github_source.github.user": []}} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v7.json", "dbt_version": "1.3.0", "generated_at": "2022-11-01T00:40:11.757530Z", "invocation_id": "581c3815-414c-47e3-91e9-f6b3f49621e9", "env": {}, "project_id": "b4ed7eda1f97e936d48d60e52edb4717", "user_id": "8268eefe-e8f7-472e-ab2a-a92f0135d76d", "send_anonymous_usage_stats": true, "adapter_type": "bigquery"}, "nodes": {"seed.github_integration_tests.github_pull_request_review_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "INT64", "submitted_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_integration_tests", "github_pull_request_review_data"], "unique_id": "seed.github_integration_tests.github_pull_request_review_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_pull_request_review_data.csv", "original_file_path": "seeds/github_pull_request_review_data.csv", "name": "github_pull_request_review_data", "alias": "github_pull_request_review_data", "checksum": {"name": "sha256", "checksum": "4bdebf989d5e5d1bf41df343300be0a7e2a12f74b8148de6a97e75118edf0efa"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "submitted_at": "timestamp"}}, "created_at": 1667263067.480431, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`github_pull_request_review_data`"}, "seed.github_integration_tests.github_label_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "INT64"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_integration_tests", "github_label_data"], "unique_id": "seed.github_integration_tests.github_label_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_label_data.csv", "original_file_path": "seeds/github_label_data.csv", "name": "github_label_data", "alias": "github_label_data", "checksum": {"name": "sha256", "checksum": "f47357ad7761ae8e671c889ce5e385f6916b78cb669dfc65f09bacea1ecafb1f"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "created_at": 1667263067.485953, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`github_label_data`"}, "seed.github_integration_tests.github_repository_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "created_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_integration_tests", "github_repository_data"], "unique_id": "seed.github_integration_tests.github_repository_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_repository_data.csv", "original_file_path": "seeds/github_repository_data.csv", "name": "github_repository_data", "alias": "github_repository_data", "checksum": {"name": "sha256", "checksum": "78cd55c70468340db27d24a3fc299fc8c191129ca26ea80620a0d796a608a1a4"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"created_at": "timestamp"}}, "created_at": 1667263067.487318, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`github_repository_data`"}, "seed.github_integration_tests.github_issue_merged_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "merged_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_integration_tests", "github_issue_merged_data"], "unique_id": "seed.github_integration_tests.github_issue_merged_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_issue_merged_data.csv", "original_file_path": "seeds/github_issue_merged_data.csv", "name": "github_issue_merged_data", "alias": "github_issue_merged_data", "checksum": {"name": "sha256", "checksum": "397efa928dca45bafbdc11219b3335265bd9a6cce1447c02e07c0bf53ddaba31"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"merged_at": "timestamp"}}, "created_at": 1667263067.4884942, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`github_issue_merged_data`"}, "seed.github_integration_tests.github_issue_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "closed_at": "timestamp", "created_at": "timestamp", "updated_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_integration_tests", "github_issue_data"], "unique_id": "seed.github_integration_tests.github_issue_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_issue_data.csv", "original_file_path": "seeds/github_issue_data.csv", "name": "github_issue_data", "alias": "github_issue_data", "checksum": {"name": "sha256", "checksum": "6eabcc9bc0920d64775f8058446b279e803384a2205f18a07d7a2f1ebcf89286"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"closed_at": "timestamp", "created_at": "timestamp", "updated_at": "timestamp"}}, "created_at": 1667263067.4896698, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`github_issue_data`"}, "seed.github_integration_tests.github_repo_team_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_integration_tests", "github_repo_team_data"], "unique_id": "seed.github_integration_tests.github_repo_team_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_repo_team_data.csv", "original_file_path": "seeds/github_repo_team_data.csv", "name": "github_repo_team_data", "alias": "github_repo_team_data", "checksum": {"name": "sha256", "checksum": "3a16bf772f5f15231f0d7e26c116041543fad5a9dbdabbdfec30ddd063058722"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1667263067.4909859, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`github_repo_team_data`"}, "seed.github_integration_tests.github_requested_reviewer_history_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "created_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_integration_tests", "github_requested_reviewer_history_data"], "unique_id": "seed.github_integration_tests.github_requested_reviewer_history_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_requested_reviewer_history_data.csv", "original_file_path": "seeds/github_requested_reviewer_history_data.csv", "name": "github_requested_reviewer_history_data", "alias": "github_requested_reviewer_history_data", "checksum": {"name": "sha256", "checksum": "91225ac95874fc314f772530dfcb6ece74f35c292ea5bba53ff86b599b902743"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"created_at": "timestamp"}}, "created_at": 1667263067.4922812, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`github_requested_reviewer_history_data`"}, "seed.github_integration_tests.github_issue_label_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "issue_id": "INT64", "label_id": "INT64"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_integration_tests", "github_issue_label_data"], "unique_id": "seed.github_integration_tests.github_issue_label_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_issue_label_data.csv", "original_file_path": "seeds/github_issue_label_data.csv", "name": "github_issue_label_data", "alias": "github_issue_label_data", "checksum": {"name": "sha256", "checksum": "847ef3245b5610a81f3d8e91b4787d24829b2b0d3d064c529a61d430e90f0585"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"issue_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "label_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "created_at": 1667263067.493474, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`github_issue_label_data`"}, "seed.github_integration_tests.github_issue_comment_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "INT64"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_integration_tests", "github_issue_comment_data"], "unique_id": "seed.github_integration_tests.github_issue_comment_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_issue_comment_data.csv", "original_file_path": "seeds/github_issue_comment_data.csv", "name": "github_issue_comment_data", "alias": "github_issue_comment_data", "checksum": {"name": "sha256", "checksum": "6cc173c061308bc4de703c7c5d0fc30228b2c86117ed7db1daf9decf1a4238cd"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "created_at": 1667263067.494654, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`github_issue_comment_data`"}, "seed.github_integration_tests.github_issue_assignee_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_integration_tests", "github_issue_assignee_data"], "unique_id": "seed.github_integration_tests.github_issue_assignee_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_issue_assignee_data.csv", "original_file_path": "seeds/github_issue_assignee_data.csv", "name": "github_issue_assignee_data", "alias": "github_issue_assignee_data", "checksum": {"name": "sha256", "checksum": "fe25fadc4593349b873b50da5e2e2fbf436cbb3c1bcfe325c3340c64a7d8972b"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1667263067.495799, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`github_issue_assignee_data`"}, "seed.github_integration_tests.github_issue_closed_history_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "updated_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_integration_tests", "github_issue_closed_history_data"], "unique_id": "seed.github_integration_tests.github_issue_closed_history_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_issue_closed_history_data.csv", "original_file_path": "seeds/github_issue_closed_history_data.csv", "name": "github_issue_closed_history_data", "alias": "github_issue_closed_history_data", "checksum": {"name": "sha256", "checksum": "5f281ce9e29e69280633dc6aae2e9f8028c86815442821a608bb793c82aab3f1"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"updated_at": "timestamp"}}, "created_at": 1667263067.497047, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`github_issue_closed_history_data`"}, "seed.github_integration_tests.github_pull_request_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_integration_tests", "github_pull_request_data"], "unique_id": "seed.github_integration_tests.github_pull_request_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_pull_request_data.csv", "original_file_path": "seeds/github_pull_request_data.csv", "name": "github_pull_request_data", "alias": "github_pull_request_data", "checksum": {"name": "sha256", "checksum": "1e27d3e9b6881a3fda6402b048071032411d81612ff4b2009d852a194b137006"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1667263067.4981918, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`github_pull_request_data`"}, "seed.github_integration_tests.github_team_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_integration_tests", "github_team_data"], "unique_id": "seed.github_integration_tests.github_team_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_team_data.csv", "original_file_path": "seeds/github_team_data.csv", "name": "github_team_data", "alias": "github_team_data", "checksum": {"name": "sha256", "checksum": "a3916608387192c2bcec219067bd19e3280a23a3d4f546390e5d7e9aa16420bd"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1667263067.499292, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`github_team_data`"}, "seed.github_integration_tests.github_user_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_integration_tests", "github_user_data"], "unique_id": "seed.github_integration_tests.github_user_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_user_data.csv", "original_file_path": "seeds/github_user_data.csv", "name": "github_user_data", "alias": "github_user_data", "checksum": {"name": "sha256", "checksum": "5d101839c6a685fac17231a071c6516f3ac668b133d7a96a83d97ede20f16e46"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1667263067.500515, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`github_user_data`"}, "model.github.github__weekly_metrics": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.date_trunc"], "nodes": ["model.github.github__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github", "github__weekly_metrics"], "unique_id": "model.github.github__weekly_metrics", "raw_code": "with daily_metrics as (\n select *\n from {{ ref('github__daily_metrics') }}\n)\n\nselect \n {{ dbt.date_trunc('week', 'day') }} as week, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__weekly_metrics.sql", "original_file_path": "models/github__weekly_metrics.sql", "name": "github__weekly_metrics", "alias": "github__weekly_metrics", "checksum": {"name": "sha256", "checksum": "0c23e13d9ae5aa9256b832965069a021826131bbcf8c23be244b660d1a513870"}, "tags": [], "refs": [["github__daily_metrics"]], "sources": [], "metrics": [], "description": "Summary numbers for issues and pull requests by week\n", "columns": {"week": {"name": "week", "description": "The reporting week", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_opened": {"name": "number_issues_opened", "description": "The total number of issues created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_closed": {"name": "number_issues_closed", "description": "The total number of issues closed during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_issue_open": {"name": "avg_days_issue_open", "description": "The average number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_issue_open": {"name": "longest_days_issue_open", "description": "The longest number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_opened": {"name": "number_prs_opened", "description": "The total number of pull requests created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_merged": {"name": "number_prs_merged", "description": "The total number of pull requests merged during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_closed_without_merge": {"name": "number_prs_closed_without_merge", "description": "The total number of pull requests closed without a merge during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_pr_open": {"name": "avg_days_pr_open", "description": "The average number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_pr_open": {"name": "longest_days_pr_open", "description": "The longest number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__weekly_metrics.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667263067.7840981, "compiled_code": "with daily_metrics as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`github__daily_metrics`\n)\n\nselect \n timestamp_trunc(\n cast(day as timestamp),\n week\n ) as week, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`github__weekly_metrics`"}, "model.github.github__monthly_metrics": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.date_trunc"], "nodes": ["model.github.github__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github", "github__monthly_metrics"], "unique_id": "model.github.github__monthly_metrics", "raw_code": "with daily_metrics as (\n select *\n from {{ ref('github__daily_metrics') }}\n)\n\nselect \n {{ dbt.date_trunc('month', 'day') }} as month, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__monthly_metrics.sql", "original_file_path": "models/github__monthly_metrics.sql", "name": "github__monthly_metrics", "alias": "github__monthly_metrics", "checksum": {"name": "sha256", "checksum": "13125ad4966c9d1caa3cd74e6174cc3845a7ceb7929836e849e70628af2b0d0d"}, "tags": [], "refs": [["github__daily_metrics"]], "sources": [], "metrics": [], "description": "Summary numbers for issues and pull requests by month\n", "columns": {"month": {"name": "month", "description": "The reporting month", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_opened": {"name": "number_issues_opened", "description": "The total number of issues created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_closed": {"name": "number_issues_closed", "description": "The total number of issues closed during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_issue_open": {"name": "avg_days_issue_open", "description": "The average number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_issue_open": {"name": "longest_days_issue_open", "description": "The longest number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_opened": {"name": "number_prs_opened", "description": "The total number of pull requests created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_merged": {"name": "number_prs_merged", "description": "The total number of pull requests merged during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_closed_without_merge": {"name": "number_prs_closed_without_merge", "description": "The total number of pull requests closed without a merge during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_pr_open": {"name": "avg_days_pr_open", "description": "The average number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_pr_open": {"name": "longest_days_pr_open", "description": "The longest number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__monthly_metrics.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667263067.785713, "compiled_code": "with daily_metrics as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`github__daily_metrics`\n)\n\nselect \n timestamp_trunc(\n cast(day as timestamp),\n month\n ) as month, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`github__monthly_metrics`"}, "model.github.github__quarterly_metrics": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.date_trunc"], "nodes": ["model.github.github__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github", "github__quarterly_metrics"], "unique_id": "model.github.github__quarterly_metrics", "raw_code": "with daily_metrics as (\n select *\n from {{ ref('github__daily_metrics') }}\n)\n\nselect \n {{ dbt.date_trunc('quarter', 'day') }} as quarter, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\n\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__quarterly_metrics.sql", "original_file_path": "models/github__quarterly_metrics.sql", "name": "github__quarterly_metrics", "alias": "github__quarterly_metrics", "checksum": {"name": "sha256", "checksum": "482a40e9b5ae8283bec98905910cc35747f7f98accd058453d69064844533c50"}, "tags": [], "refs": [["github__daily_metrics"]], "sources": [], "metrics": [], "description": "Summary numbers for issues and pull requests by quarter\n", "columns": {"quarter": {"name": "quarter", "description": "The reporting quarter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_opened": {"name": "number_issues_opened", "description": "The total number of issues created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_closed": {"name": "number_issues_closed", "description": "The total number of issues closed during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_issue_open": {"name": "avg_days_issue_open", "description": "The average number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_issue_open": {"name": "longest_days_issue_open", "description": "The longest number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_opened": {"name": "number_prs_opened", "description": "The total number of pull requests created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_merged": {"name": "number_prs_merged", "description": "The total number of pull requests merged during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_closed_without_merge": {"name": "number_prs_closed_without_merge", "description": "The total number of pull requests closed without a merge during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_pr_open": {"name": "avg_days_pr_open", "description": "The average number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_pr_open": {"name": "longest_days_pr_open", "description": "The longest number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__quarterly_metrics.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667263067.787318, "compiled_code": "with daily_metrics as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`github__daily_metrics`\n)\n\nselect \n timestamp_trunc(\n cast(day as timestamp),\n quarter\n ) as quarter, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\n\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`github__quarterly_metrics`"}, "model.github.github__pull_requests": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.github.int_github__issue_joined"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github", "github__pull_requests"], "unique_id": "model.github.github__pull_requests", "raw_code": "with issue_joined as (\n select *\n from {{ ref('int_github__issue_joined') }} \n)\n\nselect\n *\nfrom issue_joined\nwhere is_pull_request", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__pull_requests.sql", "original_file_path": "models/github__pull_requests.sql", "name": "github__pull_requests", "alias": "github__pull_requests", "checksum": {"name": "sha256", "checksum": "ab4761ae05c0aabc7585d92ed7c68e12b53317a47a4278810e1777a051f43350"}, "tags": [], "refs": [["int_github__issue_joined"]], "sources": [], "metrics": [], "description": "Basic information about pull_requests as well as additional fields about reviews and time between actions\n", "columns": {"issue_id": {"name": "issue_id", "description": "The unique ID of an issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "body": {"name": "body", "description": "the text body of the description of the pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed_at": {"name": "closed_at", "description": "Timestamp of when the pull request was closed. NULL for pull requests that are still open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the pull request was created", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_locked": {"name": "is_locked", "description": "Boolean indicating whether the issue is locked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "milestone_id": {"name": "milestone_id", "description": "Foreign key that references the milestone.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_pull_request": {"name": "is_pull_request", "description": "Boolean indiciating whether the issue is a pull request.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_number": {"name": "issue_number", "description": "The number of the pull request. Unique within a repository, but not accross.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_id": {"name": "repository_id", "description": "Foreign key that references the repository table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the issue was last updated", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "days_issue_open": {"name": "days_issue_open", "description": "The number of days an issue has been open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_times_reopened": {"name": "number_of_times_reopened", "description": "Total number of times the issue was reopened", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_comments": {"name": "number_of_comments", "description": "The total number of comments included in the issue", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_login_name": {"name": "creator_login_name", "description": "User that created the issue login name", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_name": {"name": "creator_name", "description": "User that created the issue name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_company": {"name": "creator_company", "description": "User that created the issue company name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the pull request is open or closed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url_link": {"name": "url_link", "description": "A link to the pull request on github.com", "meta": {}, "data_type": null, "quote": null, "tags": []}, "labels": {"name": "labels", "description": "The labels currently applied to the pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository": {"name": "repository", "description": "The repository that the pull request applies to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_team_names": {"name": "repository_team_names", "description": "An aggreate of the teams associated with the repository", "meta": {}, "data_type": null, "quote": null, "tags": []}, "assignees": {"name": "assignees", "description": "Users who have been assigned to the pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hours_request_review_to_first_review": {"name": "hours_request_review_to_first_review", "description": "Number of hours between the first request for review and a review", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hours_request_review_to_first_action": {"name": "hours_request_review_to_first_action", "description": "Number of hours between the first request for review and any action besides dismissing the request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hours_request_review_to_merge": {"name": "hours_request_review_to_merge", "description": "Number of hours between the first request for review and the pull request being merged", "meta": {}, "data_type": null, "quote": null, "tags": []}, "merged_at": {"name": "merged_at", "description": "Timestamp of when the pull request was merged", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reviewers": {"name": "reviewers", "description": "List of Users who reviewed the pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_reviews": {"name": "number_of_reviews", "description": "Number of times a pull request was reviewed", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__pull_requests.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667263067.780905, "compiled_code": "with __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n), __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n), __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n), __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n), __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n), __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n), __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n), __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n), __dbt__cte__int_github__issue_joined as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\n), \n\nissue_labels as (\n select *\n from __dbt__cte__int_github__issue_labels\n), \n\nrepository_teams as (\n select \n \n *\n from __dbt__cte__int_github__repository_teams\n\n \n), \n\nissue_assignees as (\n select *\n from __dbt__cte__int_github__issue_assignees\n), \n\nissue_open_length as (\n select *\n from __dbt__cte__int_github__issue_open_length\n), \n\nissue_comments as (\n select *\n from __dbt__cte__int_github__issue_comments\n), \n\ncreator as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\n), \n\npull_request_times as (\n select *\n from __dbt__cte__int_github__pull_request_times\n), \n\npull_request_reviewers as (\n select *\n from __dbt__cte__int_github__pull_request_reviewers\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request`\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then 'https://github.com/' || repository_teams.repository || '/pull/' || issue.issue_number\n else 'https://github.com/' || repository_teams.repository || '/issues/' || issue.issue_number\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n \n repository_teams.repository_team_names,\n \n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id\n),issue_joined as (\n select *\n from __dbt__cte__int_github__issue_joined \n)\n\nselect\n *\nfrom issue_joined\nwhere is_pull_request", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.github.int_github__issue_label_joined", "sql": " __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n)"}, {"id": "model.github.int_github__issue_labels", "sql": " __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n)"}, {"id": "model.github.int_github__repository_teams", "sql": " __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n)"}, {"id": "model.github.int_github__issue_assignees", "sql": " __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n)"}, {"id": "model.github.int_github__issue_open_length", "sql": " __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n)"}, {"id": "model.github.int_github__issue_comments", "sql": " __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n)"}, {"id": "model.github.int_github__pull_request_times", "sql": " __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n)"}, {"id": "model.github.int_github__pull_request_reviewers", "sql": " __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n)"}, {"id": "model.github.int_github__issue_joined", "sql": " __dbt__cte__int_github__issue_joined as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\n), \n\nissue_labels as (\n select *\n from __dbt__cte__int_github__issue_labels\n), \n\nrepository_teams as (\n select \n \n *\n from __dbt__cte__int_github__repository_teams\n\n \n), \n\nissue_assignees as (\n select *\n from __dbt__cte__int_github__issue_assignees\n), \n\nissue_open_length as (\n select *\n from __dbt__cte__int_github__issue_open_length\n), \n\nissue_comments as (\n select *\n from __dbt__cte__int_github__issue_comments\n), \n\ncreator as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\n), \n\npull_request_times as (\n select *\n from __dbt__cte__int_github__pull_request_times\n), \n\npull_request_reviewers as (\n select *\n from __dbt__cte__int_github__pull_request_reviewers\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request`\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then 'https://github.com/' || repository_teams.repository || '/pull/' || issue.issue_number\n else 'https://github.com/' || repository_teams.repository || '/issues/' || issue.issue_number\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n \n repository_teams.repository_team_names,\n \n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id\n)"}], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`github__pull_requests`"}, "model.github.github__daily_metrics": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.date_trunc"], "nodes": ["model.github.github__issues", "model.github.github__pull_requests"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github", "github__daily_metrics"], "unique_id": "model.github.github__daily_metrics", "raw_code": "with github_issues as (\n select *\n from {{ ref('github__issues') }}\n), \n\npull_requests as (\n select *\n from {{ ref('github__pull_requests') }}\n), \n\nissues_opened_per_day as (\n select \n {{ dbt.date_trunc('day', 'created_at') }} as day, \n count(*) as number_issues_opened,\n sum(days_issue_open) as sum_days_issue_open,\n max(days_issue_open) as longest_days_issue_open\n from github_issues\n group by 1\n), \n\nissues_closed_per_day as (\n select \n {{ dbt.date_trunc('day', 'closed_at') }} as day, \n count(*) as number_issues_closed\n from github_issues\n where closed_at is not null\n group by 1\n), \n\nprs_opened_per_day as (\n select \n {{ dbt.date_trunc('day', 'created_at') }} as day, \n count(*) as number_prs_opened,\n sum(days_issue_open) as sum_days_pr_open,\n max(days_issue_open) as longest_days_pr_open\n from pull_requests\n group by 1\n), \n\nprs_merged_per_day as (\n select \n {{ dbt.date_trunc('day', 'merged_at') }} as day, \n count(*) as number_prs_merged\n from pull_requests\n where merged_at is not null\n group by 1\n), \n\nprs_closed_without_merge_per_day as (\n select \n {{ dbt.date_trunc('day', 'closed_at') }} as day, \n count(*) as number_prs_closed_without_merge\n from pull_requests\n where closed_at is not null\n and merged_at is null\n group by 1\n), \n\nissues_per_day as (\n select \n coalesce(issues_opened_per_day.day, \n issues_closed_per_day.day\n ) as day,\n number_issues_opened,\n number_issues_closed, \n sum_days_issue_open,\n longest_days_issue_open\n from issues_opened_per_day\n full outer join issues_closed_per_day on issues_opened_per_day.day = issues_closed_per_day.day\n), \n\nprs_per_day as (\n select \n coalesce(prs_opened_per_day.day, \n prs_merged_per_day.day,\n prs_closed_without_merge_per_day.day\n ) as day,\n number_prs_opened,\n number_prs_merged,\n number_prs_closed_without_merge,\n sum_days_pr_open,\n longest_days_pr_open\n from prs_opened_per_day\n full outer join prs_merged_per_day on prs_opened_per_day.day = prs_merged_per_day.day\n full outer join prs_closed_without_merge_per_day on coalesce(prs_opened_per_day.day, prs_merged_per_day.day) = prs_closed_without_merge_per_day.day\n)\n\nselect \n coalesce(issues_per_day.day, prs_per_day.day) as day,\n coalesce(number_issues_opened, 0) as number_issues_opened,\n coalesce(number_issues_closed, 0) as number_issues_closed,\n sum_days_issue_open,\n longest_days_issue_open,\n coalesce(number_prs_opened, 0) as number_prs_opened,\n coalesce(number_prs_merged, 0) as number_prs_merged,\n coalesce(number_prs_closed_without_merge, 0) as number_prs_closed_without_merge,\n sum_days_pr_open,\n longest_days_pr_open\nfrom issues_per_day \nfull outer join prs_per_day on issues_per_day.day = prs_per_day.day\norder by day desc", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__daily_metrics.sql", "original_file_path": "models/github__daily_metrics.sql", "name": "github__daily_metrics", "alias": "github__daily_metrics", "checksum": {"name": "sha256", "checksum": "a6ee3eb9c8198f8b11e48b8e0206e90860a02af8a20f748985a58499dde4f476"}, "tags": [], "refs": [["github__issues"], ["github__pull_requests"]], "sources": [], "metrics": [], "description": "Summary numbers for issues and pull requests by day\n", "columns": {"day": {"name": "day", "description": "The reporting day", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_opened": {"name": "number_issues_opened", "description": "The total number of issues created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_closed": {"name": "number_issues_closed", "description": "The total number of issues closed during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sum_days_issue_open": {"name": "sum_days_issue_open", "description": "The total number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_issue_open": {"name": "longest_days_issue_open", "description": "The longest number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_opened": {"name": "number_prs_opened", "description": "The total number of pull requests created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_merged": {"name": "number_prs_merged", "description": "The total number of pull requests merged during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_closed_without_merge": {"name": "number_prs_closed_without_merge", "description": "The total number of pull requests closed without a merge during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sum_days_pr_open": {"name": "sum_days_pr_open", "description": "The total number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_pr_open": {"name": "longest_days_pr_open", "description": "The longest number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__daily_metrics.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667263067.78254, "compiled_code": "with github_issues as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`github__issues`\n), \n\npull_requests as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`github__pull_requests`\n), \n\nissues_opened_per_day as (\n select \n timestamp_trunc(\n cast(created_at as timestamp),\n day\n ) as day, \n count(*) as number_issues_opened,\n sum(days_issue_open) as sum_days_issue_open,\n max(days_issue_open) as longest_days_issue_open\n from github_issues\n group by 1\n), \n\nissues_closed_per_day as (\n select \n timestamp_trunc(\n cast(closed_at as timestamp),\n day\n ) as day, \n count(*) as number_issues_closed\n from github_issues\n where closed_at is not null\n group by 1\n), \n\nprs_opened_per_day as (\n select \n timestamp_trunc(\n cast(created_at as timestamp),\n day\n ) as day, \n count(*) as number_prs_opened,\n sum(days_issue_open) as sum_days_pr_open,\n max(days_issue_open) as longest_days_pr_open\n from pull_requests\n group by 1\n), \n\nprs_merged_per_day as (\n select \n timestamp_trunc(\n cast(merged_at as timestamp),\n day\n ) as day, \n count(*) as number_prs_merged\n from pull_requests\n where merged_at is not null\n group by 1\n), \n\nprs_closed_without_merge_per_day as (\n select \n timestamp_trunc(\n cast(closed_at as timestamp),\n day\n ) as day, \n count(*) as number_prs_closed_without_merge\n from pull_requests\n where closed_at is not null\n and merged_at is null\n group by 1\n), \n\nissues_per_day as (\n select \n coalesce(issues_opened_per_day.day, \n issues_closed_per_day.day\n ) as day,\n number_issues_opened,\n number_issues_closed, \n sum_days_issue_open,\n longest_days_issue_open\n from issues_opened_per_day\n full outer join issues_closed_per_day on issues_opened_per_day.day = issues_closed_per_day.day\n), \n\nprs_per_day as (\n select \n coalesce(prs_opened_per_day.day, \n prs_merged_per_day.day,\n prs_closed_without_merge_per_day.day\n ) as day,\n number_prs_opened,\n number_prs_merged,\n number_prs_closed_without_merge,\n sum_days_pr_open,\n longest_days_pr_open\n from prs_opened_per_day\n full outer join prs_merged_per_day on prs_opened_per_day.day = prs_merged_per_day.day\n full outer join prs_closed_without_merge_per_day on coalesce(prs_opened_per_day.day, prs_merged_per_day.day) = prs_closed_without_merge_per_day.day\n)\n\nselect \n coalesce(issues_per_day.day, prs_per_day.day) as day,\n coalesce(number_issues_opened, 0) as number_issues_opened,\n coalesce(number_issues_closed, 0) as number_issues_closed,\n sum_days_issue_open,\n longest_days_issue_open,\n coalesce(number_prs_opened, 0) as number_prs_opened,\n coalesce(number_prs_merged, 0) as number_prs_merged,\n coalesce(number_prs_closed_without_merge, 0) as number_prs_closed_without_merge,\n sum_days_pr_open,\n longest_days_pr_open\nfrom issues_per_day \nfull outer join prs_per_day on issues_per_day.day = prs_per_day.day\norder by day desc", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`github__daily_metrics`"}, "model.github.github__issues": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.github.int_github__issue_joined"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github", "github__issues"], "unique_id": "model.github.github__issues", "raw_code": "with issue_joined as (\n select *\n from {{ ref('int_github__issue_joined') }} \n)\n\nselect\n issue_id,\n body,\n closed_at,\n created_at,\n is_locked,\n milestone_id,\n issue_number,\n is_pull_request,\n repository_id,\n state,\n title,\n updated_at,\n user_id,\n url_link,\n days_issue_open,\n number_of_times_reopened,\n labels,\n number_of_comments,\n repository,\n {% if var('github__using_repo_team', true) %}\n repository_team_names,\n {% endif %}\n assignees,\n creator_login_name,\n creator_name,\n creator_company\nfrom issue_joined\nwhere not is_pull_request", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__issues.sql", "original_file_path": "models/github__issues.sql", "name": "github__issues", "alias": "github__issues", "checksum": {"name": "sha256", "checksum": "382d94f82ea63be958d53cc7353d6e3e792844f45ab9c48609e03355eb68a133"}, "tags": [], "refs": [["int_github__issue_joined"]], "sources": [], "metrics": [], "description": "Basic information about issues as well as additional fields for things like assignees, projects, labels and open time\n", "columns": {"issue_id": {"name": "issue_id", "description": "The unique ID of an issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "body": {"name": "body", "description": "The text body of the issue's main description", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed_at": {"name": "closed_at", "description": "The timestamp for when an issue was last closed. \"null\" for issues that are open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The timestamp for when an issue was created", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_locked": {"name": "is_locked", "description": "Boolean indicating if the issue is locked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "milestone_id": {"name": "milestone_id", "description": "Foreign key that references the milestone table representing the current milestone the issue is in", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_number": {"name": "issue_number", "description": "The number of the issue. Is unique within a repository, but not accross", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_pull_request": {"name": "is_pull_request", "description": "Boolean indicating whether the issue is a pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_id": {"name": "repository_id", "description": "Foreign key that references the repository table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the issue is open or closed", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the issue", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the issue was last updated", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url_link": {"name": "url_link", "description": "a link to the issue on github.com", "meta": {}, "data_type": null, "quote": null, "tags": []}, "days_issue_open": {"name": "days_issue_open", "description": "The number of days an issue has been open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_times_reopened": {"name": "number_of_times_reopened", "description": "Total number of times the issue was reopened", "meta": {}, "data_type": null, "quote": null, "tags": []}, "labels": {"name": "labels", "description": "A list of the labels that are currently applied to the issue", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_comments": {"name": "number_of_comments", "description": "The total number of comments included in the issue", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_login_name": {"name": "creator_login_name", "description": "User that created the issue login name", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_name": {"name": "creator_name", "description": "User that created the issue name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_company": {"name": "creator_company", "description": "User that created the issue company name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository": {"name": "repository", "description": "The repository that the issue is applicable to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_team_names": {"name": "repository_team_names", "description": "An aggreate of the teams associated with the repository", "meta": {}, "data_type": null, "quote": null, "tags": []}, "assignees": {"name": "assignees", "description": "The current list of users assigned to the issue", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__issues.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667263067.776181, "compiled_code": "with __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n), __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n), __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n), __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n), __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n), __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n), __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n), __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n), __dbt__cte__int_github__issue_joined as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\n), \n\nissue_labels as (\n select *\n from __dbt__cte__int_github__issue_labels\n), \n\nrepository_teams as (\n select \n \n *\n from __dbt__cte__int_github__repository_teams\n\n \n), \n\nissue_assignees as (\n select *\n from __dbt__cte__int_github__issue_assignees\n), \n\nissue_open_length as (\n select *\n from __dbt__cte__int_github__issue_open_length\n), \n\nissue_comments as (\n select *\n from __dbt__cte__int_github__issue_comments\n), \n\ncreator as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\n), \n\npull_request_times as (\n select *\n from __dbt__cte__int_github__pull_request_times\n), \n\npull_request_reviewers as (\n select *\n from __dbt__cte__int_github__pull_request_reviewers\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request`\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then 'https://github.com/' || repository_teams.repository || '/pull/' || issue.issue_number\n else 'https://github.com/' || repository_teams.repository || '/issues/' || issue.issue_number\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n \n repository_teams.repository_team_names,\n \n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id\n),issue_joined as (\n select *\n from __dbt__cte__int_github__issue_joined \n)\n\nselect\n issue_id,\n body,\n closed_at,\n created_at,\n is_locked,\n milestone_id,\n issue_number,\n is_pull_request,\n repository_id,\n state,\n title,\n updated_at,\n user_id,\n url_link,\n days_issue_open,\n number_of_times_reopened,\n labels,\n number_of_comments,\n repository,\n \n repository_team_names,\n \n assignees,\n creator_login_name,\n creator_name,\n creator_company\nfrom issue_joined\nwhere not is_pull_request", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.github.int_github__issue_label_joined", "sql": " __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n)"}, {"id": "model.github.int_github__issue_labels", "sql": " __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n)"}, {"id": "model.github.int_github__repository_teams", "sql": " __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n)"}, {"id": "model.github.int_github__issue_assignees", "sql": " __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n)"}, {"id": "model.github.int_github__issue_open_length", "sql": " __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n)"}, {"id": "model.github.int_github__issue_comments", "sql": " __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n)"}, {"id": "model.github.int_github__pull_request_times", "sql": " __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n)"}, {"id": "model.github.int_github__pull_request_reviewers", "sql": " __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n)"}, {"id": "model.github.int_github__issue_joined", "sql": " __dbt__cte__int_github__issue_joined as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\n), \n\nissue_labels as (\n select *\n from __dbt__cte__int_github__issue_labels\n), \n\nrepository_teams as (\n select \n \n *\n from __dbt__cte__int_github__repository_teams\n\n \n), \n\nissue_assignees as (\n select *\n from __dbt__cte__int_github__issue_assignees\n), \n\nissue_open_length as (\n select *\n from __dbt__cte__int_github__issue_open_length\n), \n\nissue_comments as (\n select *\n from __dbt__cte__int_github__issue_comments\n), \n\ncreator as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\n), \n\npull_request_times as (\n select *\n from __dbt__cte__int_github__pull_request_times\n), \n\npull_request_reviewers as (\n select *\n from __dbt__cte__int_github__pull_request_reviewers\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request`\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then 'https://github.com/' || repository_teams.repository || '/pull/' || issue.issue_number\n else 'https://github.com/' || repository_teams.repository || '/issues/' || issue.issue_number\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n \n repository_teams.repository_team_names,\n \n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id\n)"}], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`github__issues`"}, "model.github.int_github__pull_request_times": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt.datediff"], "nodes": ["model.github_source.stg_github__pull_request_review", "model.github_source.stg_github__pull_request", "model.github_source.stg_github__requested_reviewer_history", "model.github_source.stg_github__issue", "model.github_source.stg_github__issue_merged"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github", "intermediate", "int_github__pull_request_times"], "unique_id": "model.github.int_github__pull_request_times", "raw_code": "with pull_request_review as (\n select *\n from {{ var('pull_request_review') }}\n), \n\npull_request as (\n select *\n from {{ var('pull_request')}}\n), \n\nrequested_reviewer_history as (\n select *\n from {{ var('requested_reviewer_history')}}\n where not removed\n), \n\nissue as (\n select *\n from {{ var('issue') }}\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from {{ var('issue_merged')}}\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n {{ dbt.datediff(\n 'time_of_first_request', \n \"coalesce(time_of_first_review_post_request, \" ~ dbt.current_timestamp_backcompat() ~ \")\", \n 'second') \n }}/ 60/60 as hours_request_review_to_first_review,\n {{ dbt.datediff(\n 'time_of_first_request', \n \"least(\n coalesce(time_of_first_requested_reviewer_review, \" ~ dbt.current_timestamp_backcompat() ~ \"),\n coalesce(issue.closed_at, \" ~ dbt.current_timestamp_backcompat() ~ \"))\", \n 'second') \n }} / 60/60 as hours_request_review_to_first_action,\n {{ dbt.datediff('time_of_first_request', 'merged_at', 'second') }}/ 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__pull_request_times.sql", "original_file_path": "models/intermediate/int_github__pull_request_times.sql", "name": "int_github__pull_request_times", "alias": "int_github__pull_request_times", "checksum": {"name": "sha256", "checksum": "35a197fef6ef12f2b408564be9d54b15ba8ff1eee0cf8514abedef9f7818422c"}, "tags": [], "refs": [["stg_github__pull_request_review"], ["stg_github__pull_request"], ["stg_github__requested_reviewer_history"], ["stg_github__issue"], ["stg_github__issue_merged"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__pull_request_times.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1667263067.5416598, "compiled_code": "with pull_request_review as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__pull_request_reviewers": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.github_source.stg_github__pull_request_review", "model.github_source.stg_github__user"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github", "intermediate", "int_github__pull_request_reviewers"], "unique_id": "model.github.int_github__pull_request_reviewers", "raw_code": "with pull_request_review as (\n select *\n from {{ var('pull_request_review') }}\n), \n\ngithub_user as (\n select *\n from {{ var('user')}}\n)\n\nselect\n pull_request_review.pull_request_id,\n {{ fivetran_utils.string_agg( 'github_user.login_name', \"', '\" )}} as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__pull_request_reviewers.sql", "original_file_path": "models/intermediate/int_github__pull_request_reviewers.sql", "name": "int_github__pull_request_reviewers", "alias": "int_github__pull_request_reviewers", "checksum": {"name": "sha256", "checksum": "fd5518273ce75ae9066be686308ee078ce9a3df73f3799620f8eb6e611655cd7"}, "tags": [], "refs": [["stg_github__pull_request_review"], ["stg_github__user"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__pull_request_reviewers.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1667263067.551459, "compiled_code": "with pull_request_review as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__issue_label_joined": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.github_source.stg_github__issue_label", "model.github_source.stg_github__label"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_label_joined"], "unique_id": "model.github.int_github__issue_label_joined", "raw_code": "with issue_label as (\n\n select *\n from {{ var('issue_label') }}\n\n), label as (\n\n select *\n from {{ var('label') }}\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_label_joined.sql", "original_file_path": "models/intermediate/int_github__issue_label_joined.sql", "name": "int_github__issue_label_joined", "alias": "int_github__issue_label_joined", "checksum": {"name": "sha256", "checksum": "6f1b225ff9958e67fae4ea1ba0be10ebb9426da364c758c37d0b83305d575d98"}, "tags": [], "refs": [["stg_github__issue_label"], ["stg_github__label"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_label_joined.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1667263067.556171, "compiled_code": "with issue_label as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__issue_joined": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.concat"], "nodes": ["model.github_source.stg_github__issue", "model.github.int_github__issue_labels", "model.github.int_github__repository_teams", "model.github.int_github__issue_assignees", "model.github.int_github__issue_open_length", "model.github.int_github__issue_comments", "model.github_source.stg_github__user", "model.github.int_github__pull_request_times", "model.github.int_github__pull_request_reviewers", "model.github_source.stg_github__pull_request"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_joined"], "unique_id": "model.github.int_github__issue_joined", "raw_code": "with issue as (\n select *\n from {{ var('issue') }}\n), \n\nissue_labels as (\n select *\n from {{ ref('int_github__issue_labels')}}\n), \n\nrepository_teams as (\n select \n {% if var('github__using_repo_team', true) %}\n *\n from {{ ref('int_github__repository_teams') }}\n\n {% else %}\n repository_id,\n full_name as repository\n from {{ var('repository') }}\n\n {% endif %}\n), \n\nissue_assignees as (\n select *\n from {{ ref('int_github__issue_assignees')}}\n), \n\nissue_open_length as (\n select *\n from {{ ref('int_github__issue_open_length')}}\n), \n\nissue_comments as (\n select *\n from {{ ref('int_github__issue_comments')}}\n), \n\ncreator as (\n select *\n from {{ var('user')}}\n), \n\npull_request_times as (\n select *\n from {{ ref('int_github__pull_request_times')}}\n), \n\npull_request_reviewers as (\n select *\n from {{ ref('int_github__pull_request_reviewers')}}\n), \n\npull_request as (\n select *\n from {{ var('pull_request')}}\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then {{ dbt.concat([\"'https://github.com/'\",'repository_teams.repository',\"'/pull/'\", 'issue.issue_number']) }}\n else {{ dbt.concat([\"'https://github.com/'\",'repository_teams.repository',\"'/issues/'\", 'issue.issue_number']) }}\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n {% if var('github__using_repo_team', true) %}\n repository_teams.repository_team_names,\n {% endif %}\n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_joined.sql", "original_file_path": "models/intermediate/int_github__issue_joined.sql", "name": "int_github__issue_joined", "alias": "int_github__issue_joined", "checksum": {"name": "sha256", "checksum": "75658855b696a3744360bbbf58433d6155e44d35128236e08da3df93b87ead16"}, "tags": [], "refs": [["stg_github__issue"], ["int_github__issue_labels"], ["int_github__repository_teams"], ["int_github__issue_assignees"], ["int_github__issue_open_length"], ["int_github__issue_comments"], ["stg_github__user"], ["int_github__pull_request_times"], ["int_github__pull_request_reviewers"], ["stg_github__pull_request"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_joined.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1667263067.559647, "compiled_code": "with __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n), __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n), __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n), __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n), __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n), __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n), __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n), __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n),issue as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\n), \n\nissue_labels as (\n select *\n from __dbt__cte__int_github__issue_labels\n), \n\nrepository_teams as (\n select \n \n *\n from __dbt__cte__int_github__repository_teams\n\n \n), \n\nissue_assignees as (\n select *\n from __dbt__cte__int_github__issue_assignees\n), \n\nissue_open_length as (\n select *\n from __dbt__cte__int_github__issue_open_length\n), \n\nissue_comments as (\n select *\n from __dbt__cte__int_github__issue_comments\n), \n\ncreator as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\n), \n\npull_request_times as (\n select *\n from __dbt__cte__int_github__pull_request_times\n), \n\npull_request_reviewers as (\n select *\n from __dbt__cte__int_github__pull_request_reviewers\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request`\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then 'https://github.com/' || repository_teams.repository || '/pull/' || issue.issue_number\n else 'https://github.com/' || repository_teams.repository || '/issues/' || issue.issue_number\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n \n repository_teams.repository_team_names,\n \n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.github.int_github__issue_label_joined", "sql": " __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n)"}, {"id": "model.github.int_github__issue_labels", "sql": " __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n)"}, {"id": "model.github.int_github__repository_teams", "sql": " __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n)"}, {"id": "model.github.int_github__issue_assignees", "sql": " __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n)"}, {"id": "model.github.int_github__issue_open_length", "sql": " __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n)"}, {"id": "model.github.int_github__issue_comments", "sql": " __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n)"}, {"id": "model.github.int_github__pull_request_times", "sql": " __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n)"}, {"id": "model.github.int_github__pull_request_reviewers", "sql": " __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n)"}], "relation_name": null}, "model.github.int_github__issue_labels": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.github.int_github__issue_label_joined"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_labels"], "unique_id": "model.github.int_github__issue_labels", "raw_code": "with issue_label as (\n select *\n from {{ ref('int_github__issue_label_joined') }}\n)\n\nselect\n issue_id,\n {{ fivetran_utils.string_agg( 'label', \"', '\" )}} as labels\nfrom issue_label\ngroup by issue_id", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_labels.sql", "original_file_path": "models/intermediate/int_github__issue_labels.sql", "name": "int_github__issue_labels", "alias": "int_github__issue_labels", "checksum": {"name": "sha256", "checksum": "126b7de5034d8b9e5067e9d0a346ea3d93132574cc3ae85d4d711270404f4064"}, "tags": [], "refs": [["int_github__issue_label_joined"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_labels.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1667263067.566566, "compiled_code": "with __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n),issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.github.int_github__issue_label_joined", "sql": " __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n)"}], "relation_name": null}, "model.github.int_github__issue_assignees": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.github_source.stg_github__issue_assignee", "model.github_source.stg_github__user"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_assignees"], "unique_id": "model.github.int_github__issue_assignees", "raw_code": "with issue_assignee as (\n select *\n from {{ var('issue_assignee') }}\n), \n\ngithub_user as (\n select *\n from {{ var('user')}}\n)\n\nselect\n issue_assignee.issue_id,\n {{ fivetran_utils.string_agg( 'github_user.login_name', \"', '\" )}} as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_assignees.sql", "original_file_path": "models/intermediate/int_github__issue_assignees.sql", "name": "int_github__issue_assignees", "alias": "int_github__issue_assignees", "checksum": {"name": "sha256", "checksum": "837310bb78ff6f1460babc622037227dbc0c5776aae3ce3f5e9de48cb2ffac9c"}, "tags": [], "refs": [["stg_github__issue_assignee"], ["stg_github__user"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_assignees.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1667263067.569479, "compiled_code": "with issue_assignee as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__issue_comments": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.github_source.stg_github__issue_comment"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_comments"], "unique_id": "model.github.int_github__issue_comments", "raw_code": "with issue_comment as (\n select *\n from {{ var('issue_comment') }}\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_comments.sql", "original_file_path": "models/intermediate/int_github__issue_comments.sql", "name": "int_github__issue_comments", "alias": "int_github__issue_comments", "checksum": {"name": "sha256", "checksum": "b56ffccc19ec39a1d1bc4137557c8e1971167f97e673ea30d0f713bd34bc111a"}, "tags": [], "refs": [["stg_github__issue_comment"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_comments.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1667263067.57319, "compiled_code": "with issue_comment as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__issue_open_length": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt.datediff"], "nodes": ["model.github_source.stg_github__issue", "model.github_source.stg_github__issue_closed_history"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_open_length"], "unique_id": "model.github.int_github__issue_open_length", "raw_code": "with issue as (\n select *\n from {{ var('issue') }}\n), \n\nissue_closed_history as (\n select *\n from {{ var('issue_closed_history') }}\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), {{ dbt.current_timestamp_backcompat() }}) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum({{ dbt.datediff('valid_starting', 'valid_until', 'second') }}) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_open_length.sql", "original_file_path": "models/intermediate/int_github__issue_open_length.sql", "name": "int_github__issue_open_length", "alias": "int_github__issue_open_length", "checksum": {"name": "sha256", "checksum": "58de864860664b785e8000ef983dcb006d60af6cbba301e72e9e4c45aa1d8d5a"}, "tags": [], "refs": [["stg_github__issue"], ["stg_github__issue_closed_history"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_open_length.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1667263067.5767329, "compiled_code": "with issue as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__repository_teams": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.github_source.stg_github__repository", "model.github_source.stg_github__repo_team", "model.github_source.stg_github__team"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github", "intermediate", "int_github__repository_teams"], "unique_id": "model.github.int_github__repository_teams", "raw_code": "{{ config(enabled=var('github__using_repo_team', True)) }}\n\nwith repository as (\n select *\n from {{ var('repository')}}\n),\n\nrepo_teams as (\n select *\n from {{ var('repo_team')}}\n),\n\nteams as (\n select *\n from {{ var('team')}}\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n {{ fivetran_utils.string_agg('team_name', \"', '\" ) }} as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__repository_teams.sql", "original_file_path": "models/intermediate/int_github__repository_teams.sql", "name": "int_github__repository_teams", "alias": "int_github__repository_teams", "checksum": {"name": "sha256", "checksum": "aa75375faa9f533b0c9c935f80ed6e9c7b90f20249089e7d64b7b47194f9044e"}, "tags": [], "refs": [["stg_github__repository"], ["stg_github__repo_team"], ["stg_github__team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__repository_teams.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "enabled": true}, "created_at": 1667263067.580707, "compiled_code": "\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github_source.stg_github__issue_comment": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_comment_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__issue_comment_tmp", "model.github_source.stg_github__issue_comment_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "stg_github__issue_comment"], "unique_id": "model.github_source.stg_github__issue_comment", "raw_code": "with issue_comment as (\n\n select *\n from {{ ref('stg_github__issue_comment_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_comment_tmp')),\n staging_columns=get_issue_comment_columns()\n )\n }}\n\n from issue_comment\n\n), fields as (\n\n select \n id as issue_comment_id,\n issue_id,\n user_id\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue_comment.sql", "original_file_path": "models/stg_github__issue_comment.sql", "name": "stg_github__issue_comment", "alias": "stg_github__issue_comment", "checksum": {"name": "sha256", "checksum": "2f96156ac9d0de0afe220888eb6912117a7d04b1680b8fb1f5890dfbbcdb2994"}, "tags": [], "refs": [["stg_github__issue_comment_tmp"], ["stg_github__issue_comment_tmp"]], "sources": [], "metrics": [], "description": "Table that contains comments made on issues", "columns": {"issue_comment_id": {"name": "issue_comment_id", "description": "System generated unique id for the issue comment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue_comment.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667263067.828927, "compiled_code": "with issue_comment as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_comment_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n body\n \n as \n \n body\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 issue_id\n \n as \n \n issue_id\n \n, \n \n \n updated_at\n \n as \n \n updated_at\n \n, \n \n \n user_id\n \n as \n \n user_id\n \n\n\n\n\n from issue_comment\n\n), fields as (\n\n select \n id as issue_comment_id,\n issue_id,\n user_id\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_comment`"}, "model.github_source.stg_github__requested_reviewer_history": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_requested_reviewer_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.github_source.stg_github__requested_reviewer_history_tmp", "model.github_source.stg_github__requested_reviewer_history_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "stg_github__requested_reviewer_history"], "unique_id": "model.github_source.stg_github__requested_reviewer_history", "raw_code": "with requested_reviewer_history as (\n\n select *\n from {{ ref('stg_github__requested_reviewer_history_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__requested_reviewer_history_tmp')),\n staging_columns=get_requested_reviewer_history_columns()\n )\n }}\n\n from requested_reviewer_history\n\n), fields as (\n\n select \n pull_request_id,\n cast(created_at as {{ dbt.type_timestamp() }}) as created_at,\n requested_id,\n removed\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__requested_reviewer_history.sql", "original_file_path": "models/stg_github__requested_reviewer_history.sql", "name": "stg_github__requested_reviewer_history", "alias": "stg_github__requested_reviewer_history", "checksum": {"name": "sha256", "checksum": "40abf6ac94bece080abe8e8a45ed43030166df171697acf3c59c5958ffe68eba"}, "tags": [], "refs": [["stg_github__requested_reviewer_history_tmp"], ["stg_github__requested_reviewer_history_tmp"]], "sources": [], "metrics": [], "description": "Table containing when a user requests another user to review a pull request", "columns": {"pull_request_id": {"name": "pull_request_id", "description": "Foreign key that references the pull request table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the review was submitted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "requested_id": {"name": "requested_id", "description": "Foreign key that references the user table, representing the user that was requested to review a PR.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "removed": {"name": "removed", "description": "Boolean variable indicating if the requester was removed from the PR (true) or added to the PR (false).", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__requested_reviewer_history.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667263067.835099, "compiled_code": "with requested_reviewer_history as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__requested_reviewer_history_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n actor_id\n \n as \n \n actor_id\n \n, \n \n \n created_at\n \n as \n \n created_at\n \n, \n \n \n pull_request_id\n \n as \n \n pull_request_id\n \n, \n \n \n removed\n \n as \n \n removed\n \n, \n \n \n requested_id\n \n as \n \n requested_id\n \n\n\n\n\n from requested_reviewer_history\n\n), fields as (\n\n select \n pull_request_id,\n cast(created_at as TIMESTAMP) as created_at,\n requested_id,\n removed\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__requested_reviewer_history`"}, "model.github_source.stg_github__issue_label": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_label_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__issue_label_tmp", "model.github_source.stg_github__issue_label_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "stg_github__issue_label"], "unique_id": "model.github_source.stg_github__issue_label", "raw_code": "with issue_label as (\n\n select *\n from {{ ref('stg_github__issue_label_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_label_tmp')),\n staging_columns=get_issue_label_columns()\n )\n }}\n\n from issue_label\n\n), fields as (\n\n select \n issue_id,\n label_id\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue_label.sql", "original_file_path": "models/stg_github__issue_label.sql", "name": "stg_github__issue_label", "alias": "stg_github__issue_label", "checksum": {"name": "sha256", "checksum": "bbc4b8e82ab26b7cb753ead2165a6d483171b6def78a34c8ab6b2c9d1dc1357c"}, "tags": [], "refs": [["stg_github__issue_label_tmp"], ["stg_github__issue_label_tmp"]], "sources": [], "metrics": [], "description": "The current labels attached to an issue", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "label_id": {"name": "label_id", "description": "Unique identifier of the used label", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue_label.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667263067.828303, "compiled_code": "with issue_label as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_label_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n label_id\n \n as \n \n label_id\n \n, \n \n \n issue_id\n \n as \n \n issue_id\n \n\n\n\n\n from issue_label\n\n), fields as (\n\n select \n issue_id,\n label_id\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_label`"}, "model.github_source.stg_github__issue_merged": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_merged_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.github_source.stg_github__issue_merged_tmp", "model.github_source.stg_github__issue_merged_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "stg_github__issue_merged"], "unique_id": "model.github_source.stg_github__issue_merged", "raw_code": "with issue_merged as (\n\n select *\n from {{ ref('stg_github__issue_merged_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_merged_tmp')),\n staging_columns=get_issue_merged_columns()\n )\n }}\n\n from issue_merged\n\n), fields as (\n\n select \n issue_id,\n cast(merged_at as {{ dbt.type_timestamp() }}) as merged_at\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue_merged.sql", "original_file_path": "models/stg_github__issue_merged.sql", "name": "stg_github__issue_merged", "alias": "stg_github__issue_merged", "checksum": {"name": "sha256", "checksum": "d0ffc63496f8a12ccde9c115909db85d5f2fbd7c2ca8a7761cd96abcf31f532c"}, "tags": [], "refs": [["stg_github__issue_merged_tmp"], ["stg_github__issue_merged_tmp"]], "sources": [], "metrics": [], "description": "Table that tracks when an issue (always a pull request) is merged", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table. This table will only reference issues that are pull requests", "meta": {}, "data_type": null, "quote": null, "tags": []}, "merged_at": {"name": "merged_at", "description": "Timestamp of when the code merge took place", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue_merged.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667263067.8293881, "compiled_code": "with issue_merged as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_merged_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n actor_id\n \n as \n \n actor_id\n \n, \n \n \n commit_sha\n \n as \n \n commit_sha\n \n, \n \n \n issue_id\n \n as \n \n issue_id\n \n, \n \n \n merged_at\n \n as \n \n merged_at\n \n\n\n\n\n from issue_merged\n\n), fields as (\n\n select \n issue_id,\n cast(merged_at as TIMESTAMP) as merged_at\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_merged`"}, "model.github_source.stg_github__issue_closed_history": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_closed_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.github_source.stg_github__issue_closed_history_tmp", "model.github_source.stg_github__issue_closed_history_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "stg_github__issue_closed_history"], "unique_id": "model.github_source.stg_github__issue_closed_history", "raw_code": "with issue_closed_history as (\n\n select *\n from {{ ref('stg_github__issue_closed_history_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_closed_history_tmp')),\n staging_columns=get_issue_closed_history_columns()\n )\n }}\n\n from issue_closed_history\n\n), fields as (\n\n select \n issue_id,\n cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at,\n closed as is_closed\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue_closed_history.sql", "original_file_path": "models/stg_github__issue_closed_history.sql", "name": "stg_github__issue_closed_history", "alias": "stg_github__issue_closed_history", "checksum": {"name": "sha256", "checksum": "8820baed7a5b47177c8e57576741ab5d3763026682f66c52429092e655e07408"}, "tags": [], "refs": [["stg_github__issue_closed_history_tmp"], ["stg_github__issue_closed_history_tmp"]], "sources": [], "metrics": [], "description": "Table to track when an issue is closed or re-opened", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the action took place", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_closed": {"name": "is_closed", "description": "Boolean variable for if the issue was closed (true) or re-opened (false)", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue_closed_history.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667263067.827839, "compiled_code": "with issue_closed_history as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_closed_history_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n actor_id\n \n as \n \n actor_id\n \n, \n \n \n closed\n \n as \n \n closed\n \n, \n \n \n commit_sha\n \n as \n \n commit_sha\n \n, \n \n \n issue_id\n \n as \n \n issue_id\n \n, \n \n \n updated_at\n \n as \n \n updated_at\n \n\n\n\n\n from issue_closed_history\n\n), fields as (\n\n select \n issue_id,\n cast(updated_at as TIMESTAMP) as updated_at,\n closed as is_closed\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_closed_history`"}, "model.github_source.stg_github__issue_assignee": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_assignee_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__issue_assignee_tmp", "model.github_source.stg_github__issue_assignee_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "stg_github__issue_assignee"], "unique_id": "model.github_source.stg_github__issue_assignee", "raw_code": "with issue_assignee as (\n\n select *\n from {{ ref('stg_github__issue_assignee_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_assignee_tmp')),\n staging_columns=get_issue_assignee_columns()\n )\n }}\n\n from issue_assignee\n\n), fields as (\n\n select \n issue_id,\n user_id\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue_assignee.sql", "original_file_path": "models/stg_github__issue_assignee.sql", "name": "stg_github__issue_assignee", "alias": "stg_github__issue_assignee", "checksum": {"name": "sha256", "checksum": "1ee1ae6a0a648f4fddde4964f184b889bfd09ca43f0560fb10faaa8544b2f90d"}, "tags": [], "refs": [["stg_github__issue_assignee_tmp"], ["stg_github__issue_assignee_tmp"]], "sources": [], "metrics": [], "description": "Table with the current user(s) assigned to an issue", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue_assignee.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667263067.8259358, "compiled_code": "with issue_assignee as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_assignee_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n issue_id\n \n as \n \n issue_id\n \n, \n \n \n user_id\n \n as \n \n user_id\n \n\n\n\n\n from issue_assignee\n\n), fields as (\n\n select \n issue_id,\n user_id\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_assignee`"}, "model.github_source.stg_github__repository": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_repository_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__repository_tmp", "model.github_source.stg_github__repository_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "stg_github__repository"], "unique_id": "model.github_source.stg_github__repository", "raw_code": "with repository as (\n\n select *\n from {{ ref('stg_github__repository_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__repository_tmp')),\n staging_columns=get_repository_columns()\n )\n }}\n\n from repository\n\n), fields as (\n\n select \n id as repository_id,\n full_name,\n private as is_private\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__repository.sql", "original_file_path": "models/stg_github__repository.sql", "name": "stg_github__repository", "alias": "stg_github__repository", "checksum": {"name": "sha256", "checksum": "52faadfa1a36e8b144c01bdba106b9b22c58154bbd60b69c069c409f1b2f4712"}, "tags": [], "refs": [["stg_github__repository_tmp"], ["stg_github__repository_tmp"]], "sources": [], "metrics": [], "description": "Table representing the file structure of a directory under git control", "columns": {"repository_id": {"name": "repository_id", "description": "System generated unique id for the repository.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "full_name": {"name": "full_name", "description": "The name of the git repository.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_private": {"name": "is_private", "description": "Boolean field indicating whether the repository is private (true) or public (false).", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__repository.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667263067.834193, "compiled_code": "with repository as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__repository_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\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 created_at\n \n as \n \n created_at\n \n, \n \n \n default_branch\n \n as \n \n default_branch\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n fork\n \n as \n \n fork\n \n, \n \n \n full_name\n \n as \n \n full_name\n \n, \n \n \n homepage\n \n as \n \n homepage\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n language\n \n as \n \n language\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n owner_id\n \n as \n \n owner_id\n \n, \n \n \n private\n \n as \n \n private\n \n\n\n\n\n from repository\n\n), fields as (\n\n select \n id as repository_id,\n full_name,\n private as is_private\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__repository`"}, "model.github_source.stg_github__user": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_user_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__user_tmp", "model.github_source.stg_github__user_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "stg_github__user"], "unique_id": "model.github_source.stg_github__user", "raw_code": "with github_user as (\n\n select *\n from {{ ref('stg_github__user_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__user_tmp')),\n staging_columns=get_user_columns()\n )\n }}\n \n \n from github_user\n\n), fields as (\n\n select\n id as user_id,\n login as login_name,\n name,\n company\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__user.sql", "original_file_path": "models/stg_github__user.sql", "name": "stg_github__user", "alias": "stg_github__user", "checksum": {"name": "sha256", "checksum": "3fade99df6af62e01efd3bdabe4245077eeb17d7c05a33eae885ab9cebfb33a6"}, "tags": [], "refs": [["stg_github__user_tmp"], ["stg_github__user_tmp"]], "sources": [], "metrics": [], "description": "Table representing contributors to a git project", "columns": {"user_id": {"name": "user_id", "description": "System generated unique id for the user.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "login_name": {"name": "login_name", "description": "The alias the user uses to login to github.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the user", "meta": {}, "data_type": null, "quote": null, "tags": []}, "company": {"name": "company", "description": "The company of the user.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__user.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667263067.8369422, "compiled_code": "with github_user as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n company\n \n as \n \n company\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n login\n \n as \n \n login\n \n, \n \n \n name\n \n as \n \n name\n \n\n\n\n \n \n from github_user\n\n), fields as (\n\n select\n id as user_id,\n login as login_name,\n name,\n company\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`"}, "model.github_source.stg_github__pull_request_review": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_pull_request_review_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.github_source.stg_github__pull_request_review_tmp", "model.github_source.stg_github__pull_request_review_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "stg_github__pull_request_review"], "unique_id": "model.github_source.stg_github__pull_request_review", "raw_code": "with pull_request_review as (\n\n select *\n from {{ ref('stg_github__pull_request_review_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__pull_request_review_tmp')),\n staging_columns=get_pull_request_review_columns()\n )\n }}\n\n from pull_request_review\n\n), fields as (\n\n select \n id as pull_request_review_id,\n pull_request_id,\n cast(submitted_at as {{ dbt.type_timestamp() }}) as submitted_at,\n state,\n user_id\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__pull_request_review.sql", "original_file_path": "models/stg_github__pull_request_review.sql", "name": "stg_github__pull_request_review", "alias": "stg_github__pull_request_review", "checksum": {"name": "sha256", "checksum": "3c5b56fcda26503106a11215aa4895199d140d378e4f81dc73fee0a95a39ef6b"}, "tags": [], "refs": [["stg_github__pull_request_review_tmp"], ["stg_github__pull_request_review_tmp"]], "sources": [], "metrics": [], "description": "Table containing reviews made to pull requests", "columns": {"pull_request_review_id": {"name": "pull_request_review_id", "description": "System generated unique id for the pull request review.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pull_request_id": {"name": "pull_request_id", "description": "Foreign key that references the pull request table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "submitted_at": {"name": "submitted_at", "description": "Timestamp of when the request for review was submitted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the review was an approval, request for change, comment, dismissal.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table, representing the user that reviewed the pull request.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__pull_request_review.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667263067.832313, "compiled_code": "with pull_request_review as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_review_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n body\n \n as \n \n body\n \n, \n \n \n commit_sha\n \n as \n \n commit_sha\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n pull_request_id\n \n as \n \n pull_request_id\n \n, \n \n \n state\n \n as \n \n state\n \n, \n \n \n submitted_at\n \n as \n \n submitted_at\n \n, \n \n \n user_id\n \n as \n \n user_id\n \n\n\n\n\n from pull_request_review\n\n), fields as (\n\n select \n id as pull_request_review_id,\n pull_request_id,\n cast(submitted_at as TIMESTAMP) as submitted_at,\n state,\n user_id\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_review`"}, "model.github_source.stg_github__repo_team": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_repo_team_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__repo_team_tmp", "model.github_source.stg_github__repo_team_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "stg_github__repo_team"], "unique_id": "model.github_source.stg_github__repo_team", "raw_code": "{{ config(enabled=var('github__using_repo_team', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_github__repo_team_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__repo_team_tmp')),\n staging_columns=get_repo_team_columns()\n )\n }}\n \n from base\n \n), final as (\n \n select \n repository_id,\n team_id\n from fields\n)\n\nselect * from final", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__repo_team.sql", "original_file_path": "models/stg_github__repo_team.sql", "name": "stg_github__repo_team", "alias": "stg_github__repo_team", "checksum": {"name": "sha256", "checksum": "bbf2296c63f5601191f285d1b9509717c9af73282ef8faae25df101d5c2058ec"}, "tags": [], "refs": [["stg_github__repo_team_tmp"], ["stg_github__repo_team_tmp"]], "sources": [], "metrics": [], "description": "Table representing the mapping relationships between repositories and teams", "columns": {"repository_id": {"name": "repository_id", "description": "Reference to the respective repository for the record.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "team_id": {"name": "team_id", "description": "Reference to the respective team for the record.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__repo_team.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "enabled": true}, "created_at": 1667263067.83357, "compiled_code": "\n\nwith base as (\n\n select * \n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__repo_team_tmp`\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n permission\n \n as \n \n permission\n \n, \n \n \n repository_id\n \n as \n \n repository_id\n \n, \n \n \n team_id\n \n as \n \n team_id\n \n\n\n\n \n from base\n \n), final as (\n \n select \n repository_id,\n team_id\n from fields\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__repo_team`"}, "model.github_source.stg_github__label": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_label_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__label_tmp", "model.github_source.stg_github__label_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "stg_github__label"], "unique_id": "model.github_source.stg_github__label", "raw_code": "with issue_label as (\n\n select *\n from {{ ref('stg_github__label_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__label_tmp')),\n staging_columns=get_label_columns()\n )\n }}\n\n from issue_label\n\n), fields as (\n\n select \n id as label_id,\n _fivetran_synced,\t\n color,\n description,\n is_default,\n name as label,\n url\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__label.sql", "original_file_path": "models/stg_github__label.sql", "name": "stg_github__label", "alias": "stg_github__label", "checksum": {"name": "sha256", "checksum": "65919f8309be5eb259a6143e007f38f4ac91c1692d10990206708faa17f086e1"}, "tags": [], "refs": [["stg_github__label_tmp"], ["stg_github__label_tmp"]], "sources": [], "metrics": [], "description": "Table that contains labels that are used across your Github account within individual repositories.", "columns": {"label_id": {"name": "label_id", "description": "Unique identifier of the Github label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of the record being synced by Fivetran", "meta": {}, "data_type": null, "quote": null, "tags": []}, "color": {"name": "color", "description": "The color of the label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "The description of the label indicating the purpose", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_default": {"name": "is_default", "description": "Boolean flagging if the label is default on creation", "meta": {}, "data_type": null, "quote": null, "tags": []}, "label": {"name": "label", "description": "Name of the label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url": {"name": "url", "description": "Url where the label was used", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__label.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667263067.827134, "compiled_code": "with issue_label as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__label_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\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 description\n \n as \n \n description\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n is_default\n \n as \n \n is_default\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n url\n \n as \n \n url\n \n\n\n\n\n from issue_label\n\n), fields as (\n\n select \n id as label_id,\n _fivetran_synced,\t\n color,\n description,\n is_default,\n name as label,\n url\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__label`"}, "model.github_source.stg_github__issue": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.github_source.stg_github__issue_tmp", "model.github_source.stg_github__issue_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "stg_github__issue"], "unique_id": "model.github_source.stg_github__issue", "raw_code": "with issue as (\n\n select *\n from {{ ref('stg_github__issue_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_tmp')),\n staging_columns=get_issue_columns()\n )\n }}\n\n from issue \n\n), fields as (\n\n select \n id as issue_id,\n body,\n cast(closed_at as {{ dbt.type_timestamp() }}) as closed_at,\n cast(created_at as {{ dbt.type_timestamp() }}) as created_at,\n locked as is_locked,\n milestone_id,\n number as issue_number,\n pull_request as is_pull_request,\n repository_id,\n state,\n title,\n cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at,\n user_id\n \n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue.sql", "original_file_path": "models/stg_github__issue.sql", "name": "stg_github__issue", "alias": "stg_github__issue", "checksum": {"name": "sha256", "checksum": "4fa11e7a1ff0785189f14a205478aba55bb62784e05066f421e1723ec12240d0"}, "tags": [], "refs": [["stg_github__issue_tmp"], ["stg_github__issue_tmp"]], "sources": [], "metrics": [], "description": "Table that contains 1 entry for every issue created. Pull Requests also create an entry in this table, and there is a boolean field to determine if an entry is a pull request.", "columns": {"issue_id": {"name": "issue_id", "description": "System generated unique id for the issue. This is not the number that appears in the URL.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "body": {"name": "body", "description": "The text of the main description of the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed_at": {"name": "closed_at", "description": "Timestamp of when the issue was closed, NULL for issues that are open.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_locked": {"name": "is_locked", "description": "Boolean indicating whether the issue is locked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the issue was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "milestone_id": {"name": "milestone_id", "description": "Foreign key that references the milestone table representing the current milestone the issue is in.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_number": {"name": "issue_number", "description": "The issue number within a repository. Is unique by repository, but not across repositories.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_pull_request": {"name": "is_pull_request", "description": "Boolean for is the issue is a pull request (true) ot regular issue (false)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_id": {"name": "repository_id", "description": "Foreign key that references the repository table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the issue is open or closed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "Title of the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the last update was made to the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table, representing the user that created the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667263067.83136, "compiled_code": "with issue as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n body\n \n as \n \n body\n \n, \n \n \n closed_at\n \n as \n \n closed_at\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 locked\n \n as \n \n locked\n \n, \n \n \n milestone_id\n \n as \n \n milestone_id\n \n, \n \n \n number\n \n as \n \n number\n \n, \n \n \n pull_request\n \n as \n \n pull_request\n \n, \n \n \n repository_id\n \n as \n \n repository_id\n \n, \n \n \n state\n \n as \n \n state\n \n, \n \n \n title\n \n as \n \n title\n \n, \n \n \n updated_at\n \n as \n \n updated_at\n \n, \n \n \n user_id\n \n as \n \n user_id\n \n\n\n\n\n from issue \n\n), fields as (\n\n select \n id as issue_id,\n body,\n cast(closed_at as TIMESTAMP) as closed_at,\n cast(created_at as TIMESTAMP) as created_at,\n locked as is_locked,\n milestone_id,\n number as issue_number,\n pull_request as is_pull_request,\n repository_id,\n state,\n title,\n cast(updated_at as TIMESTAMP) as updated_at,\n user_id\n \n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`"}, "model.github_source.stg_github__team": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_team_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__team_tmp", "model.github_source.stg_github__team_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "stg_github__team"], "unique_id": "model.github_source.stg_github__team", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_github__team_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__team_tmp')),\n staging_columns=get_team_columns()\n )\n }}\n \n from base\n \n), final as (\n \n select \n id as team_id,\n description,\n name,\n parent_id,\n privacy,\n slug\n from fields\n)\n\nselect * \nfrom final", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__team.sql", "original_file_path": "models/stg_github__team.sql", "name": "stg_github__team", "alias": "stg_github__team", "checksum": {"name": "sha256", "checksum": "219e47883ec9f076dc1c27b22f72534709edaedd60e8ad9dc1b13db05499f4a4"}, "tags": [], "refs": [["stg_github__team_tmp"], ["stg_github__team_tmp"]], "sources": [], "metrics": [], "description": "Table containing teams and team details", "columns": {"team_id": {"name": "team_id", "description": "System generated unique id for the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "User created description of the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "User created name of the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "Reference to the parent team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "privacy": {"name": "privacy", "description": "Type of privacy permissions associated with the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "slug": {"name": "slug", "description": "Url friendly version of the team name.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__team.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667263067.836115, "compiled_code": "with base as (\n\n select * \n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__team_tmp`\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n description\n \n as \n \n description\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 org_id\n \n as \n \n org_id\n \n, \n \n \n parent_id\n \n as \n \n parent_id\n \n, \n \n \n privacy\n \n as \n \n privacy\n \n, \n \n \n slug\n \n as \n \n slug\n \n\n\n\n \n from base\n \n), final as (\n \n select \n id as team_id,\n description,\n name,\n parent_id,\n privacy,\n slug\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__team`"}, "model.github_source.stg_github__pull_request": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_pull_request_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__pull_request_tmp", "model.github_source.stg_github__pull_request_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "stg_github__pull_request"], "unique_id": "model.github_source.stg_github__pull_request", "raw_code": "with pull_request as (\n\n select *\n from {{ ref('stg_github__pull_request_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__pull_request_tmp')),\n staging_columns=get_pull_request_columns()\n )\n }}\n\n from pull_request\n\n), fields as (\n\n select \n id as pull_request_id,\n issue_id,\n head_repo_id,\n head_user_id\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__pull_request.sql", "original_file_path": "models/stg_github__pull_request.sql", "name": "stg_github__pull_request", "alias": "stg_github__pull_request", "checksum": {"name": "sha256", "checksum": "c2b1a593030492afcf35407523b636105f42f1cf3fd14f6067e31ba76d70dfe8"}, "tags": [], "refs": [["stg_github__pull_request_tmp"], ["stg_github__pull_request_tmp"]], "sources": [], "metrics": [], "description": "A special type of issue that is created when a user wants to merge one branch of code into another", "columns": {"pull_request_id": {"name": "pull_request_id", "description": "System generated unique id for the pull request.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "head_repo_id": {"name": "head_repo_id", "description": "Foreign key that references the repository table, referencing the current branch.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "head_user_id": {"name": "head_user_id", "description": "Foreign key that references the user table, referencing who created the current branch.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__pull_request.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667263067.8330681, "compiled_code": "with pull_request as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n base_label\n \n as \n \n base_label\n \n, \n \n \n base_ref\n \n as \n \n base_ref\n \n, \n \n \n base_repo_id\n \n as \n \n base_repo_id\n \n, \n \n \n base_sha\n \n as \n \n base_sha\n \n, \n \n \n base_user_id\n \n as \n \n base_user_id\n \n, \n \n \n head_label\n \n as \n \n head_label\n \n, \n \n \n head_ref\n \n as \n \n head_ref\n \n, \n \n \n head_repo_id\n \n as \n \n head_repo_id\n \n, \n \n \n head_sha\n \n as \n \n head_sha\n \n, \n \n \n head_user_id\n \n as \n \n head_user_id\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n issue_id\n \n as \n \n issue_id\n \n, \n \n \n merge_commit_sha\n \n as \n \n merge_commit_sha\n \n\n\n\n\n from pull_request\n\n), fields as (\n\n select \n id as pull_request_id,\n issue_id,\n head_repo_id,\n head_user_id\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request`"}, "model.github_source.stg_github__repository_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.repository"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "tmp", "stg_github__repository_tmp"], "unique_id": "model.github_source.stg_github__repository_tmp", "raw_code": "select *\nfrom {{ var('repository') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__repository_tmp.sql", "original_file_path": "models/tmp/stg_github__repository_tmp.sql", "name": "stg_github__repository_tmp", "alias": "stg_github__repository_tmp", "checksum": {"name": "sha256", "checksum": "e090c8cb68dc96c49ee363d95e9bbaf417dd03e2ec675bfdc3d9cefdf889cfc8"}, "tags": [], "refs": [], "sources": [["github", "repository"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__repository_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667263067.7230778, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_repository_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__repository_tmp`"}, "model.github_source.stg_github__label_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.label"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "tmp", "stg_github__label_tmp"], "unique_id": "model.github_source.stg_github__label_tmp", "raw_code": "select *\nfrom {{ var('label') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__label_tmp.sql", "original_file_path": "models/tmp/stg_github__label_tmp.sql", "name": "stg_github__label_tmp", "alias": "stg_github__label_tmp", "checksum": {"name": "sha256", "checksum": "8e66aceee9e6c677e3b0b105b85de66edea0f4141bef42cd097fd9a236abcf2f"}, "tags": [], "refs": [], "sources": [["github", "label"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__label_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667263067.726113, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_label_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__label_tmp`"}, "model.github_source.stg_github__requested_reviewer_history_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.requested_reviewer_history"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "tmp", "stg_github__requested_reviewer_history_tmp"], "unique_id": "model.github_source.stg_github__requested_reviewer_history_tmp", "raw_code": "select *\nfrom {{ var('requested_reviewer_history') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__requested_reviewer_history_tmp.sql", "original_file_path": "models/tmp/stg_github__requested_reviewer_history_tmp.sql", "name": "stg_github__requested_reviewer_history_tmp", "alias": "stg_github__requested_reviewer_history_tmp", "checksum": {"name": "sha256", "checksum": "ed713a77bb2c7407b63c6cc1eb5da22d3267a585bd972dabeb7c86e568180aaf"}, "tags": [], "refs": [], "sources": [["github", "requested_reviewer_history"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__requested_reviewer_history_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667263067.7290618, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_requested_reviewer_history_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__requested_reviewer_history_tmp`"}, "model.github_source.stg_github__issue_comment_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.issue_comment"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_comment_tmp"], "unique_id": "model.github_source.stg_github__issue_comment_tmp", "raw_code": "select *\nfrom {{ var('issue_comment') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_comment_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_comment_tmp.sql", "name": "stg_github__issue_comment_tmp", "alias": "stg_github__issue_comment_tmp", "checksum": {"name": "sha256", "checksum": "0954877e30180964df220c97f9b398d775fc74106c25666bf9dd98c5449a72a1"}, "tags": [], "refs": [], "sources": [["github", "issue_comment"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_comment_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667263067.732517, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_issue_comment_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_comment_tmp`"}, "model.github_source.stg_github__pull_request_review_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.pull_request_review"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "tmp", "stg_github__pull_request_review_tmp"], "unique_id": "model.github_source.stg_github__pull_request_review_tmp", "raw_code": "select *\nfrom {{ var('pull_request_review') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__pull_request_review_tmp.sql", "original_file_path": "models/tmp/stg_github__pull_request_review_tmp.sql", "name": "stg_github__pull_request_review_tmp", "alias": "stg_github__pull_request_review_tmp", "checksum": {"name": "sha256", "checksum": "3419833d93b14d370eb3c9cfb7fda9a373c47a2f9701620425d882b95fbaa55c"}, "tags": [], "refs": [], "sources": [["github", "pull_request_review"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__pull_request_review_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667263067.735492, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_pull_request_review_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_review_tmp`"}, "model.github_source.stg_github__issue_label_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.issue_label"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_label_tmp"], "unique_id": "model.github_source.stg_github__issue_label_tmp", "raw_code": "select *\nfrom {{ var('issue_label') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_label_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_label_tmp.sql", "name": "stg_github__issue_label_tmp", "alias": "stg_github__issue_label_tmp", "checksum": {"name": "sha256", "checksum": "3cd52e662c2bc67a66c9c3e6250e38739362a0b688287d41329d2989297fa201"}, "tags": [], "refs": [], "sources": [["github", "issue_label"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_label_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667263067.7384589, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_issue_label_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_label_tmp`"}, "model.github_source.stg_github__team_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.team"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "tmp", "stg_github__team_tmp"], "unique_id": "model.github_source.stg_github__team_tmp", "raw_code": "select * \nfrom {{ var('team') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__team_tmp.sql", "original_file_path": "models/tmp/stg_github__team_tmp.sql", "name": "stg_github__team_tmp", "alias": "stg_github__team_tmp", "checksum": {"name": "sha256", "checksum": "8c107692c9394962da82e0c2460045e6686d962c1eefe0cff564c618aed7a17d"}, "tags": [], "refs": [], "sources": [["github", "team"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__team_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667263067.741408, "compiled_code": "select * \nfrom `dbt-package-testing`.`github_integration_tests`.`github_team_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__team_tmp`"}, "model.github_source.stg_github__pull_request_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.pull_request"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "tmp", "stg_github__pull_request_tmp"], "unique_id": "model.github_source.stg_github__pull_request_tmp", "raw_code": "select *\nfrom {{ var('pull_request') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__pull_request_tmp.sql", "original_file_path": "models/tmp/stg_github__pull_request_tmp.sql", "name": "stg_github__pull_request_tmp", "alias": "stg_github__pull_request_tmp", "checksum": {"name": "sha256", "checksum": "11df5e7fd7046db485c6654ea88c82c566b71140c4e233f3567bd63bbf1cca19"}, "tags": [], "refs": [], "sources": [["github", "pull_request"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__pull_request_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667263067.7443452, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_pull_request_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_tmp`"}, "model.github_source.stg_github__issue_merged_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.issue_merged"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_merged_tmp"], "unique_id": "model.github_source.stg_github__issue_merged_tmp", "raw_code": "select *\nfrom {{ var('issue_merged') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_merged_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_merged_tmp.sql", "name": "stg_github__issue_merged_tmp", "alias": "stg_github__issue_merged_tmp", "checksum": {"name": "sha256", "checksum": "e61fb5297937f494370067232958a443ec21c885a55cca0022f480b463ce90a9"}, "tags": [], "refs": [], "sources": [["github", "issue_merged"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_merged_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667263067.747297, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_issue_merged_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_merged_tmp`"}, "model.github_source.stg_github__user_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.user"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "tmp", "stg_github__user_tmp"], "unique_id": "model.github_source.stg_github__user_tmp", "raw_code": "select *\nfrom {{ var('user') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__user_tmp.sql", "original_file_path": "models/tmp/stg_github__user_tmp.sql", "name": "stg_github__user_tmp", "alias": "stg_github__user_tmp", "checksum": {"name": "sha256", "checksum": "e71885bca06f3e1feaef9e729cfb58827c8999bc4d4b7cda538c392c5f56ffdf"}, "tags": [], "refs": [], "sources": [["github", "user"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__user_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667263067.7509298, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_user_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__user_tmp`"}, "model.github_source.stg_github__issue_closed_history_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.issue_closed_history"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_closed_history_tmp"], "unique_id": "model.github_source.stg_github__issue_closed_history_tmp", "raw_code": "select *\nfrom {{ var('issue_closed_history') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_closed_history_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_closed_history_tmp.sql", "name": "stg_github__issue_closed_history_tmp", "alias": "stg_github__issue_closed_history_tmp", "checksum": {"name": "sha256", "checksum": "5ce3eed90261c385c0ddcb0dc9d914a0bf3d3e0f737e4e233af244d29bbf3ce4"}, "tags": [], "refs": [], "sources": [["github", "issue_closed_history"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_closed_history_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667263067.753899, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_issue_closed_history_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_closed_history_tmp`"}, "model.github_source.stg_github__issue_assignee_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.issue_assignee"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_assignee_tmp"], "unique_id": "model.github_source.stg_github__issue_assignee_tmp", "raw_code": "select *\nfrom {{ var('issue_assignee') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_assignee_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_assignee_tmp.sql", "name": "stg_github__issue_assignee_tmp", "alias": "stg_github__issue_assignee_tmp", "checksum": {"name": "sha256", "checksum": "4cab39e652c5972bfa16de13454df8e5745610e91b69f3840305e49a9d613753"}, "tags": [], "refs": [], "sources": [["github", "issue_assignee"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_assignee_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667263067.7568371, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_issue_assignee_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_assignee_tmp`"}, "model.github_source.stg_github__issue_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.issue"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_tmp"], "unique_id": "model.github_source.stg_github__issue_tmp", "raw_code": "select *\nfrom {{ var('issue') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_tmp.sql", "name": "stg_github__issue_tmp", "alias": "stg_github__issue_tmp", "checksum": {"name": "sha256", "checksum": "4100b13686c42d580a5eeaab15449896ec2ce740b0e5f002775eb9f222ef7c32"}, "tags": [], "refs": [], "sources": [["github", "issue"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667263067.759789, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_issue_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_tmp`"}, "model.github_source.stg_github__repo_team_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.repo_team"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "tmp", "stg_github__repo_team_tmp"], "unique_id": "model.github_source.stg_github__repo_team_tmp", "raw_code": "{{ config(enabled=var('github__using_repo_team', True)) }}\n\nselect * \nfrom {{ var('repo_team') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__repo_team_tmp.sql", "original_file_path": "models/tmp/stg_github__repo_team_tmp.sql", "name": "stg_github__repo_team_tmp", "alias": "stg_github__repo_team_tmp", "checksum": {"name": "sha256", "checksum": "25a704d9235d40dc05601995f184779690eabcc6e3a64d3a0489e00c3e6d13ab"}, "tags": [], "refs": [], "sources": [["github", "repo_team"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__repo_team_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "enabled": true}, "created_at": 1667263067.7627242, "compiled_code": "\n\nselect * \nfrom `dbt-package-testing`.`github_integration_tests`.`github_repo_team_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__repo_team_tmp`"}, "test.github.unique_github__issues_issue_id.6723b9b1db": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('github__issues')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__issues"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__issues_issue_id"], "unique_id": "test.github.unique_github__issues_issue_id.6723b9b1db", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__issues_issue_id.sql", "original_file_path": "models/github.yml", "name": "unique_github__issues_issue_id", "alias": "unique_github__issues_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__issues"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__issues_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.7913768, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select issue_id as unique_field\n from `dbt-package-testing`.`github_source_integration_tests`.`github__issues`\n where issue_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.github__issues"}, "test.github.not_null_github__issues_issue_id.fed0631e25": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('github__issues')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__issues"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__issues_issue_id"], "unique_id": "test.github.not_null_github__issues_issue_id.fed0631e25", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__issues_issue_id.sql", "original_file_path": "models/github.yml", "name": "not_null_github__issues_issue_id", "alias": "not_null_github__issues_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__issues"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__issues_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.792384, "compiled_code": "\n \n \n\n\n\nselect issue_id\nfrom `dbt-package-testing`.`github_source_integration_tests`.`github__issues`\nwhere issue_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.github__issues"}, "test.github.unique_github__pull_requests_issue_id.ce23997907": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('github__pull_requests')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__pull_requests"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__pull_requests_issue_id"], "unique_id": "test.github.unique_github__pull_requests_issue_id.ce23997907", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__pull_requests_issue_id.sql", "original_file_path": "models/github.yml", "name": "unique_github__pull_requests_issue_id", "alias": "unique_github__pull_requests_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__pull_requests"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__pull_requests_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.7933261, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select issue_id as unique_field\n from `dbt-package-testing`.`github_source_integration_tests`.`github__pull_requests`\n where issue_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.github__pull_requests"}, "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('github__pull_requests')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__pull_requests"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__pull_requests_issue_id"], "unique_id": "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__pull_requests_issue_id.sql", "original_file_path": "models/github.yml", "name": "not_null_github__pull_requests_issue_id", "alias": "not_null_github__pull_requests_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__pull_requests"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__pull_requests_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.79424, "compiled_code": "\n \n \n\n\n\nselect issue_id\nfrom `dbt-package-testing`.`github_source_integration_tests`.`github__pull_requests`\nwhere issue_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.github__pull_requests"}, "test.github.unique_github__daily_metrics_day.f98cab9456": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "day", "model": "{{ get_where_subquery(ref('github__daily_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__daily_metrics_day"], "unique_id": "test.github.unique_github__daily_metrics_day.f98cab9456", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__daily_metrics_day.sql", "original_file_path": "models/github.yml", "name": "unique_github__daily_metrics_day", "alias": "unique_github__daily_metrics_day", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__daily_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__daily_metrics_day.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.7952871, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select day as unique_field\n from `dbt-package-testing`.`github_source_integration_tests`.`github__daily_metrics`\n where day is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "day", "file_key_name": "models.github__daily_metrics"}, "test.github.not_null_github__daily_metrics_day.647e494434": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "day", "model": "{{ get_where_subquery(ref('github__daily_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__daily_metrics_day"], "unique_id": "test.github.not_null_github__daily_metrics_day.647e494434", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__daily_metrics_day.sql", "original_file_path": "models/github.yml", "name": "not_null_github__daily_metrics_day", "alias": "not_null_github__daily_metrics_day", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__daily_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__daily_metrics_day.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.796187, "compiled_code": "\n \n \n\n\n\nselect day\nfrom `dbt-package-testing`.`github_source_integration_tests`.`github__daily_metrics`\nwhere day is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "day", "file_key_name": "models.github__daily_metrics"}, "test.github.unique_github__weekly_metrics_week.6794858a8e": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "week", "model": "{{ get_where_subquery(ref('github__weekly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__weekly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__weekly_metrics_week"], "unique_id": "test.github.unique_github__weekly_metrics_week.6794858a8e", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__weekly_metrics_week.sql", "original_file_path": "models/github.yml", "name": "unique_github__weekly_metrics_week", "alias": "unique_github__weekly_metrics_week", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__weekly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__weekly_metrics_week.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.797098, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select week as unique_field\n from `dbt-package-testing`.`github_source_integration_tests`.`github__weekly_metrics`\n where week is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "week", "file_key_name": "models.github__weekly_metrics"}, "test.github.not_null_github__weekly_metrics_week.4b0b928243": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "week", "model": "{{ get_where_subquery(ref('github__weekly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__weekly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__weekly_metrics_week"], "unique_id": "test.github.not_null_github__weekly_metrics_week.4b0b928243", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__weekly_metrics_week.sql", "original_file_path": "models/github.yml", "name": "not_null_github__weekly_metrics_week", "alias": "not_null_github__weekly_metrics_week", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__weekly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__weekly_metrics_week.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.7980108, "compiled_code": "\n \n \n\n\n\nselect week\nfrom `dbt-package-testing`.`github_source_integration_tests`.`github__weekly_metrics`\nwhere week is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "week", "file_key_name": "models.github__weekly_metrics"}, "test.github.unique_github__monthly_metrics_month.3076284fbb": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "month", "model": "{{ get_where_subquery(ref('github__monthly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__monthly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__monthly_metrics_month"], "unique_id": "test.github.unique_github__monthly_metrics_month.3076284fbb", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__monthly_metrics_month.sql", "original_file_path": "models/github.yml", "name": "unique_github__monthly_metrics_month", "alias": "unique_github__monthly_metrics_month", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__monthly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__monthly_metrics_month.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.799058, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select month as unique_field\n from `dbt-package-testing`.`github_source_integration_tests`.`github__monthly_metrics`\n where month is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "month", "file_key_name": "models.github__monthly_metrics"}, "test.github.not_null_github__monthly_metrics_month.9e4fba84df": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "month", "model": "{{ get_where_subquery(ref('github__monthly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__monthly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__monthly_metrics_month"], "unique_id": "test.github.not_null_github__monthly_metrics_month.9e4fba84df", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__monthly_metrics_month.sql", "original_file_path": "models/github.yml", "name": "not_null_github__monthly_metrics_month", "alias": "not_null_github__monthly_metrics_month", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__monthly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__monthly_metrics_month.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.799993, "compiled_code": "\n \n \n\n\n\nselect month\nfrom `dbt-package-testing`.`github_source_integration_tests`.`github__monthly_metrics`\nwhere month is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "month", "file_key_name": "models.github__monthly_metrics"}, "test.github.unique_github__quarterly_metrics_quarter.9165a921c1": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "quarter", "model": "{{ get_where_subquery(ref('github__quarterly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__quarterly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__quarterly_metrics_quarter"], "unique_id": "test.github.unique_github__quarterly_metrics_quarter.9165a921c1", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__quarterly_metrics_quarter.sql", "original_file_path": "models/github.yml", "name": "unique_github__quarterly_metrics_quarter", "alias": "unique_github__quarterly_metrics_quarter", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__quarterly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__quarterly_metrics_quarter.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.800896, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select quarter as unique_field\n from `dbt-package-testing`.`github_source_integration_tests`.`github__quarterly_metrics`\n where quarter is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "quarter", "file_key_name": "models.github__quarterly_metrics"}, "test.github.not_null_github__quarterly_metrics_quarter.92394d46dc": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "quarter", "model": "{{ get_where_subquery(ref('github__quarterly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__quarterly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__quarterly_metrics_quarter"], "unique_id": "test.github.not_null_github__quarterly_metrics_quarter.92394d46dc", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__quarterly_metrics_quarter.sql", "original_file_path": "models/github.yml", "name": "not_null_github__quarterly_metrics_quarter", "alias": "not_null_github__quarterly_metrics_quarter", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__quarterly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__quarterly_metrics_quarter.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.801795, "compiled_code": "\n \n \n\n\n\nselect quarter\nfrom `dbt-package-testing`.`github_source_integration_tests`.`github__quarterly_metrics`\nwhere quarter is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "quarter", "file_key_name": "models.github__quarterly_metrics"}, "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["issue_id", "user_id"], "model": "{{ get_where_subquery(ref('stg_github__issue_assignee')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue_assignee"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github_source", "dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id"], "unique_id": "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388\") }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388.sql", "original_file_path": "models/stg_github.yml", "name": "dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id", "alias": "dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue_assignee"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388"}, "created_at": 1667263067.8373692, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n issue_id, user_id\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_assignee`\n group by issue_id, user_id\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_github__issue_assignee"}, "test.github_source.not_null_stg_github__label_label_id.9f07379974": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "label_id", "model": "{{ get_where_subquery(ref('stg_github__label')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__label"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__label_label_id"], "unique_id": "test.github_source.not_null_stg_github__label_label_id.9f07379974", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__label_label_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__label_label_id", "alias": "not_null_stg_github__label_label_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__label"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__label_label_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.8440058, "compiled_code": "\n \n \n\n\n\nselect label_id\nfrom `dbt-package-testing`.`github_source_integration_tests`.`stg_github__label`\nwhere label_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "label_id", "file_key_name": "models.stg_github__label"}, "test.github_source.unique_stg_github__label_label_id.74d3c21466": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "label_id", "model": "{{ get_where_subquery(ref('stg_github__label')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__label"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__label_label_id"], "unique_id": "test.github_source.unique_stg_github__label_label_id.74d3c21466", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__label_label_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__label_label_id", "alias": "unique_stg_github__label_label_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__label"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__label_label_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.844934, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select label_id as unique_field\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__label`\n where label_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "label_id", "file_key_name": "models.stg_github__label"}, "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["issue_id", "updated_at"], "model": "{{ get_where_subquery(ref('stg_github__issue_closed_history')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue_closed_history"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github_source", "dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at"], "unique_id": "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f\") }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f.sql", "original_file_path": "models/stg_github.yml", "name": "dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at", "alias": "dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue_closed_history"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f"}, "created_at": 1667263067.845997, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n issue_id, updated_at\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_closed_history`\n group by issue_id, updated_at\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_github__issue_closed_history"}, "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "issue_comment_id", "model": "{{ get_where_subquery(ref('stg_github__issue_comment')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue_comment"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__issue_comment_issue_comment_id"], "unique_id": "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__issue_comment_issue_comment_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__issue_comment_issue_comment_id", "alias": "unique_stg_github__issue_comment_issue_comment_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue_comment"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__issue_comment_issue_comment_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.8484669, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select issue_comment_id as unique_field\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_comment`\n where issue_comment_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_comment_id", "file_key_name": "models.stg_github__issue_comment"}, "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "issue_comment_id", "model": "{{ get_where_subquery(ref('stg_github__issue_comment')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue_comment"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__issue_comment_issue_comment_id"], "unique_id": "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__issue_comment_issue_comment_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__issue_comment_issue_comment_id", "alias": "not_null_stg_github__issue_comment_issue_comment_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue_comment"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__issue_comment_issue_comment_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.849505, "compiled_code": "\n \n \n\n\n\nselect issue_comment_id\nfrom `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_comment`\nwhere issue_comment_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_comment_id", "file_key_name": "models.stg_github__issue_comment"}, "test.github_source.unique_stg_github__issue_issue_id.84891aeece": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('stg_github__issue')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__issue_issue_id"], "unique_id": "test.github_source.unique_stg_github__issue_issue_id.84891aeece", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__issue_issue_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__issue_issue_id", "alias": "unique_stg_github__issue_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__issue_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.850421, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select issue_id as unique_field\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\n where issue_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.stg_github__issue"}, "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('stg_github__issue')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__issue_issue_id"], "unique_id": "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__issue_issue_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__issue_issue_id", "alias": "not_null_stg_github__issue_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__issue_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.851326, "compiled_code": "\n \n \n\n\n\nselect issue_id\nfrom `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\nwhere issue_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.stg_github__issue"}, "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "pull_request_review_id", "model": "{{ get_where_subquery(ref('stg_github__pull_request_review')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__pull_request_review"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__pull_request_review_pull_request_review_id"], "unique_id": "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__pull_request_review_pull_request_review_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__pull_request_review_pull_request_review_id", "alias": "unique_stg_github__pull_request_review_pull_request_review_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__pull_request_review"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__pull_request_review_pull_request_review_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.852256, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select pull_request_review_id as unique_field\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_review`\n where pull_request_review_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "pull_request_review_id", "file_key_name": "models.stg_github__pull_request_review"}, "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "pull_request_review_id", "model": "{{ get_where_subquery(ref('stg_github__pull_request_review')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__pull_request_review"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__pull_request_review_pull_request_review_id"], "unique_id": "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__pull_request_review_pull_request_review_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__pull_request_review_pull_request_review_id", "alias": "not_null_stg_github__pull_request_review_pull_request_review_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__pull_request_review"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__pull_request_review_pull_request_review_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.853288, "compiled_code": "\n \n \n\n\n\nselect pull_request_review_id\nfrom `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_review`\nwhere pull_request_review_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "pull_request_review_id", "file_key_name": "models.stg_github__pull_request_review"}, "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "pull_request_id", "model": "{{ get_where_subquery(ref('stg_github__pull_request')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__pull_request"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__pull_request_pull_request_id"], "unique_id": "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__pull_request_pull_request_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__pull_request_pull_request_id", "alias": "unique_stg_github__pull_request_pull_request_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__pull_request"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__pull_request_pull_request_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.854191, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select pull_request_id as unique_field\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request`\n where pull_request_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "pull_request_id", "file_key_name": "models.stg_github__pull_request"}, "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "pull_request_id", "model": "{{ get_where_subquery(ref('stg_github__pull_request')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__pull_request"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__pull_request_pull_request_id"], "unique_id": "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__pull_request_pull_request_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__pull_request_pull_request_id", "alias": "not_null_stg_github__pull_request_pull_request_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__pull_request"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__pull_request_pull_request_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.855096, "compiled_code": "\n \n \n\n\n\nselect pull_request_id\nfrom `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request`\nwhere pull_request_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "pull_request_id", "file_key_name": "models.stg_github__pull_request"}, "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "repository_id", "model": "{{ get_where_subquery(ref('stg_github__repo_team')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__repo_team"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__repo_team_repository_id"], "unique_id": "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__repo_team_repository_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__repo_team_repository_id", "alias": "not_null_stg_github__repo_team_repository_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__repo_team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__repo_team_repository_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.855996, "compiled_code": "\n \n \n\n\n\nselect repository_id\nfrom `dbt-package-testing`.`github_source_integration_tests`.`stg_github__repo_team`\nwhere repository_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "repository_id", "file_key_name": "models.stg_github__repo_team"}, "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "team_id", "model": "{{ get_where_subquery(ref('stg_github__repo_team')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__repo_team"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__repo_team_team_id"], "unique_id": "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__repo_team_team_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__repo_team_team_id", "alias": "not_null_stg_github__repo_team_team_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__repo_team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__repo_team_team_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.8570151, "compiled_code": "\n \n \n\n\n\nselect team_id\nfrom `dbt-package-testing`.`github_source_integration_tests`.`stg_github__repo_team`\nwhere team_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "team_id", "file_key_name": "models.stg_github__repo_team"}, "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "repository_id", "model": "{{ get_where_subquery(ref('stg_github__repository')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__repository"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__repository_repository_id"], "unique_id": "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__repository_repository_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__repository_repository_id", "alias": "unique_stg_github__repository_repository_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__repository"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__repository_repository_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.85791, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select repository_id as unique_field\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__repository`\n where repository_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "repository_id", "file_key_name": "models.stg_github__repository"}, "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "repository_id", "model": "{{ get_where_subquery(ref('stg_github__repository')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__repository"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__repository_repository_id"], "unique_id": "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__repository_repository_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__repository_repository_id", "alias": "not_null_stg_github__repository_repository_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__repository"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__repository_repository_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.858805, "compiled_code": "\n \n \n\n\n\nselect repository_id\nfrom `dbt-package-testing`.`github_source_integration_tests`.`stg_github__repository`\nwhere repository_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "repository_id", "file_key_name": "models.stg_github__repository"}, "test.github_source.unique_stg_github__team_team_id.94e9716ab4": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "team_id", "model": "{{ get_where_subquery(ref('stg_github__team')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__team"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__team_team_id"], "unique_id": "test.github_source.unique_stg_github__team_team_id.94e9716ab4", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__team_team_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__team_team_id", "alias": "unique_stg_github__team_team_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__team_team_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.8596978, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select team_id as unique_field\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__team`\n where team_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "team_id", "file_key_name": "models.stg_github__team"}, "test.github_source.not_null_stg_github__team_team_id.440aefe7a7": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "team_id", "model": "{{ get_where_subquery(ref('stg_github__team')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__team"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__team_team_id"], "unique_id": "test.github_source.not_null_stg_github__team_team_id.440aefe7a7", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__team_team_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__team_team_id", "alias": "not_null_stg_github__team_team_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__team_team_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.860714, "compiled_code": "\n \n \n\n\n\nselect team_id\nfrom `dbt-package-testing`.`github_source_integration_tests`.`stg_github__team`\nwhere team_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "team_id", "file_key_name": "models.stg_github__team"}, "test.github_source.unique_stg_github__user_user_id.5c1a00cd90": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(ref('stg_github__user')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__user"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__user_user_id"], "unique_id": "test.github_source.unique_stg_github__user_user_id.5c1a00cd90", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__user_user_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__user_user_id", "alias": "unique_stg_github__user_user_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__user"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__user_user_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.861614, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select user_id as unique_field\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\n where user_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "user_id", "file_key_name": "models.stg_github__user"}, "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(ref('stg_github__user')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__user"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__user_user_id"], "unique_id": "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__user_user_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__user_user_id", "alias": "not_null_stg_github__user_user_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__user"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__user_user_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.862509, "compiled_code": "\n \n \n\n\n\nselect user_id\nfrom `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "user_id", "file_key_name": "models.stg_github__user"}}, "sources": {"source.github_source.github.issue_assignee": {"fqn": ["github_source", "github", "issue_assignee"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue_assignee", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue_assignee", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_issue_assignee_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table with the current user(s) assigned to an issue", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_assignee_data`", "created_at": 1667263067.86323}, "source.github_source.github.label": {"fqn": ["github_source", "github", "label"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.label", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "label", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_label_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Table that contains labels that are used across your Github account within individual repositories.", "columns": {"id": {"name": "id", "description": "Unique identifier of the Github label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of the record being synced by Fivetran", "meta": {}, "data_type": null, "quote": null, "tags": []}, "color": {"name": "color", "description": "The color of the label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "The description of the label indicating the purpose", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_default": {"name": "is_default", "description": "Boolean flagging if the label is default on creation", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "Name of the label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url": {"name": "url", "description": "Url where the label was used", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_label_data`", "created_at": 1667263067.863311}, "source.github_source.github.issue_closed_history": {"fqn": ["github_source", "github", "issue_closed_history"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue_closed_history", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue_closed_history", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_issue_closed_history_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table to track when an issue is closed or re-opened", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the action took place", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed": {"name": "closed", "description": "Boolean variable for if the issue was closed (true) or re-opened (false)", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_closed_history_data`", "created_at": 1667263067.863376}, "source.github_source.github.issue_label": {"fqn": ["github_source", "github", "issue_label"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue_label", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue_label", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_issue_label_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "The current labels attached to an issue", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "label_id": {"name": "label_id", "description": "Unique identifier of the used label", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_label_data`", "created_at": 1667263067.863435}, "source.github_source.github.issue_comment": {"fqn": ["github_source", "github", "issue_comment"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue_comment", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue_comment", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_issue_comment_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table that contains comments made on issues", "columns": {"id": {"name": "id", "description": "System generated unique id for the issue comment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_comment_data`", "created_at": 1667263067.8634949}, "source.github_source.github.issue_merged": {"fqn": ["github_source", "github", "issue_merged"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue_merged", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue_merged", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_issue_merged_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table that tracks when an issue (always a pull request) is merged", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table. This table will only reference issues that are pull requests", "meta": {}, "data_type": null, "quote": null, "tags": []}, "merged_at": {"name": "merged_at", "description": "Timestamp of when the code merge took place", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_merged_data`", "created_at": 1667263067.863553}, "source.github_source.github.issue": {"fqn": ["github_source", "github", "issue"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_issue_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table that contains 1 entry for every issue created. Pull Requests also create an entry in this table, and there is a boolean field to determine if an entry is a pull request.", "columns": {"id": {"name": "id", "description": "System generated unique id for the issue. This is not the number that appears in the URL.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "body": {"name": "body", "description": "The text of the main description of the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "locked": {"name": "locked", "description": "Boolean indicating whether the issue is locked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed_at": {"name": "closed_at", "description": "Timestamp of when the issue was closed, NULL for issues that are open.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the issue was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "milestone_id": {"name": "milestone_id", "description": "Foreign key that references the milestone table representing the current milestone the issue is in.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number": {"name": "number", "description": "The issue number within a repository. Is unique by repository, but not across repositories.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pull_request": {"name": "pull_request", "description": "Boolean for is the issue is a pull request (true) ot regular issue (false)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_id": {"name": "repository_id", "description": "Foreign key that references the repository table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the issue is open or closed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "Title of the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the last update was made to the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table, representing the user that created the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_data`", "created_at": 1667263067.863622}, "source.github_source.github.pull_request_review": {"fqn": ["github_source", "github", "pull_request_review"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.pull_request_review", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "pull_request_review", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_pull_request_review_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table containing reviews made to pull requests", "columns": {"id": {"name": "id", "description": "System generated unique id for the pull request review.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pull_request_id": {"name": "pull_request_id", "description": "Foreign key that references the pull request table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "submitted_at": {"name": "submitted_at", "description": "Timestamp of when the request for review was submitted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the review was an approval, request for change, comment, dismissal.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table, representing the user that reviewed the pull request.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_pull_request_review_data`", "created_at": 1667263067.863682}, "source.github_source.github.pull_request": {"fqn": ["github_source", "github", "pull_request"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.pull_request", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "pull_request", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_pull_request_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "A special type of issue that is created when a user wants to merge one branch of code into another", "columns": {"id": {"name": "id", "description": "System generated unique id for the pull request.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "head_repo_id": {"name": "head_repo_id", "description": "Foreign key that references the repository table, referencing the current branch.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "head_user_id": {"name": "head_user_id", "description": "Foreign key that references the user table, referencing who created the current branch.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_pull_request_data`", "created_at": 1667263067.86374}, "source.github_source.github.repo_team": {"fqn": ["github_source", "github", "repo_team"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.repo_team", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "repo_team", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_repo_team_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table representing the mapping relationships between repositories and teams", "columns": {"repository_id": {"name": "repository_id", "description": "Reference to the respective repository for the record.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "team_id": {"name": "team_id", "description": "Reference to the respective team for the record.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {"is_enabled": true}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_repo_team_data`", "created_at": 1667263067.863798}, "source.github_source.github.repository": {"fqn": ["github_source", "github", "repository"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.repository", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "repository", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_repository_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Table representing the file structure of a directory under git control", "columns": {"id": {"name": "id", "description": "System generated unique id for the repository.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the repository was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "full_name": {"name": "full_name", "description": "The name of the git repository.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "private": {"name": "private", "description": "Boolean field indicating whether the repository is private (true) or public (false).", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_repository_data`", "created_at": 1667263067.863856}, "source.github_source.github.requested_reviewer_history": {"fqn": ["github_source", "github", "requested_reviewer_history"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.requested_reviewer_history", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "requested_reviewer_history", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_requested_reviewer_history_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table containing when a user requests another user to review a pull request", "columns": {"pull_request_id": {"name": "pull_request_id", "description": "Foreign key that references the pull request table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the review was submitted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "requested_id": {"name": "requested_id", "description": "Foreign key that references the user table, representing the user that was requested to review a PR.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "removed": {"name": "removed", "description": "Boolean variable indicating if the requester was removed from the PR (true) or added to the PR (false).", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_requested_reviewer_history_data`", "created_at": 1667263067.863915}, "source.github_source.github.team": {"fqn": ["github_source", "github", "team"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.team", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "team", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_team_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table containing teams and team details", "columns": {"id": {"name": "id", "description": "System generated unique id for the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "User created description of the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "User created name of the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "Reference to the parent team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "privacy": {"name": "privacy", "description": "Type of privacy permissions associated with the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "slug": {"name": "slug", "description": "Url friendly version of the team name.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_team_data`", "created_at": 1667263067.863977}, "source.github_source.github.user": {"fqn": ["github_source", "github", "user"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.user", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "user", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_user_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Table representing contributors to a git project", "columns": {"id": {"name": "id", "description": "System generated unique id for the user.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "login": {"name": "login", "description": "The alias the user uses to login to github.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the user", "meta": {}, "data_type": null, "quote": null, "tags": []}, "company": {"name": "company", "description": "The company of the user.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_user_data`", "created_at": 1667263067.864033}}, "macros": {"macro.dbt_bigquery.date_sharded_table": {"unique_id": "macro.dbt_bigquery.date_sharded_table", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "date_sharded_table", "macro_sql": "{% macro date_sharded_table(base_name) %}\n {{ return(base_name ~ \"[DBT__PARTITION_DATE]\") }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.976444, "supported_languages": null}, "macro.dbt_bigquery.grant_access_to": {"unique_id": "macro.dbt_bigquery.grant_access_to", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "grant_access_to", "macro_sql": "{% macro grant_access_to(entity, entity_type, role, grant_target_dict) -%}\n {% do adapter.grant_access_to(entity, entity_type, role, grant_target_dict) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.976681, "supported_languages": null}, "macro.dbt_bigquery.get_partitions_metadata": {"unique_id": "macro.dbt_bigquery.get_partitions_metadata", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "get_partitions_metadata", "macro_sql": "\n\n{%- macro get_partitions_metadata(table) -%}\n {%- if execute -%}\n {%- set res = adapter.get_partitions_metadata(table) -%}\n {{- return(res) -}}\n {%- endif -%}\n {{- return(None) -}}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.9769778, "supported_languages": null}, "macro.dbt_bigquery.bigquery__get_catalog": {"unique_id": "macro.dbt_bigquery.bigquery__get_catalog", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "name": "bigquery__get_catalog", "macro_sql": "{% macro bigquery__get_catalog(information_schema, schemas) -%}\n\n {%- if (schemas | length) == 0 -%}\n {# Hopefully nothing cares about the columns we return when there are no rows #}\n {%- set query = \"select 1 as id limit 0\" -%}\n {%- else -%}\n\n {%- set query -%}\n with tables as (\n select\n project_id as table_database,\n dataset_id as table_schema,\n table_id as original_table_name,\n\n concat(project_id, '.', dataset_id, '.', table_id) as relation_id,\n\n row_count,\n size_bytes as size_bytes,\n case\n when type = 1 then 'table'\n when type = 2 then 'view'\n else 'external'\n end as table_type,\n\n REGEXP_CONTAINS(table_id, '^.+[0-9]{8}$') and coalesce(type, 0) = 1 as is_date_shard,\n REGEXP_EXTRACT(table_id, '^(.+)[0-9]{8}$') as shard_base_name,\n REGEXP_EXTRACT(table_id, '^.+([0-9]{8})$') as shard_name\n\n from {{ information_schema.replace(information_schema_view='__TABLES__') }}\n where (\n {%- for schema in schemas -%}\n upper(dataset_id) = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n ),\n\n extracted as (\n\n select *,\n case\n when is_date_shard then shard_base_name\n else original_table_name\n end as table_name\n\n from tables\n\n ),\n\n unsharded_tables as (\n\n select\n table_database,\n table_schema,\n table_name,\n coalesce(table_type, 'external') as table_type,\n is_date_shard,\n\n struct(\n min(shard_name) as shard_min,\n max(shard_name) as shard_max,\n count(*) as shard_count\n ) as table_shards,\n\n sum(size_bytes) as size_bytes,\n sum(row_count) as row_count,\n\n max(relation_id) as relation_id\n\n from extracted\n group by 1,2,3,4,5\n\n ),\n\n info_schema_columns as (\n\n select\n concat(table_catalog, '.', table_schema, '.', table_name) as relation_id,\n table_catalog as table_database,\n table_schema,\n table_name,\n\n -- use the \"real\" column name from the paths query below\n column_name as base_column_name,\n ordinal_position as column_index,\n\n is_partitioning_column,\n clustering_ordinal_position\n\n from {{ information_schema.replace(information_schema_view='COLUMNS') }}\n where ordinal_position is not null\n\n ),\n\n info_schema_column_paths as (\n\n select\n concat(table_catalog, '.', table_schema, '.', table_name) as relation_id,\n field_path as column_name,\n data_type as column_type,\n column_name as base_column_name,\n description as column_comment\n\n from {{ information_schema.replace(information_schema_view='COLUMN_FIELD_PATHS') }}\n\n ),\n\n columns as (\n\n select * except (base_column_name)\n from info_schema_columns\n join info_schema_column_paths using (relation_id, base_column_name)\n\n ),\n\n column_stats as (\n\n select\n table_database,\n table_schema,\n table_name,\n max(relation_id) as relation_id,\n max(case when is_partitioning_column = 'YES' then 1 else 0 end) = 1 as is_partitioned,\n max(case when is_partitioning_column = 'YES' then column_name else null end) as partition_column,\n max(case when clustering_ordinal_position is not null then 1 else 0 end) = 1 as is_clustered,\n array_to_string(\n array_agg(\n case\n when clustering_ordinal_position is not null then column_name\n else null\n end ignore nulls\n order by clustering_ordinal_position\n ), ', '\n ) as clustering_columns\n\n from columns\n group by 1,2,3\n\n )\n\n select\n unsharded_tables.table_database,\n unsharded_tables.table_schema,\n case\n when is_date_shard then concat(unsharded_tables.table_name, '*')\n else unsharded_tables.table_name\n end as table_name,\n unsharded_tables.table_type,\n\n -- coalesce name and type for External tables - these columns are not\n -- present in the COLUMN_FIELD_PATHS resultset\n coalesce(columns.column_name, '') as column_name,\n -- invent a row number to account for nested fields -- BQ does\n -- not treat these nested properties as independent fields\n row_number() over (\n partition by relation_id\n order by columns.column_index, columns.column_name\n ) as column_index,\n coalesce(columns.column_type, '') as column_type,\n columns.column_comment,\n\n 'Shard count' as `stats__date_shards__label`,\n table_shards.shard_count as `stats__date_shards__value`,\n 'The number of date shards in this table' as `stats__date_shards__description`,\n is_date_shard as `stats__date_shards__include`,\n\n 'Shard (min)' as `stats__date_shard_min__label`,\n table_shards.shard_min as `stats__date_shard_min__value`,\n 'The first date shard in this table' as `stats__date_shard_min__description`,\n is_date_shard as `stats__date_shard_min__include`,\n\n 'Shard (max)' as `stats__date_shard_max__label`,\n table_shards.shard_max as `stats__date_shard_max__value`,\n 'The last date shard in this table' as `stats__date_shard_max__description`,\n is_date_shard as `stats__date_shard_max__include`,\n\n '# Rows' as `stats__num_rows__label`,\n row_count as `stats__num_rows__value`,\n 'Approximate count of rows in this table' as `stats__num_rows__description`,\n (unsharded_tables.table_type = 'table') as `stats__num_rows__include`,\n\n 'Approximate Size' as `stats__num_bytes__label`,\n size_bytes as `stats__num_bytes__value`,\n 'Approximate size of table as reported by BigQuery' as `stats__num_bytes__description`,\n (unsharded_tables.table_type = 'table') as `stats__num_bytes__include`,\n\n 'Partitioned By' as `stats__partitioning_type__label`,\n partition_column as `stats__partitioning_type__value`,\n 'The partitioning column for this table' as `stats__partitioning_type__description`,\n is_partitioned as `stats__partitioning_type__include`,\n\n 'Clustered By' as `stats__clustering_fields__label`,\n clustering_columns as `stats__clustering_fields__value`,\n 'The clustering columns for this table' as `stats__clustering_fields__description`,\n is_clustered as `stats__clustering_fields__include`\n\n -- join using relation_id (an actual relation, not a shard prefix) to make\n -- sure that column metadata is picked up through the join. This will only\n -- return the column information for the \"max\" table in a date-sharded table set\n from unsharded_tables\n left join columns using (relation_id)\n left join column_stats using (relation_id)\n {%- endset -%}\n\n {%- endif -%}\n\n {{ return(run_query(query)) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.980373, "supported_languages": null}, "macro.dbt_bigquery.partition_by": {"unique_id": "macro.dbt_bigquery.partition_by", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "partition_by", "macro_sql": "{% macro partition_by(partition_config) -%}\n {%- if partition_config is none -%}\n {% do return('') %}\n {%- elif partition_config.data_type | lower in ('date','timestamp','datetime') -%}\n partition by {{ partition_config.render() }}\n {%- elif partition_config.data_type | lower in ('int64') -%}\n {%- set range = partition_config.range -%}\n partition by range_bucket(\n {{ partition_config.field }},\n generate_array({{ range.start}}, {{ range.end }}, {{ range.interval }})\n )\n {%- endif -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.9844182, "supported_languages": null}, "macro.dbt_bigquery.cluster_by": {"unique_id": "macro.dbt_bigquery.cluster_by", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "cluster_by", "macro_sql": "{% macro cluster_by(raw_cluster_by) %}\n {%- if raw_cluster_by is not none -%}\n cluster by {% if raw_cluster_by is string -%}\n {% set raw_cluster_by = [raw_cluster_by] %}\n {%- endif -%}\n {%- for cluster in raw_cluster_by -%}\n {{ cluster }}\n {%- if not loop.last -%}, {% endif -%}\n {%- endfor -%}\n\n {% endif %}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.984839, "supported_languages": null}, "macro.dbt_bigquery.bigquery_options": {"unique_id": "macro.dbt_bigquery.bigquery_options", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_options", "macro_sql": "{% macro bigquery_options(opts) %}\n {% set options -%}\n OPTIONS({% for opt_key, opt_val in opts.items() %}\n {{ opt_key }}={{ opt_val }}{{ \",\" if not loop.last }}\n {% endfor %})\n {%- endset %}\n {%- do return(options) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.985218, "supported_languages": null}, "macro.dbt_bigquery.bigquery_table_options": {"unique_id": "macro.dbt_bigquery.bigquery_table_options", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_table_options", "macro_sql": "{% macro bigquery_table_options(config, node, temporary) %}\n {% set opts = adapter.get_table_options(config, node, temporary) %}\n {%- do return(bigquery_options(opts)) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.985483, "supported_languages": null}, "macro.dbt_bigquery.bigquery__create_table_as": {"unique_id": "macro.dbt_bigquery.bigquery__create_table_as", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_table_as", "macro_sql": "{% macro bigquery__create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {%- if language == '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 {{ compiled_code }}\n );\n {%- elif language == 'python' -%}\n {#--\n N.B. Python models _can_ write to temp views HOWEVER they use a different session\n and have already expired by the time they need to be used (I.E. in merges for incremental models)\n\n TODO: Deep dive into spark sessions to see if we can reuse a single session for an entire\n dbt invocation.\n --#}\n {{ py_write_table(compiled_code=compiled_code, target_relation=relation.quote(database=False, schema=False, identifier=False)) }}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"bigquery__create_table_as macro didn't get supported language, it got %s\" % language) %}\n {%- endif -%}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.partition_by", "macro.dbt_bigquery.cluster_by", "macro.dbt_bigquery.bigquery_table_options", "macro.dbt_bigquery.py_write_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.986509, "supported_languages": null}, "macro.dbt_bigquery.bigquery_view_options": {"unique_id": "macro.dbt_bigquery.bigquery_view_options", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_view_options", "macro_sql": "{% macro bigquery_view_options(config, node) %}\n {% set opts = adapter.get_view_options(config, node) %}\n {%- do return(bigquery_options(opts)) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.986759, "supported_languages": null}, "macro.dbt_bigquery.bigquery__create_view_as": {"unique_id": "macro.dbt_bigquery.bigquery__create_view_as", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_view_as", "macro_sql": "{% macro bigquery__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create or replace view {{ relation }}\n {{ bigquery_view_options(config, model) }}\n as {{ sql }};\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_view_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.9870772, "supported_languages": null}, "macro.dbt_bigquery.bigquery__drop_schema": {"unique_id": "macro.dbt_bigquery.bigquery__drop_schema", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__drop_schema", "macro_sql": "{% macro bigquery__drop_schema(relation) -%}\n {{ adapter.drop_schema(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.98721, "supported_languages": null}, "macro.dbt_bigquery.bigquery__drop_relation": {"unique_id": "macro.dbt_bigquery.bigquery__drop_relation", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__drop_relation", "macro_sql": "{% macro bigquery__drop_relation(relation) -%}\n {% call statement('drop_relation') -%}\n drop {{ relation.type }} if exists {{ relation }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.987406, "supported_languages": null}, "macro.dbt_bigquery.bigquery__get_columns_in_relation": {"unique_id": "macro.dbt_bigquery.bigquery__get_columns_in_relation", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__get_columns_in_relation", "macro_sql": "{% macro bigquery__get_columns_in_relation(relation) -%}\n {{ return(adapter.get_columns_in_relation(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.987556, "supported_languages": null}, "macro.dbt_bigquery.bigquery__list_relations_without_caching": {"unique_id": "macro.dbt_bigquery.bigquery__list_relations_without_caching", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__list_relations_without_caching", "macro_sql": "{% macro bigquery__list_relations_without_caching(schema_relation) -%}\n {{ return(adapter.list_relations_without_caching(schema_relation)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.9877021, "supported_languages": null}, "macro.dbt_bigquery.bigquery__list_schemas": {"unique_id": "macro.dbt_bigquery.bigquery__list_schemas", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__list_schemas", "macro_sql": "{% macro bigquery__list_schemas(database) -%}\n {{ return(adapter.list_schemas(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.987843, "supported_languages": null}, "macro.dbt_bigquery.bigquery__check_schema_exists": {"unique_id": "macro.dbt_bigquery.bigquery__check_schema_exists", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__check_schema_exists", "macro_sql": "{% macro bigquery__check_schema_exists(information_schema, schema) %}\n {{ return(adapter.check_schema_exists(information_schema.database, schema)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.988018, "supported_languages": null}, "macro.dbt_bigquery.bigquery__persist_docs": {"unique_id": "macro.dbt_bigquery.bigquery__persist_docs", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__persist_docs", "macro_sql": "{% macro bigquery__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do alter_column_comment(relation, model.columns) %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.9883678, "supported_languages": null}, "macro.dbt_bigquery.bigquery__alter_column_comment": {"unique_id": "macro.dbt_bigquery.bigquery__alter_column_comment", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_column_comment", "macro_sql": "{% macro bigquery__alter_column_comment(relation, column_dict) -%}\n {% do adapter.update_columns(relation, column_dict) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.98852, "supported_languages": null}, "macro.dbt_bigquery.bigquery__rename_relation": {"unique_id": "macro.dbt_bigquery.bigquery__rename_relation", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__rename_relation", "macro_sql": "{% macro bigquery__rename_relation(from_relation, to_relation) -%}\n {% do adapter.rename_relation(from_relation, to_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.988671, "supported_languages": null}, "macro.dbt_bigquery.bigquery__alter_relation_add_columns": {"unique_id": "macro.dbt_bigquery.bigquery__alter_relation_add_columns", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_relation_add_columns", "macro_sql": "{% macro bigquery__alter_relation_add_columns(relation, add_columns) %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation }}\n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {{ return(run_query(sql)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.989065, "supported_languages": null}, "macro.dbt_bigquery.bigquery__alter_relation_drop_columns": {"unique_id": "macro.dbt_bigquery.bigquery__alter_relation_drop_columns", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_relation_drop_columns", "macro_sql": "{% macro bigquery__alter_relation_drop_columns(relation, drop_columns) %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation }}\n\n {% for column in drop_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {{ return(run_query(sql)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.989436, "supported_languages": null}, "macro.dbt_bigquery.bigquery__alter_column_type": {"unique_id": "macro.dbt_bigquery.bigquery__alter_column_type", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_column_type", "macro_sql": "{% macro bigquery__alter_column_type(relation, column_name, new_column_type) -%}\n {#-- Changing a column's data type using a query requires you to scan the entire table.\n The query charges can be significant if the table is very large.\n\n https://cloud.google.com/bigquery/docs/manually-changing-schemas#changing_a_columns_data_type\n #}\n {% set relation_columns = get_columns_in_relation(relation) %}\n\n {% set sql %}\n select\n {%- for col in relation_columns -%}\n {% if col.column == column_name %}\n CAST({{ col.quoted }} AS {{ new_column_type }}) AS {{ col.quoted }}\n {%- else %}\n {{ col.quoted }}\n {%- endif %}\n {%- if not loop.last %},{% endif -%}\n {%- endfor %}\n from {{ relation }}\n {% endset %}\n\n {% call statement('alter_column_type') %}\n {{ create_table_as(False, relation, sql)}}\n {%- endcall %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_columns_in_relation", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.990098, "supported_languages": null}, "macro.dbt_bigquery.bigquery__test_unique": {"unique_id": "macro.dbt_bigquery.bigquery__test_unique", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__test_unique", "macro_sql": "{% macro bigquery__test_unique(model, column_name) %}\n\nwith dbt_test__target as (\n\n select {{ column_name }} as unique_field\n from {{ model }}\n where {{ column_name }} is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.990268, "supported_languages": null}, "macro.dbt_bigquery.bigquery__upload_file": {"unique_id": "macro.dbt_bigquery.bigquery__upload_file", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__upload_file", "macro_sql": "{% macro bigquery__upload_file(local_file_path, database, table_schema, table_name) %}\n\n {{ log(\"kwargs: \" ~ kwargs) }}\n\n {% do adapter.upload_file(local_file_path, database, table_schema, table_name, kwargs=kwargs) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.990547, "supported_languages": null}, "macro.dbt_bigquery.bigquery__create_csv_table": {"unique_id": "macro.dbt_bigquery.bigquery__create_csv_table", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__create_csv_table", "macro_sql": "{% macro bigquery__create_csv_table(model, agate_table) %}\n -- no-op\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.990977, "supported_languages": null}, "macro.dbt_bigquery.bigquery__reset_csv_table": {"unique_id": "macro.dbt_bigquery.bigquery__reset_csv_table", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__reset_csv_table", "macro_sql": "{% macro bigquery__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.9911392, "supported_languages": null}, "macro.dbt_bigquery.bigquery__load_csv_rows": {"unique_id": "macro.dbt_bigquery.bigquery__load_csv_rows", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__load_csv_rows", "macro_sql": "{% macro bigquery__load_csv_rows(model, agate_table) %}\n\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {{ adapter.load_dataframe(model['database'], model['schema'], model['alias'],\n \t\t\t\t\t\t\tagate_table, column_override) }}\n {% if config.persist_relation_docs() and 'description' in model %}\n\n \t{{ adapter.update_table_description(model['database'], model['schema'], model['alias'], model['description']) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.991752, "supported_languages": null}, "macro.dbt_bigquery.bigquery__handle_existing_table": {"unique_id": "macro.dbt_bigquery.bigquery__handle_existing_table", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/view.sql", "original_file_path": "macros/materializations/view.sql", "name": "bigquery__handle_existing_table", "macro_sql": "{% macro bigquery__handle_existing_table(full_refresh, old_relation) %}\n {%- if full_refresh -%}\n {{ adapter.drop_relation(old_relation) }}\n {%- else -%}\n {{ exceptions.relation_wrong_type(old_relation, 'view') }}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.9923751, "supported_languages": null}, "macro.dbt_bigquery.materialization_view_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_view_bigquery", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/view.sql", "original_file_path": "macros/materializations/view.sql", "name": "materialization_view_bigquery", "macro_sql": "{% materialization view, adapter='bigquery' -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {% set to_return = create_or_replace_view() %}\n\n {% set target_relation = this.incorporate(type='view') %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if config.get('grant_access_to') %}\n {% for grant_target_dict in config.get('grant_access_to') %}\n {% do adapter.grant_access_to(this, 'view', None, grant_target_dict) %}\n {% endfor %}\n {% endif %}\n\n {% do return(to_return) %}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_or_replace_view", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.993036, "supported_languages": ["sql"]}, "macro.dbt_bigquery.materialization_table_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_table_bigquery", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "name": "materialization_table_bigquery", "macro_sql": "{% materialization table, adapter='bigquery', supported_languages=['sql', 'python']-%}\n\n {%- set language = model['language'] -%}\n {%- set identifier = model['alias'] -%}\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_not_as_table = (old_relation is not none and not old_relation.is_table) -%}\n {%- set target_relation = api.Relation.create(database=database, schema=schema, identifier=identifier, type='table') -%}\n\n -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\n\n {{ run_hooks(pre_hooks) }}\n\n {#\n We only need to drop this thing if it is not a table.\n If it _is_ already a table, then we can overwrite it without downtime\n Unlike table -> view, no need for `--full-refresh`: dropping a view is no big deal\n #}\n {%- if exists_not_as_table -%}\n {{ adapter.drop_relation(old_relation) }}\n {%- endif -%}\n\n -- build model\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set partition_by = adapter.parse_partition_by(raw_partition_by) -%}\n {%- set cluster_by = config.get('cluster_by', none) -%}\n {% if not adapter.is_replaceable(old_relation, partition_by, cluster_by) %}\n {% do log(\"Hard refreshing \" ~ old_relation ~ \" because it is not replaceable\") %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n\n -- build model\n {%- call statement('main', language=language) -%}\n {{ create_table_as(False, target_relation, compiled_code, language) }}\n {%- endcall -%}\n\n {{ run_hooks(post_hooks) }}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.996345, "supported_languages": ["sql", "python"]}, "macro.dbt_bigquery.py_write_table": {"unique_id": "macro.dbt_bigquery.py_write_table", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "name": "py_write_table", "macro_sql": "{% macro py_write_table(compiled_code, target_relation) %}\nfrom pyspark.sql import SparkSession\n\nspark = SparkSession.builder.appName('smallTest').getOrCreate()\n\nspark.conf.set(\"viewsEnabled\",\"true\")\nspark.conf.set(\"temporaryGcsBucket\",\"{{target.gcs_bucket}}\")\n\n{{ compiled_code }}\ndbt = dbtObj(spark.read.format(\"bigquery\").load)\ndf = model(dbt, spark)\n\n# COMMAND ----------\n# this is materialization code dbt generated, please do not modify\n\nimport pyspark\n# make sure pandas exists before using it\ntry:\n import pandas\n pandas_available = True\nexcept ImportError:\n pandas_available = False\n\n# make sure pyspark.pandas exists before using it\ntry:\n import pyspark.pandas\n pyspark_pandas_api_available = True\nexcept ImportError:\n pyspark_pandas_api_available = False\n\n# make sure databricks.koalas exists before using it\ntry:\n import databricks.koalas\n koalas_available = True\nexcept ImportError:\n koalas_available = False\n\n# preferentially convert pandas DataFrames to pandas-on-Spark or Koalas DataFrames first\n# since they know how to convert pandas DataFrames better than `spark.createDataFrame(df)`\n# and converting from pandas-on-Spark to Spark DataFrame has no overhead\nif pyspark_pandas_api_available and pandas_available and isinstance(df, pandas.core.frame.DataFrame):\n df = pyspark.pandas.frame.DataFrame(df)\nelif koalas_available and pandas_available and isinstance(df, pandas.core.frame.DataFrame):\n df = databricks.koalas.frame.DataFrame(df)\n\n# convert to pyspark.sql.dataframe.DataFrame\nif isinstance(df, pyspark.sql.dataframe.DataFrame):\n pass # since it is already a Spark DataFrame\nelif pyspark_pandas_api_available and isinstance(df, pyspark.pandas.frame.DataFrame):\n df = df.to_spark()\nelif koalas_available and isinstance(df, databricks.koalas.frame.DataFrame):\n df = df.to_spark()\nelif pandas_available and isinstance(df, pandas.core.frame.DataFrame):\n df = spark.createDataFrame(df)\nelse:\n msg = f\"{type(df)} is not a supported type for dbt Python materialization\"\n raise Exception(msg)\n\ndf.write \\\n .mode(\"overwrite\") \\\n .format(\"bigquery\") \\\n .option(\"writeMethod\", \"direct\").option(\"writeDisposition\", 'WRITE_TRUNCATE') \\\n .save(\"{{target_relation}}\")\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.9967098, "supported_languages": null}, "macro.dbt_bigquery.materialization_copy_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_copy_bigquery", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/copy.sql", "original_file_path": "macros/materializations/copy.sql", "name": "materialization_copy_bigquery", "macro_sql": "{% materialization copy, adapter='bigquery' -%}\n\n {# Setup #}\n {{ run_hooks(pre_hooks) }}\n\n {% set destination = this.incorporate(type='table') %}\n\n {# there can be several ref() or source() according to BQ copy API docs #}\n {# cycle over ref() and source() to create source tables array #}\n {% set source_array = [] %}\n {% for ref_table in model.refs %}\n {{ source_array.append(ref(*ref_table)) }}\n {% endfor %}\n\n {% for src_table in model.sources %}\n {{ source_array.append(source(*src_table)) }}\n {% endfor %}\n\n {# Call adapter copy_table function #}\n {%- set result_str = adapter.copy_table(\n source_array,\n destination,\n config.get('copy_materialization', default = 'table')) -%}\n\n {{ store_result('main', response=result_str) }}\n\n {# Clean up #}\n {{ run_hooks(post_hooks) }}\n {%- do apply_grants(target_relation, grant_config) -%}\n {{ adapter.commit() }}\n\n {{ return({'relations': [destination]}) }}\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.997969, "supported_languages": ["sql"]}, "macro.dbt_bigquery.declare_dbt_max_partition": {"unique_id": "macro.dbt_bigquery.declare_dbt_max_partition", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "declare_dbt_max_partition", "macro_sql": "{% macro declare_dbt_max_partition(relation, partition_by, complied_code, language='sql') %}\n\n {#-- TODO: revisit partitioning with python models --#}\n {%- if '_dbt_max_partition' in complied_code and language == 'sql' -%}\n\n declare _dbt_max_partition {{ partition_by.data_type }} default (\n select max({{ partition_by.field }}) from {{ this }}\n where {{ partition_by.field }} is not null\n );\n\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0002549, "supported_languages": null}, "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy": {"unique_id": "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "dbt_bigquery_validate_get_incremental_strategy", "macro_sql": "{% macro dbt_bigquery_validate_get_incremental_strategy(config) %}\n {#-- Find and validate the incremental strategy #}\n {%- set strategy = config.get(\"incremental_strategy\") or '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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.000704, "supported_languages": null}, "macro.dbt_bigquery.bq_insert_overwrite": {"unique_id": "macro.dbt_bigquery.bq_insert_overwrite", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "bq_insert_overwrite", "macro_sql": "{% macro bq_insert_overwrite(\n tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n) %}\n\n {% if partitions is not none and partitions != [] %} {# static #}\n\n {% set predicate -%}\n {{ partition_by.render(alias='DBT_INTERNAL_DEST') }} in (\n {{ partitions | join (', ') }}\n )\n {%- endset %}\n\n {%- set source_sql -%}\n (\n {{sql}}\n )\n {%- endset -%}\n\n {#-- Because we're putting the model SQL _directly_ into the MERGE statement,\n we need to prepend the MERGE statement with the user-configured sql_header,\n which may be needed to resolve that model SQL (e.g. referencing a variable or UDF in the header)\n in the \"dynamic\" case, we save the model SQL result as a temp table first, wherein the\n sql_header is included by the create_table_as macro.\n #}\n {{ get_insert_overwrite_merge_sql(target_relation, source_sql, dest_columns, [predicate], include_sql_header=true) }}\n\n {% else %} {# dynamic #}\n\n {% set predicate -%}\n {{ partition_by.render(alias='DBT_INTERNAL_DEST') }} in unnest(dbt_partitions_for_replacement)\n {%- endset %}\n\n {%- set source_sql -%}\n (\n select * from {{ tmp_relation }}\n )\n {%- endset -%}\n\n -- generated script to merge partitions into {{ target_relation }}\n declare dbt_partitions_for_replacement array<{{ partition_by.data_type }}>;\n\n {# have we already created the temp table to check for schema changes? #}\n {% if not tmp_relation_exists %}\n {{ declare_dbt_max_partition(this, partition_by, sql) }}\n\n -- 1. create a temp table\n {{ create_table_as(True, tmp_relation, compiled_code) }}\n {% else %}\n -- 1. temp table already exists, we used it to check for schema changes\n {% endif %}\n\n -- 2. define partitions to update\n set (dbt_partitions_for_replacement) = (\n select as struct\n array_agg(distinct {{ partition_by.render() }})\n from {{ tmp_relation }}\n );\n\n -- 3. run the merge statement\n {{ get_insert_overwrite_merge_sql(target_relation, source_sql, dest_columns, [predicate]) }};\n\n -- 4. clean up the temp table\n drop table if exists {{ tmp_relation }}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql", "macro.dbt_bigquery.declare_dbt_max_partition", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.00194, "supported_languages": null}, "macro.dbt_bigquery.bq_generate_incremental_build_sql": {"unique_id": "macro.dbt_bigquery.bq_generate_incremental_build_sql", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "bq_generate_incremental_build_sql", "macro_sql": "{% macro bq_generate_incremental_build_sql(\n strategy, tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n) %}\n {#-- if partitioned, use BQ scripting to get the range of partition values to be updated --#}\n {% if strategy == 'insert_overwrite' %}\n\n {% set missing_partition_msg -%}\n The 'insert_overwrite' strategy requires the `partition_by` config.\n {%- endset %}\n {% if partition_by is none %}\n {% do exceptions.raise_compiler_error(missing_partition_msg) %}\n {% endif %}\n\n {% set build_sql = bq_insert_overwrite(\n tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n ) %}\n\n {% else %} {# strategy == 'merge' #}\n {%- set source_sql -%}\n {%- if tmp_relation_exists -%}\n (\n select * from {{ tmp_relation }}\n )\n {%- else -%} {#-- wrap sql in parens to make it a subquery --#}\n (\n {{sql}}\n )\n {%- endif -%}\n {%- endset -%}\n\n {% set build_sql = get_merge_sql(target_relation, source_sql, unique_key, dest_columns) %}\n\n {% endif %}\n\n {{ return(build_sql) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bq_insert_overwrite", "macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.002802, "supported_languages": null}, "macro.dbt_bigquery.materialization_incremental_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_incremental_bigquery", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "materialization_incremental_bigquery", "macro_sql": "{% materialization incremental, adapter='bigquery', supported_languages=['sql', 'python'] -%}\n\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n {%- set language = model['language'] %}\n\n {%- set target_relation = this %}\n {%- set existing_relation = load_relation(this) %}\n {%- set tmp_relation = make_temp_relation(this) %}\n\n {#-- Validate early so we don't run SQL if the strategy is invalid --#}\n {% set strategy = dbt_bigquery_validate_get_incremental_strategy(config) -%}\n\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set partition_by = adapter.parse_partition_by(raw_partition_by) -%}\n {%- set partitions = config.get('partitions', none) -%}\n {%- set cluster_by = config.get('cluster_by', none) -%}\n\n {% set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') %}\n\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n {% if existing_relation is none %}\n {%- call statement('main', language=language) -%}\n {{ create_table_as(False, target_relation, compiled_code, language) }}\n {%- endcall -%}\n\n {% elif existing_relation.is_view %}\n {#-- There's no way to atomically replace a view with a table on BQ --#}\n {{ adapter.drop_relation(existing_relation) }}\n {%- call statement('main', language=language) -%}\n {{ create_table_as(False, target_relation, compiled_code, language) }}\n {%- endcall -%}\n\n {% elif full_refresh_mode %}\n {#-- If the partition/cluster config has changed, then we must drop and recreate --#}\n {% if not adapter.is_replaceable(existing_relation, partition_by, cluster_by) %}\n {% do log(\"Hard refreshing \" ~ existing_relation ~ \" because it is not replaceable\") %}\n {{ adapter.drop_relation(existing_relation) }}\n {% endif %}\n {%- call statement('main', language=language) -%}\n {{ create_table_as(False, target_relation, compiled_code, language) }}\n {%- endcall -%}\n\n {% else %}\n {%- if language == 'python' and strategy == 'insert_overwrite' -%}\n {#-- This lets us move forward assuming no python will be directly templated into a query --#}\n {%- set python_unsupported_msg -%}\n The 'insert_overwrite' strategy is not yet supported for python models.\n {%- endset %}\n {% do exceptions.raise_compiler_error(python_unsupported_msg) %}\n {%- endif -%}\n\n {% set tmp_relation_exists = false %}\n {% if on_schema_change != 'ignore' or language == 'python' %}\n {#-- Check first, since otherwise we may not build a temp table --#}\n {#-- Python always needs to create a temp table --#}\n {%- call statement('create_tmp_relation', language=language) -%}\n {{ declare_dbt_max_partition(this, partition_by, compiled_code, language) +\n create_table_as(True, tmp_relation, compiled_code, language)\n }}\n {%- endcall -%}\n {% set tmp_relation_exists = true %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, tmp_relation, existing_relation) %}\n {% endif %}\n\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n {% set build_sql = bq_generate_incremental_build_sql(\n strategy, tmp_relation, target_relation, compiled_code, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n ) %}\n\n {%- call statement('main') -%}\n {{ build_sql }}\n {% endcall %}\n\n {%- if language == 'python' and tmp_relation -%}\n {{ adapter.drop_relation(tmp_relation) }}\n {%- endif -%}\n\n {% endif %}\n\n {{ run_hooks(post_hooks) }}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.load_relation", "macro.dbt.make_temp_relation", "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt_bigquery.declare_dbt_max_partition", "macro.dbt.process_schema_changes", "macro.dbt_bigquery.bq_generate_incremental_build_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0062878, "supported_languages": ["sql", "python"]}, "macro.dbt_bigquery.bigquery__snapshot_hash_arguments": {"unique_id": "macro.dbt_bigquery.bigquery__snapshot_hash_arguments", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__snapshot_hash_arguments", "macro_sql": "{% macro bigquery__snapshot_hash_arguments(args) -%}\n to_hex(md5(concat({%- for arg in args -%}\n coalesce(cast({{ arg }} as string), ''){% if not loop.last %}, '|',{% endif -%}\n {%- endfor -%}\n )))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.00677, "supported_languages": null}, "macro.dbt_bigquery.bigquery__create_columns": {"unique_id": "macro.dbt_bigquery.bigquery__create_columns", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__create_columns", "macro_sql": "{% macro bigquery__create_columns(relation, columns) %}\n {{ adapter.alter_table_add_columns(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.006926, "supported_languages": null}, "macro.dbt_bigquery.bigquery__post_snapshot": {"unique_id": "macro.dbt_bigquery.bigquery__post_snapshot", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__post_snapshot", "macro_sql": "{% macro bigquery__post_snapshot(staging_relation) %}\n -- Clean up the snapshot temp table\n {% do drop_relation(staging_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0070531, "supported_languages": null}, "macro.dbt_bigquery.bigquery__except": {"unique_id": "macro.dbt_bigquery.bigquery__except", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "name": "bigquery__except", "macro_sql": "{% macro bigquery__except() %}\n\n except distinct\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.007231, "supported_languages": null}, "macro.dbt_bigquery.bigquery__dateadd": {"unique_id": "macro.dbt_bigquery.bigquery__dateadd", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "name": "bigquery__dateadd", "macro_sql": "{% macro bigquery__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n datetime_add(\n cast( {{ from_date_or_timestamp }} as datetime),\n interval {{ interval }} {{ datepart }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.007524, "supported_languages": null}, "macro.dbt_bigquery.bigquery__current_timestamp": {"unique_id": "macro.dbt_bigquery.bigquery__current_timestamp", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/timestamps.sql", "original_file_path": "macros/utils/timestamps.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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0077498, "supported_languages": null}, "macro.dbt_bigquery.bigquery__snapshot_string_as_time": {"unique_id": "macro.dbt_bigquery.bigquery__snapshot_string_as_time", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/timestamps.sql", "original_file_path": "macros/utils/timestamps.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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.00793, "supported_languages": null}, "macro.dbt_bigquery.bigquery__current_timestamp_backcompat": {"unique_id": "macro.dbt_bigquery.bigquery__current_timestamp_backcompat", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/timestamps.sql", "original_file_path": "macros/utils/timestamps.sql", "name": "bigquery__current_timestamp_backcompat", "macro_sql": "{% macro bigquery__current_timestamp_backcompat() -%}\n current_timestamp\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0080152, "supported_languages": null}, "macro.dbt_bigquery.bigquery__intersect": {"unique_id": "macro.dbt_bigquery.bigquery__intersect", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "name": "bigquery__intersect", "macro_sql": "{% macro bigquery__intersect() %}\n\n intersect distinct\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.008184, "supported_languages": null}, "macro.dbt_bigquery.bigquery__escape_single_quotes": {"unique_id": "macro.dbt_bigquery.bigquery__escape_single_quotes", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "name": "bigquery__escape_single_quotes", "macro_sql": "{% macro bigquery__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\", \"\\\\'\") }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.008449, "supported_languages": null}, "macro.dbt_bigquery.bigquery__right": {"unique_id": "macro.dbt_bigquery.bigquery__right", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "name": "bigquery__right", "macro_sql": "{% macro bigquery__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0\n then ''\n else\n substr(\n {{ string_text }},\n -1 * ({{ length_expression }})\n )\n end\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0087428, "supported_languages": null}, "macro.dbt_bigquery.bigquery__listagg": {"unique_id": "macro.dbt_bigquery.bigquery__listagg", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "name": "bigquery__listagg", "macro_sql": "{% macro bigquery__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n string_agg(\n {{ measure }},\n {{ delimiter_text }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n {% if limit_num -%}\n limit {{ limit_num }}\n {%- endif %}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.009192, "supported_languages": null}, "macro.dbt_bigquery.bigquery__datediff": {"unique_id": "macro.dbt_bigquery.bigquery__datediff", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "name": "bigquery__datediff", "macro_sql": "{% macro bigquery__datediff(first_date, second_date, datepart) -%}\n\n {% if dbt_version[0] == 1 and dbt_version[2] >= 2 %}\n {{ return(dbt.datediff(first_date, second_date, datepart)) }}\n {% else %}\n\n datetime_diff(\n cast({{second_date}} as datetime),\n cast({{first_date}} as datetime),\n {{datepart}}\n )\n\n {% endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.009749, "supported_languages": null}, "macro.dbt_bigquery.bigquery__safe_cast": {"unique_id": "macro.dbt_bigquery.bigquery__safe_cast", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "name": "bigquery__safe_cast", "macro_sql": "{% macro bigquery__safe_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.009981, "supported_languages": null}, "macro.dbt_bigquery.bigquery__hash": {"unique_id": "macro.dbt_bigquery.bigquery__hash", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "name": "bigquery__hash", "macro_sql": "{% macro bigquery__hash(field) -%}\n to_hex({{dbt.default__hash(field)}})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.010207, "supported_languages": null}, "macro.dbt_bigquery.bigquery__position": {"unique_id": "macro.dbt_bigquery.bigquery__position", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "name": "bigquery__position", "macro_sql": "{% macro bigquery__position(substring_text, string_text) %}\n\n strpos(\n {{ string_text }},\n {{ substring_text }}\n\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.010453, "supported_languages": null}, "macro.dbt_bigquery.bigquery__array_concat": {"unique_id": "macro.dbt_bigquery.bigquery__array_concat", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "name": "bigquery__array_concat", "macro_sql": "{% macro bigquery__array_concat(array_1, array_2) -%}\n array_concat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.010726, "supported_languages": null}, "macro.dbt_bigquery.bigquery__bool_or": {"unique_id": "macro.dbt_bigquery.bigquery__bool_or", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "name": "bigquery__bool_or", "macro_sql": "{% macro bigquery__bool_or(expression) -%}\n\n logical_or({{ expression }})\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.011035, "supported_languages": null}, "macro.dbt_bigquery.bigquery__split_part": {"unique_id": "macro.dbt_bigquery.bigquery__split_part", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "name": "bigquery__split_part", "macro_sql": "{% macro bigquery__split_part(string_text, delimiter_text, part_number) %}\n\n {% if part_number >= 0 %}\n split(\n {{ string_text }},\n {{ delimiter_text }}\n )[safe_offset({{ part_number - 1 }})]\n {% else %}\n split(\n {{ string_text }},\n {{ delimiter_text }}\n )[safe_offset(\n length({{ string_text }})\n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 1\n )]\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.011776, "supported_languages": null}, "macro.dbt_bigquery.bigquery__date_trunc": {"unique_id": "macro.dbt_bigquery.bigquery__date_trunc", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "name": "bigquery__date_trunc", "macro_sql": "{% macro bigquery__date_trunc(datepart, date) -%}\n timestamp_trunc(\n cast({{date}} as timestamp),\n {{datepart}}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0120409, "supported_languages": null}, "macro.dbt_bigquery.bigquery__array_construct": {"unique_id": "macro.dbt_bigquery.bigquery__array_construct", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "name": "bigquery__array_construct", "macro_sql": "{% macro bigquery__array_construct(inputs, data_type) -%}\n {% if inputs|length > 0 %}\n [ {{ inputs|join(' , ') }} ]\n {% else %}\n ARRAY<{{data_type}}>[]\n {% endif %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.012434, "supported_languages": null}, "macro.dbt_bigquery.bigquery__array_append": {"unique_id": "macro.dbt_bigquery.bigquery__array_append", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "name": "bigquery__array_append", "macro_sql": "{% macro bigquery__array_append(array, new_element) -%}\n {{ array_concat(array, array_construct([new_element])) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.array_concat", "macro.dbt.array_construct"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.01272, "supported_languages": null}, "macro.dbt_bigquery.bigquery__get_show_grant_sql": {"unique_id": "macro.dbt_bigquery.bigquery__get_show_grant_sql", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "bigquery__get_show_grant_sql", "macro_sql": "{% macro bigquery__get_show_grant_sql(relation) %}\n {% set location = adapter.get_dataset_location(relation) %}\n {% set relation = relation.incorporate(location=location) %}\n\n select privilege_type, grantee\n from {{ relation.information_schema(\"OBJECT_PRIVILEGES\") }}\n where object_schema = \"{{ relation.dataset }}\"\n and object_name = \"{{ relation.identifier }}\"\n -- filter out current user\n and split(grantee, ':')[offset(1)] != session_user()\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.013428, "supported_languages": null}, "macro.dbt_bigquery.bigquery__get_grant_sql": {"unique_id": "macro.dbt_bigquery.bigquery__get_grant_sql", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "bigquery__get_grant_sql", "macro_sql": "\n\n\n{%- macro bigquery__get_grant_sql(relation, privilege, grantee) -%}\n grant `{{ privilege }}` on {{ relation.type }} {{ relation }} to {{ '\\\"' + grantee|join('\\\", \\\"') + '\\\"' }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.013675, "supported_languages": null}, "macro.dbt_bigquery.bigquery__get_revoke_sql": {"unique_id": "macro.dbt_bigquery.bigquery__get_revoke_sql", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "bigquery__get_revoke_sql", "macro_sql": "{%- macro bigquery__get_revoke_sql(relation, privilege, grantee) -%}\n revoke `{{ privilege }}` on {{ relation.type }} {{ relation }} from {{ '\\\"' + grantee|join('\\\", \\\"') + '\\\"' }}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.013916, "supported_languages": null}, "macro.dbt.run_hooks": {"unique_id": "macro.dbt.run_hooks", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.015054, "supported_languages": null}, "macro.dbt.make_hook_config": {"unique_id": "macro.dbt.make_hook_config", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.015254, "supported_languages": null}, "macro.dbt.before_begin": {"unique_id": "macro.dbt.before_begin", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.015397, "supported_languages": null}, "macro.dbt.in_transaction": {"unique_id": "macro.dbt.in_transaction", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.015539, "supported_languages": null}, "macro.dbt.after_commit": {"unique_id": "macro.dbt.after_commit", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0156858, "supported_languages": null}, "macro.dbt.set_sql_header": {"unique_id": "macro.dbt.set_sql_header", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.016122, "supported_languages": null}, "macro.dbt.should_full_refresh": {"unique_id": "macro.dbt.should_full_refresh", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0164218, "supported_languages": null}, "macro.dbt.should_store_failures": {"unique_id": "macro.dbt.should_store_failures", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0167282, "supported_languages": null}, "macro.dbt.snapshot_merge_sql": {"unique_id": "macro.dbt.snapshot_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "name": "snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.017227, "supported_languages": null}, "macro.dbt.default__snapshot_merge_sql": {"unique_id": "macro.dbt.default__snapshot_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "name": "default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.dbt_scd_id = DBT_INTERNAL_DEST.dbt_scd_id\n\n when matched\n and DBT_INTERNAL_DEST.dbt_valid_to is null\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0175, "supported_languages": null}, "macro.dbt.strategy_dispatch": {"unique_id": "macro.dbt.strategy_dispatch", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "strategy_dispatch", "macro_sql": "{% macro strategy_dispatch(name) -%}\n{% set original_name = name %}\n {% if '.' in name %}\n {% set package_name, name = name.split(\".\", 1) %}\n {% else %}\n {% set package_name = none %}\n {% endif %}\n\n {% if package_name is none %}\n {% set package_context = context %}\n {% elif package_name in context %}\n {% set package_context = context[package_name] %}\n {% else %}\n {% set error_msg %}\n Could not find package '{{package_name}}', called with '{{original_name}}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n\n {%- set search_name = 'snapshot_' ~ name ~ '_strategy' -%}\n\n {% if search_name not in package_context %}\n {% set error_msg %}\n The specified strategy macro '{{name}}' was not found in package '{{ package_name }}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n {{ return(package_context[search_name]) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0209012, "supported_languages": null}, "macro.dbt.snapshot_hash_arguments": {"unique_id": "macro.dbt.snapshot_hash_arguments", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments', 'dbt')(args) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0210738, "supported_languages": null}, "macro.dbt.default__snapshot_hash_arguments": {"unique_id": "macro.dbt.default__snapshot_hash_arguments", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "default__snapshot_hash_arguments", "macro_sql": "{% macro default__snapshot_hash_arguments(args) -%}\n md5({%- for arg in args -%}\n coalesce(cast({{ arg }} as varchar ), '')\n {% if not loop.last %} || '|' || {% endif %}\n {%- endfor -%})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.02129, "supported_languages": null}, "macro.dbt.snapshot_timestamp_strategy": {"unique_id": "macro.dbt.snapshot_timestamp_strategy", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_timestamp_strategy", "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set primary_key = config['unique_key'] %}\n {% set updated_at = config['updated_at'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/dbt-labs/dbt-core/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.dbt_valid_from < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.022007, "supported_languages": null}, "macro.dbt.snapshot_string_as_time": {"unique_id": "macro.dbt.snapshot_string_as_time", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time', 'dbt')(timestamp) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.022169, "supported_languages": null}, "macro.dbt.default__snapshot_string_as_time": {"unique_id": "macro.dbt.default__snapshot_string_as_time", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "default__snapshot_string_as_time", "macro_sql": "{% macro default__snapshot_string_as_time(timestamp) %}\n {% do exceptions.raise_not_implemented(\n 'snapshot_string_as_time macro not implemented for adapter '+adapter.type()\n ) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0223382, "supported_languages": null}, "macro.dbt.snapshot_check_all_get_existing_columns": {"unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) -%}\n {%- if not target_exists -%}\n {#-- no table yet -> return whatever the query does --#}\n {{ return((false, query_columns)) }}\n {%- endif -%}\n\n {#-- handle any schema changes --#}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=node.alias) -%}\n\n {% if check_cols_config == 'all' %}\n {%- set query_columns = get_columns_in_query(node['compiled_code']) -%}\n\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {#-- query for proper casing/quoting, to support comparison below --#}\n {%- set select_check_cols_from_target -%}\n select {{ check_cols_config | join(', ') }} from ({{ node['compiled_code'] }}) subq\n {%- endset -%}\n {% set query_columns = get_columns_in_query(select_check_cols_from_target) %}\n\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set existing_cols = adapter.get_columns_in_relation(target_relation) | map(attribute = 'name') | list -%}\n {%- set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(adapter.quote(col)) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return((ns.column_added, intersection)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.023722, "supported_languages": null}, "macro.dbt.snapshot_check_strategy": {"unique_id": "macro.dbt.snapshot_check_strategy", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set check_cols_config = config['check_cols'] %}\n {% set primary_key = config['unique_key'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n {% set updated_at = config.get('updated_at', snapshot_get_time()) %}\n\n {% set column_added = false %}\n\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n {{ get_true_sql() }}\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.get_true_sql", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.025077, "supported_languages": null}, "macro.dbt.create_columns": {"unique_id": "macro.dbt.create_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns', 'dbt')(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.028824, "supported_languages": null}, "macro.dbt.default__create_columns": {"unique_id": "macro.dbt.default__create_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation }} add column \"{{ column.name }}\" {{ column.data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.029109, "supported_languages": null}, "macro.dbt.post_snapshot": {"unique_id": "macro.dbt.post_snapshot", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.029279, "supported_languages": null}, "macro.dbt.default__post_snapshot": {"unique_id": "macro.dbt.default__post_snapshot", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.029365, "supported_languages": null}, "macro.dbt.get_true_sql": {"unique_id": "macro.dbt.get_true_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "get_true_sql", "macro_sql": "{% macro get_true_sql() %}\n {{ adapter.dispatch('get_true_sql', 'dbt')() }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_true_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.029509, "supported_languages": null}, "macro.dbt.default__get_true_sql": {"unique_id": "macro.dbt.default__get_true_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__get_true_sql", "macro_sql": "{% macro default__get_true_sql() %}\n {{ return('TRUE') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.029622, "supported_languages": null}, "macro.dbt.snapshot_staging_table": {"unique_id": "macro.dbt.snapshot_staging_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "snapshot_staging_table", "macro_sql": "{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {{ adapter.dispatch('snapshot_staging_table', 'dbt')(strategy, source_sql, target_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_staging_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.029823, "supported_languages": null}, "macro.dbt.default__snapshot_staging_table": {"unique_id": "macro.dbt.default__snapshot_staging_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__snapshot_staging_table", "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *,\n {{ strategy.unique_key }} as dbt_unique_key\n\n from {{ target_relation }}\n where dbt_valid_to is null\n\n ),\n\n insertions_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to,\n {{ strategy.scd_id }} as dbt_scd_id\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n {{ strategy.updated_at }} as dbt_valid_to\n\n from snapshot_query\n ),\n\n {%- if strategy.invalidate_hard_deletes %}\n\n deletes_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from insertions_source_data as source_data\n left outer join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_unique_key is null\n or (\n snapshotted_data.dbt_unique_key is not null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.dbt_scd_id\n\n from updates_source_data as source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where (\n {{ strategy.row_changed }}\n )\n )\n\n {%- if strategy.invalidate_hard_deletes -%}\n ,\n\n deletes as (\n\n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as dbt_valid_from,\n {{ snapshot_get_time() }} as dbt_updated_at,\n {{ snapshot_get_time() }} as dbt_valid_to,\n snapshotted_data.dbt_scd_id\n\n from snapshotted_data\n left join deletes_source_data as source_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where source_data.dbt_unique_key is null\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.invalidate_hard_deletes %}\n union all\n select * from deletes\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.030698, "supported_languages": null}, "macro.dbt.build_snapshot_table": {"unique_id": "macro.dbt.build_snapshot_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) -%}\n {{ adapter.dispatch('build_snapshot_table', 'dbt')(strategy, sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__build_snapshot_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.030894, "supported_languages": null}, "macro.dbt.default__build_snapshot_table": {"unique_id": "macro.dbt.default__build_snapshot_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__build_snapshot_table", "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.03115, "supported_languages": null}, "macro.dbt.build_snapshot_staging_table": {"unique_id": "macro.dbt.build_snapshot_staging_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set temp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, temp_relation, select) }}\n {% endcall %}\n\n {% do return(temp_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.031615, "supported_languages": null}, "macro.dbt.materialization_snapshot_default": {"unique_id": "macro.dbt.materialization_snapshot_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot.sql", "original_file_path": "macros/materializations/snapshots/snapshot.sql", "name": "materialization_snapshot_default", "macro_sql": "{% materialization snapshot, default %}\n {%- set config = model['config'] -%}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\n\n {% set target_relation_exists, target_relation = get_or_create_relation(\n database=model.database,\n schema=model.schema,\n identifier=target_table,\n type='table') -%}\n\n {%- if not target_relation.is_table -%}\n {% do exceptions.relation_wrong_type(target_relation, 'table') %}\n {%- endif -%}\n\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set strategy_macro = strategy_dispatch(strategy_name) %}\n {% set strategy = strategy_macro(model, \"snapshotted_data\", \"source_data\", config, target_relation_exists) %}\n\n {% if not target_relation_exists %}\n\n {% set build_sql = build_snapshot_table(strategy, model['compiled_code']) %}\n {% set final_sql = create_table_as(False, target_relation, build_sql) %}\n\n {% else %}\n\n {{ adapter.valid_snapshot_target(target_relation) }}\n\n {% set staging_table = build_snapshot_staging_table(strategy, sql, target_relation) %}\n\n -- this may no-op if the database does not require column expansion\n {% do adapter.expand_target_column_types(from_relation=staging_table,\n to_relation=target_relation) %}\n\n {% set missing_columns = adapter.get_missing_columns(staging_table, target_relation)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% do create_columns(target_relation, missing_columns) %}\n\n {% set source_columns = adapter.get_columns_in_relation(staging_table)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% set quoted_source_columns = [] %}\n {% for column in source_columns %}\n {% do quoted_source_columns.append(adapter.quote(column.name)) %}\n {% endfor %}\n\n {% set final_sql = snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n %}\n\n {% endif %}\n\n {% call statement('main') %}\n {{ final_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(target_relation_exists, full_refresh_mode=False) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if not target_relation_exists %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if staging_table is defined %}\n {% do post_snapshot(staging_table) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_or_create_relation", "macro.dbt.run_hooks", "macro.dbt.strategy_dispatch", "macro.dbt.build_snapshot_table", "macro.dbt.create_table_as", "macro.dbt.build_snapshot_staging_table", "macro.dbt.create_columns", "macro.dbt.snapshot_merge_sql", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes", "macro.dbt.post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.037518, "supported_languages": ["sql"]}, "macro.dbt.materialization_test_default": {"unique_id": "macro.dbt.materialization_test_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/test.sql", "original_file_path": "macros/materializations/tests/test.sql", "name": "materialization_test_default", "macro_sql": "{%- materialization test, default -%}\n\n {% set relations = [] %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type='table') -%} %}\n\n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n\n {% call statement(auto_begin=True) %}\n {{ create_table_as(False, target_relation, sql) }}\n {% endcall %}\n\n {% do relations.append(target_relation) %}\n\n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n\n {{ adapter.commit() }}\n\n {% else %}\n\n {% set main_sql = sql %}\n\n {% endif %}\n\n {% set limit = config.get('limit') %}\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit)}}\n\n {%- endcall %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0396092, "supported_languages": ["sql"]}, "macro.dbt.get_test_sql": {"unique_id": "macro.dbt.get_test_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "name": "get_test_sql", "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql', 'dbt')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.040134, "supported_languages": null}, "macro.dbt.default__get_test_sql": {"unique_id": "macro.dbt.default__get_test_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "name": "default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.040452, "supported_languages": null}, "macro.dbt.get_where_subquery": {"unique_id": "macro.dbt.get_where_subquery", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "name": "get_where_subquery", "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_where_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.040892, "supported_languages": null}, "macro.dbt.default__get_where_subquery": {"unique_id": "macro.dbt.default__get_where_subquery", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "name": "default__get_where_subquery", "macro_sql": "{% macro default__get_where_subquery(relation) -%}\n {% set where = config.get('where', '') %}\n {% if where %}\n {%- set filtered -%}\n (select * from {{ relation }} where {{ where }}) dbt_subquery\n {%- endset -%}\n {% do return(filtered) %}\n {%- else -%}\n {% do return(relation) %}\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0412722, "supported_languages": null}, "macro.dbt.get_quoted_csv": {"unique_id": "macro.dbt.get_quoted_csv", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\n\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.04285, "supported_languages": null}, "macro.dbt.diff_columns": {"unique_id": "macro.dbt.diff_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "diff_columns", "macro_sql": "{% macro diff_columns(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% set source_names = source_columns | map(attribute = 'column') | list %}\n {% set target_names = target_columns | map(attribute = 'column') | list %}\n\n {# --check whether the name attribute exists in the target - this does not perform a data type check #}\n {% for sc in source_columns %}\n {% if sc.name not in target_names %}\n {{ result.append(sc) }}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0433972, "supported_languages": null}, "macro.dbt.diff_column_data_types": {"unique_id": "macro.dbt.diff_column_data_types", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "diff_column_data_types", "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.data_type != tc.data_type and not sc.can_expand_to(other_column=tc) %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.data_type } ) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.044063, "supported_languages": null}, "macro.dbt.get_merge_update_columns": {"unique_id": "macro.dbt.get_merge_update_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "get_merge_update_columns", "macro_sql": "{% macro get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {{ return(adapter.dispatch('get_merge_update_columns', 'dbt')(merge_update_columns, merge_exclude_columns, dest_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0443, "supported_languages": null}, "macro.dbt.default__get_merge_update_columns": {"unique_id": "macro.dbt.default__get_merge_update_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "default__get_merge_update_columns", "macro_sql": "{% macro default__get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {%- set default_cols = dest_columns | map(attribute=\"quoted\") | list -%}\n\n {%- if merge_update_columns and merge_exclude_columns -%}\n {{ exceptions.raise_compiler_error(\n 'Model cannot specify merge_update_columns and merge_exclude_columns. Please update model to use only one config'\n )}}\n {%- elif merge_update_columns -%}\n {%- set update_columns = merge_update_columns -%}\n {%- elif merge_exclude_columns -%}\n {%- set update_columns = [] -%}\n {%- for column in dest_columns -%}\n {% if column.column | lower not in merge_exclude_columns | map(\"lower\") | list %}\n {%- do update_columns.append(column.quoted) -%}\n {% endif %}\n {%- endfor -%}\n {%- else -%}\n {%- set update_columns = default_cols -%}\n {%- endif -%}\n\n {{ return(update_columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.045009, "supported_languages": null}, "macro.dbt.get_merge_sql": {"unique_id": "macro.dbt.get_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, predicates=none) -%}\n {{ adapter.dispatch('get_merge_sql', 'dbt')(target, source, unique_key, dest_columns, predicates) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.049258, "supported_languages": null}, "macro.dbt.default__get_merge_sql": {"unique_id": "macro.dbt.default__get_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, predicates) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set merge_update_columns = config.get('merge_update_columns') -%}\n {%- set merge_exclude_columns = config.get('merge_exclude_columns') -%}\n {%- set update_columns = get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not mapping and unique_key is not string %}\n {% for key in unique_key %}\n {% set this_key_match %}\n DBT_INTERNAL_SOURCE.{{ key }} = DBT_INTERNAL_DEST.{{ key }}\n {% endset %}\n {% do predicates.append(this_key_match) %}\n {% endfor %}\n {% else %}\n {% set unique_key_match %}\n DBT_INTERNAL_SOURCE.{{ unique_key }} = DBT_INTERNAL_DEST.{{ unique_key }}\n {% endset %}\n {% do predicates.append(unique_key_match) %}\n {% endif %}\n {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\n\n {{ sql_header if sql_header is not none }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on {{ predicates | join(' and ') }}\n\n {% if unique_key %}\n when matched then update set\n {% for column_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv", "macro.dbt.get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.050903, "supported_languages": null}, "macro.dbt.get_delete_insert_merge_sql": {"unique_id": "macro.dbt.get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql', 'dbt')(target, source, unique_key, dest_columns) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.051156, "supported_languages": null}, "macro.dbt.default__get_delete_insert_merge_sql": {"unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not string %}\n delete from {{target }}\n using {{ source }}\n where (\n {% for key in unique_key %}\n {{ source }}.{{ key }} = {{ target }}.{{ key }}\n {{ \"and \" if not loop.last }}\n {% endfor %}\n );\n {% else %}\n delete from {{ target }}\n where (\n {{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n );\n\n {% endif %}\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.051918, "supported_languages": null}, "macro.dbt.get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql', 'dbt')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.052194, "supported_languages": null}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {#-- The only time include_sql_header is True: --#}\n {#-- BigQuery + insert_overwrite strategy + \"static\" partitions config --#}\n {#-- We should consider including the sql header at the materialization level instead --#}\n\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.052886, "supported_languages": null}, "macro.dbt.is_incremental": {"unique_id": "macro.dbt.is_incremental", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/is_incremental.sql", "original_file_path": "macros/materializations/models/incremental/is_incremental.sql", "name": "is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.053714, "supported_languages": null}, "macro.dbt.get_incremental_append_sql": {"unique_id": "macro.dbt.get_incremental_append_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_append_sql", "macro_sql": "{% macro get_incremental_append_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_append_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0546088, "supported_languages": null}, "macro.dbt.default__get_incremental_append_sql": {"unique_id": "macro.dbt.default__get_incremental_append_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_append_sql", "macro_sql": "{% macro default__get_incremental_append_sql(arg_dict) %}\n\n {% do return(get_insert_into_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_insert_into_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.054852, "supported_languages": null}, "macro.dbt.get_incremental_delete_insert_sql": {"unique_id": "macro.dbt.get_incremental_delete_insert_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_delete_insert_sql", "macro_sql": "{% macro get_incremental_delete_insert_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_delete_insert_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_delete_insert_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.055037, "supported_languages": null}, "macro.dbt.default__get_incremental_delete_insert_sql": {"unique_id": "macro.dbt.default__get_incremental_delete_insert_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_delete_insert_sql", "macro_sql": "{% macro default__get_incremental_delete_insert_sql(arg_dict) %}\n\n {% do return(get_delete_insert_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.055299, "supported_languages": null}, "macro.dbt.get_incremental_merge_sql": {"unique_id": "macro.dbt.get_incremental_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_merge_sql", "macro_sql": "{% macro get_incremental_merge_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.055501, "supported_languages": null}, "macro.dbt.default__get_incremental_merge_sql": {"unique_id": "macro.dbt.default__get_incremental_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_merge_sql", "macro_sql": "{% macro default__get_incremental_merge_sql(arg_dict) %}\n\n {% do return(get_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.055763, "supported_languages": null}, "macro.dbt.get_incremental_insert_overwrite_sql": {"unique_id": "macro.dbt.get_incremental_insert_overwrite_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_insert_overwrite_sql", "macro_sql": "{% macro get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_insert_overwrite_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_insert_overwrite_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0559502, "supported_languages": null}, "macro.dbt.default__get_incremental_insert_overwrite_sql": {"unique_id": "macro.dbt.default__get_incremental_insert_overwrite_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_insert_overwrite_sql", "macro_sql": "{% macro default__get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {% do return(get_insert_overwrite_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"], arg_dict[\"predicates\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.056229, "supported_languages": null}, "macro.dbt.get_incremental_default_sql": {"unique_id": "macro.dbt.get_incremental_default_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_default_sql", "macro_sql": "{% macro get_incremental_default_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_default_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_default_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.056422, "supported_languages": null}, "macro.dbt.default__get_incremental_default_sql": {"unique_id": "macro.dbt.default__get_incremental_default_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_default_sql", "macro_sql": "{% macro default__get_incremental_default_sql(arg_dict) %}\n\n {% do return(get_incremental_append_sql(arg_dict)) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.056573, "supported_languages": null}, "macro.dbt.get_insert_into_sql": {"unique_id": "macro.dbt.get_insert_into_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_insert_into_sql", "macro_sql": "{% macro get_insert_into_sql(target_relation, temp_relation, dest_columns) %}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ temp_relation }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.056847, "supported_languages": null}, "macro.dbt.materialization_incremental_default": {"unique_id": "macro.dbt.materialization_incremental_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/incremental.sql", "original_file_path": "macros/materializations/models/incremental/incremental.sql", "name": "materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% if existing_relation is none %}\n {% set build_sql = get_create_table_as_sql(False, target_relation, sql) %}\n {% elif full_refresh_mode %}\n {% set build_sql = get_create_table_as_sql(False, intermediate_relation, sql) %}\n {% set need_swap = true %}\n {% else %}\n {% do run_query(get_create_table_as_sql(True, temp_relation, sql)) %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set incremental_predicates = config.get('incremental_predicates', none) %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.get_create_table_as_sql", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0617669, "supported_languages": ["sql"]}, "macro.dbt.incremental_validate_on_schema_change": {"unique_id": "macro.dbt.incremental_validate_on_schema_change", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "incremental_validate_on_schema_change", "macro_sql": "{% macro incremental_validate_on_schema_change(on_schema_change, default='ignore') %}\n\n {% if on_schema_change not in ['sync_all_columns', 'append_new_columns', 'fail', 'ignore'] %}\n\n {% set log_message = 'Invalid value for on_schema_change (%s) specified. Setting default value of %s.' % (on_schema_change, default) %}\n {% do log(log_message) %}\n\n {{ return(default) }}\n\n {% else %}\n\n {{ return(on_schema_change) }}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.066952, "supported_languages": null}, "macro.dbt.check_for_schema_changes": {"unique_id": "macro.dbt.check_for_schema_changes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "check_for_schema_changes", "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n\n {% set schema_changed = False %}\n\n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n\n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n\n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.diff_columns", "macro.dbt.diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.068183, "supported_languages": null}, "macro.dbt.sync_column_schemas": {"unique_id": "macro.dbt.sync_column_schemas", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "sync_column_schemas", "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n\n {% elif on_schema_change == 'sync_all_columns' %}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n\n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n\n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n\n {% do log(schema_change_message) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.alter_relation_add_remove_columns", "macro.dbt.alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.069373, "supported_languages": null}, "macro.dbt.process_schema_changes": {"unique_id": "macro.dbt.process_schema_changes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "process_schema_changes", "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n\n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n\n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n\n {% if schema_changes_dict['schema_changed'] %}\n\n {% if on_schema_change == 'fail' %}\n\n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways:\n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n\n Additional troubleshooting context:\n Source columns not in target: {{ schema_changes_dict['source_not_in_target'] }}\n Target columns not in source: {{ schema_changes_dict['target_not_in_source'] }}\n New column types: {{ schema_changes_dict['new_target_types'] }}\n {% endset %}\n\n {% do exceptions.raise_compiler_error(fail_msg) %}\n\n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n\n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {% endif %}\n\n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0702279, "supported_languages": null}, "macro.dbt.materialization_table_default": {"unique_id": "macro.dbt.materialization_table_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/table.sql", "original_file_path": "macros/materializations/models/table/table.sql", "name": "materialization_table_default", "macro_sql": "{% materialization table, default %}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do create_indexes(target_relation) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.get_create_table_as_sql", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.072852, "supported_languages": ["sql"]}, "macro.dbt.get_create_table_as_sql": {"unique_id": "macro.dbt.get_create_table_as_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "get_create_table_as_sql", "macro_sql": "{% macro get_create_table_as_sql(temporary, relation, sql) -%}\n {{ adapter.dispatch('get_create_table_as_sql', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_table_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.07342, "supported_languages": null}, "macro.dbt.default__get_create_table_as_sql": {"unique_id": "macro.dbt.default__get_create_table_as_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "default__get_create_table_as_sql", "macro_sql": "{% macro default__get_create_table_as_sql(temporary, relation, sql) -%}\n {{ return(create_table_as(temporary, relation, sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.073607, "supported_languages": null}, "macro.dbt.create_table_as": {"unique_id": "macro.dbt.create_table_as", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {# backward compatibility for create_table_as that does not support language #}\n {% if language == \"sql\" %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code)}}\n {% else %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code, language) }}\n {% endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.074036, "supported_languages": null}, "macro.dbt.default__create_table_as": {"unique_id": "macro.dbt.default__create_table_as", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.074445, "supported_languages": null}, "macro.dbt.materialization_view_default": {"unique_id": "macro.dbt.materialization_view_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/view.sql", "original_file_path": "macros/materializations/models/view/view.sql", "name": "materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='view') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n This relation (probably) doesn't exist yet. If it does exist, it's a leftover from\n a previous run, and we're going to try to drop it immediately. At the end of this\n materialization, we're going to rename the \"existing_relation\" to this identifier,\n and then we're going to drop it. In order to make sure we run the correct one of:\n - drop view ...\n - drop table ...\n\n We need to set the type of this relation to be the type of the existing_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the existing_relation does not\n exist, then there is nothing to move out of the way and subsequentally drop. In that case,\n this relation will be effectively unused.\n */\n {%- set backup_relation_type = 'view' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0770109, "supported_languages": ["sql"]}, "macro.dbt.handle_existing_table": {"unique_id": "macro.dbt.handle_existing_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/helpers.sql", "original_file_path": "macros/materializations/models/view/helpers.sql", "name": "handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.077375, "supported_languages": null}, "macro.dbt.default__handle_existing_table": {"unique_id": "macro.dbt.default__handle_existing_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/helpers.sql", "original_file_path": "macros/materializations/models/view/helpers.sql", "name": "default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0775979, "supported_languages": null}, "macro.dbt.create_or_replace_view": {"unique_id": "macro.dbt.create_or_replace_view", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/models/view/create_or_replace_view.sql", "name": "create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {% set should_revoke = should_revoke(exists_as_view, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=True) %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0791302, "supported_languages": null}, "macro.dbt.get_create_view_as_sql": {"unique_id": "macro.dbt.get_create_view_as_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "get_create_view_as_sql", "macro_sql": "{% macro get_create_view_as_sql(relation, sql) -%}\n {{ adapter.dispatch('get_create_view_as_sql', 'dbt')(relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0795572, "supported_languages": null}, "macro.dbt.default__get_create_view_as_sql": {"unique_id": "macro.dbt.default__get_create_view_as_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "default__get_create_view_as_sql", "macro_sql": "{% macro default__get_create_view_as_sql(relation, sql) -%}\n {{ return(create_view_as(relation, sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0797162, "supported_languages": null}, "macro.dbt.create_view_as": {"unique_id": "macro.dbt.create_view_as", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0799072, "supported_languages": null}, "macro.dbt.default__create_view_as": {"unique_id": "macro.dbt.default__create_view_as", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation }} as (\n {{ sql }}\n );\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0801668, "supported_languages": null}, "macro.dbt.materialization_seed_default": {"unique_id": "macro.dbt.materialization_seed_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/seed.sql", "original_file_path": "macros/materializations/seeds/seed.sql", "name": "materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set grant_config = config.get('grants') -%}\n {%- set agate_table = load_agate_table() -%}\n -- grab current tables grants config for comparision later on\n\n {%- do store_result('agate_table', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation)) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', code ~ ' ' ~ rows_affected, code, rows_affected) %}\n {{ get_csv_sql(create_table_sql, sql) }};\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if full_refresh_mode or not exists_as_table %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.run_hooks", "macro.dbt.reset_csv_table", "macro.dbt.create_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.noop_statement", "macro.dbt.get_csv_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.083461, "supported_languages": ["sql"]}, "macro.dbt.create_csv_table": {"unique_id": "macro.dbt.create_csv_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.088067, "supported_languages": null}, "macro.dbt.default__create_csv_table": {"unique_id": "macro.dbt.default__create_csv_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.088973, "supported_languages": null}, "macro.dbt.reset_csv_table": {"unique_id": "macro.dbt.reset_csv_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table', 'dbt')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.089211, "supported_languages": null}, "macro.dbt.default__reset_csv_table": {"unique_id": "macro.dbt.default__reset_csv_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.089685, "supported_languages": null}, "macro.dbt.get_csv_sql": {"unique_id": "macro.dbt.get_csv_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_csv_sql", "macro_sql": "{% macro get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ adapter.dispatch('get_csv_sql', 'dbt')(create_or_truncate_sql, insert_sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_csv_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.089875, "supported_languages": null}, "macro.dbt.default__get_csv_sql": {"unique_id": "macro.dbt.default__get_csv_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_csv_sql", "macro_sql": "{% macro default__get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ create_or_truncate_sql }};\n -- dbt seed --\n {{ insert_sql }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.090005, "supported_languages": null}, "macro.dbt.get_binding_char": {"unique_id": "macro.dbt.get_binding_char", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_binding_char", "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.090144, "supported_languages": null}, "macro.dbt.default__get_binding_char": {"unique_id": "macro.dbt.default__get_binding_char", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_binding_char", "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.090255, "supported_languages": null}, "macro.dbt.get_batch_size": {"unique_id": "macro.dbt.get_batch_size", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_batch_size", "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_batch_size"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.090414, "supported_languages": null}, "macro.dbt.default__get_batch_size": {"unique_id": "macro.dbt.default__get_batch_size", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_batch_size", "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0905259, "supported_languages": null}, "macro.dbt.get_seed_column_quoted_csv": {"unique_id": "macro.dbt.get_seed_column_quoted_csv", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0909991, "supported_languages": null}, "macro.dbt.load_csv_rows": {"unique_id": "macro.dbt.load_csv_rows", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0911841, "supported_languages": null}, "macro.dbt.default__load_csv_rows": {"unique_id": "macro.dbt.default__load_csv_rows", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n\n {% set batch_size = get_batch_size() %}\n\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.092461, "supported_languages": null}, "macro.dbt.generate_alias_name": {"unique_id": "macro.dbt.generate_alias_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "name": "generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_alias_name', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_alias_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.092959, "supported_languages": null}, "macro.dbt.default__generate_alias_name": {"unique_id": "macro.dbt.default__generate_alias_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "name": "default__generate_alias_name", "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name is none -%}\n\n {{ node.name }}\n\n {%- else -%}\n\n {{ custom_alias_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.093191, "supported_languages": null}, "macro.dbt.generate_schema_name": {"unique_id": "macro.dbt.generate_schema_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name=none, node=none) -%}\n {{ return(adapter.dispatch('generate_schema_name', 'dbt')(custom_schema_name, node)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.093767, "supported_languages": null}, "macro.dbt.default__generate_schema_name": {"unique_id": "macro.dbt.default__generate_schema_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.094024, "supported_languages": null}, "macro.dbt.generate_schema_name_for_env": {"unique_id": "macro.dbt.generate_schema_name_for_env", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.094309, "supported_languages": null}, "macro.dbt.generate_database_name": {"unique_id": "macro.dbt.generate_database_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "name": "generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name', 'dbt')(custom_database_name, node)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0947552, "supported_languages": null}, "macro.dbt.default__generate_database_name": {"unique_id": "macro.dbt.default__generate_database_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "name": "default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.095005, "supported_languages": null}, "macro.dbt.default__test_relationships": {"unique_id": "macro.dbt.default__test_relationships", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/relationships.sql", "original_file_path": "macros/generic_test_sql/relationships.sql", "name": "default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.095413, "supported_languages": null}, "macro.dbt.default__test_not_null": {"unique_id": "macro.dbt.default__test_not_null", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/not_null.sql", "original_file_path": "macros/generic_test_sql/not_null.sql", "name": "default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else column_name %}\n\nselect {{ column_list }}\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.095766, "supported_languages": null}, "macro.dbt.default__test_unique": {"unique_id": "macro.dbt.default__test_unique", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/unique.sql", "original_file_path": "macros/generic_test_sql/unique.sql", "name": "default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0960681, "supported_languages": null}, "macro.dbt.default__test_accepted_values": {"unique_id": "macro.dbt.default__test_accepted_values", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/accepted_values.sql", "original_file_path": "macros/generic_test_sql/accepted_values.sql", "name": "default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by {{ column_name }}\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.096673, "supported_languages": null}, "macro.dbt.statement": {"unique_id": "macro.dbt.statement", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "statement", "macro_sql": "\n{%- macro statement(name=None, fetch_result=False, auto_begin=True, language='sql') -%}\n {%- if execute: -%}\n {%- set compiled_code = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime {} for node \"{}\"'.format(language, model['unique_id'])) }}\n {{ write(compiled_code) }}\n {%- endif -%}\n {%- if language == 'sql'-%}\n {%- set res, table = adapter.execute(compiled_code, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- elif language == 'python' -%}\n {%- set res = submit_python_job(model, compiled_code) -%}\n {#-- TODO: What should table be for python models? --#}\n {%- set table = None -%}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"statement macro didn't get supported language\") %}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0981781, "supported_languages": null}, "macro.dbt.noop_statement": {"unique_id": "macro.dbt.noop_statement", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.099005, "supported_languages": null}, "macro.dbt.run_query": {"unique_id": "macro.dbt.run_query", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.099298, "supported_languages": null}, "macro.dbt.convert_datetime": {"unique_id": "macro.dbt.convert_datetime", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "convert_datetime", "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.101067, "supported_languages": null}, "macro.dbt.dates_in_range": {"unique_id": "macro.dbt.dates_in_range", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "dates_in_range", "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n Partiton start date is after the end date ({{ start_date }}, {{ end_date }})\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg, model) }}\n {% endif %}\n\n {% set date_list = [] %}\n {% for i in range(0, day_count + 1) %}\n {% set the_date = (modules.datetime.timedelta(days=i) + start_date) %}\n {% if not out_fmt %}\n {% set _ = date_list.append(the_date) %}\n {% else %}\n {% set _ = date_list.append(the_date.strftime(out_fmt)) %}\n {% endif %}\n {% endfor %}\n\n {{ return(date_list) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1022441, "supported_languages": null}, "macro.dbt.partition_range": {"unique_id": "macro.dbt.partition_range", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "partition_range", "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.102987, "supported_languages": null}, "macro.dbt.py_current_timestring": {"unique_id": "macro.dbt.py_current_timestring", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "py_current_timestring", "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.103219, "supported_languages": null}, "macro.dbt.except": {"unique_id": "macro.dbt.except", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "name": "except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1035311, "supported_languages": null}, "macro.dbt.default__except": {"unique_id": "macro.dbt.default__except", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "name": "default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.103606, "supported_languages": null}, "macro.dbt.replace": {"unique_id": "macro.dbt.replace", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "name": "replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt') (field, old_chars, new_chars)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.103992, "supported_languages": null}, "macro.dbt.default__replace": {"unique_id": "macro.dbt.default__replace", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "name": "default__replace", "macro_sql": "{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.104156, "supported_languages": null}, "macro.dbt.concat": {"unique_id": "macro.dbt.concat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "name": "concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt')(fields)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.104463, "supported_languages": null}, "macro.dbt.default__concat": {"unique_id": "macro.dbt.default__concat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "name": "default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n {{ fields|join(' || ') }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.104588, "supported_languages": null}, "macro.dbt.length": {"unique_id": "macro.dbt.length", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "name": "length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__length"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.104896, "supported_languages": null}, "macro.dbt.default__length": {"unique_id": "macro.dbt.default__length", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "name": "default__length", "macro_sql": "{% macro default__length(expression) %}\n\n length(\n {{ expression }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.105003, "supported_languages": null}, "macro.dbt.dateadd": {"unique_id": "macro.dbt.dateadd", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "name": "dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1053922, "supported_languages": null}, "macro.dbt.default__dateadd": {"unique_id": "macro.dbt.default__dateadd", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "name": "default__dateadd", "macro_sql": "{% macro default__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_date_or_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.105552, "supported_languages": null}, "macro.dbt.intersect": {"unique_id": "macro.dbt.intersect", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "name": "intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__intersect"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.105834, "supported_languages": null}, "macro.dbt.default__intersect": {"unique_id": "macro.dbt.default__intersect", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "name": "default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.105912, "supported_languages": null}, "macro.dbt.escape_single_quotes": {"unique_id": "macro.dbt.escape_single_quotes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "name": "escape_single_quotes", "macro_sql": "{% macro escape_single_quotes(expression) %}\n {{ return(adapter.dispatch('escape_single_quotes', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__escape_single_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.106264, "supported_languages": null}, "macro.dbt.default__escape_single_quotes": {"unique_id": "macro.dbt.default__escape_single_quotes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "name": "default__escape_single_quotes", "macro_sql": "{% macro default__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\",\"''\") }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.106403, "supported_languages": null}, "macro.dbt.right": {"unique_id": "macro.dbt.right", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "name": "right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt') (string_text, length_expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__right"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.106755, "supported_languages": null}, "macro.dbt.default__right": {"unique_id": "macro.dbt.default__right", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "name": "default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.10697, "supported_languages": null}, "macro.dbt.listagg": {"unique_id": "macro.dbt.listagg", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "name": "listagg", "macro_sql": "{% macro listagg(measure, delimiter_text=\"','\", order_by_clause=none, limit_num=none) -%}\n {{ return(adapter.dispatch('listagg', 'dbt') (measure, delimiter_text, order_by_clause, limit_num)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__listagg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1076438, "supported_languages": null}, "macro.dbt.default__listagg": {"unique_id": "macro.dbt.default__listagg", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "name": "default__listagg", "macro_sql": "{% macro default__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n array_slice(\n array_agg(\n {{ measure }}\n ){% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n ,0\n ,{{ limit_num }}\n ),\n {{ delimiter_text }}\n )\n {%- else %}\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1080441, "supported_languages": null}, "macro.dbt.datediff": {"unique_id": "macro.dbt.datediff", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "name": "datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt')(first_date, second_date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1084318, "supported_languages": null}, "macro.dbt.default__datediff": {"unique_id": "macro.dbt.default__datediff", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "name": "default__datediff", "macro_sql": "{% macro default__datediff(first_date, second_date, datepart) -%}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.108594, "supported_languages": null}, "macro.dbt.safe_cast": {"unique_id": "macro.dbt.safe_cast", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "name": "safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt') (field, type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.108938, "supported_languages": null}, "macro.dbt.default__safe_cast": {"unique_id": "macro.dbt.default__safe_cast", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "name": "default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1090748, "supported_languages": null}, "macro.dbt.hash": {"unique_id": "macro.dbt.hash", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "name": "hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt') (field)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.109387, "supported_languages": null}, "macro.dbt.default__hash": {"unique_id": "macro.dbt.default__hash", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "name": "default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{ field }} as {{ api.Column.translate_type('string') }}))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.109544, "supported_languages": null}, "macro.dbt.cast_bool_to_text": {"unique_id": "macro.dbt.cast_bool_to_text", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "name": "cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', 'dbt') (field) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.109851, "supported_languages": null}, "macro.dbt.default__cast_bool_to_text": {"unique_id": "macro.dbt.default__cast_bool_to_text", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "name": "default__cast_bool_to_text", "macro_sql": "{% macro default__cast_bool_to_text(field) %}\n cast({{ field }} as {{ api.Column.translate_type('string') }})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.110018, "supported_languages": null}, "macro.dbt.any_value": {"unique_id": "macro.dbt.any_value", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "name": "any_value", "macro_sql": "{% macro any_value(expression) -%}\n {{ return(adapter.dispatch('any_value', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__any_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.11034, "supported_languages": null}, "macro.dbt.default__any_value": {"unique_id": "macro.dbt.default__any_value", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "name": "default__any_value", "macro_sql": "{% macro default__any_value(expression) -%}\n\n any_value({{ expression }})\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1104488, "supported_languages": null}, "macro.dbt.position": {"unique_id": "macro.dbt.position", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "name": "position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt') (substring_text, string_text)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__position"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1107981, "supported_languages": null}, "macro.dbt.default__position": {"unique_id": "macro.dbt.default__position", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "name": "default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.110938, "supported_languages": null}, "macro.dbt.string_literal": {"unique_id": "macro.dbt.string_literal", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "name": "string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt') (value)) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1112409, "supported_languages": null}, "macro.dbt.default__string_literal": {"unique_id": "macro.dbt.default__string_literal", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "name": "default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1113422, "supported_languages": null}, "macro.dbt.type_string": {"unique_id": "macro.dbt.type_string", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.112293, "supported_languages": null}, "macro.dbt.default__type_string": {"unique_id": "macro.dbt.default__type_string", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_string", "macro_sql": "{% macro default__type_string() %}\n {{ return(api.Column.translate_type(\"string\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.112458, "supported_languages": null}, "macro.dbt.type_timestamp": {"unique_id": "macro.dbt.type_timestamp", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.112695, "supported_languages": null}, "macro.dbt.default__type_timestamp": {"unique_id": "macro.dbt.default__type_timestamp", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n {{ return(api.Column.translate_type(\"timestamp\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.112849, "supported_languages": null}, "macro.dbt.type_float": {"unique_id": "macro.dbt.type_float", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.113012, "supported_languages": null}, "macro.dbt.default__type_float": {"unique_id": "macro.dbt.default__type_float", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_float", "macro_sql": "{% macro default__type_float() %}\n {{ return(api.Column.translate_type(\"float\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.113162, "supported_languages": null}, "macro.dbt.type_numeric": {"unique_id": "macro.dbt.type_numeric", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.113321, "supported_languages": null}, "macro.dbt.default__type_numeric": {"unique_id": "macro.dbt.default__type_numeric", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n {{ return(api.Column.numeric_type(\"numeric\", 28, 6)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.113497, "supported_languages": null}, "macro.dbt.type_bigint": {"unique_id": "macro.dbt.type_bigint", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.113656, "supported_languages": null}, "macro.dbt.default__type_bigint": {"unique_id": "macro.dbt.default__type_bigint", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n {{ return(api.Column.translate_type(\"bigint\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.113806, "supported_languages": null}, "macro.dbt.type_int": {"unique_id": "macro.dbt.type_int", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.113974, "supported_languages": null}, "macro.dbt.default__type_int": {"unique_id": "macro.dbt.default__type_int", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_int", "macro_sql": "{%- macro default__type_int() -%}\n {{ return(api.Column.translate_type(\"integer\")) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1141179, "supported_languages": null}, "macro.dbt.type_boolean": {"unique_id": "macro.dbt.type_boolean", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_boolean", "macro_sql": "\n\n{%- macro type_boolean() -%}\n {{ return(adapter.dispatch('type_boolean', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_boolean"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1142762, "supported_languages": null}, "macro.dbt.default__type_boolean": {"unique_id": "macro.dbt.default__type_boolean", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_boolean", "macro_sql": "{%- macro default__type_boolean() -%}\n {{ return(api.Column.translate_type(\"boolean\")) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.114421, "supported_languages": null}, "macro.dbt.array_concat": {"unique_id": "macro.dbt.array_concat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "name": "array_concat", "macro_sql": "{% macro array_concat(array_1, array_2) -%}\n {{ return(adapter.dispatch('array_concat', 'dbt')(array_1, array_2)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__array_concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.114771, "supported_languages": null}, "macro.dbt.default__array_concat": {"unique_id": "macro.dbt.default__array_concat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "name": "default__array_concat", "macro_sql": "{% macro default__array_concat(array_1, array_2) -%}\n array_cat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.114905, "supported_languages": null}, "macro.dbt.bool_or": {"unique_id": "macro.dbt.bool_or", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "name": "bool_or", "macro_sql": "{% macro bool_or(expression) -%}\n {{ return(adapter.dispatch('bool_or', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__bool_or"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.115211, "supported_languages": null}, "macro.dbt.default__bool_or": {"unique_id": "macro.dbt.default__bool_or", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "name": "default__bool_or", "macro_sql": "{% macro default__bool_or(expression) -%}\n\n bool_or({{ expression }})\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.115315, "supported_languages": null}, "macro.dbt.last_day": {"unique_id": "macro.dbt.last_day", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "name": "last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt') (date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.115701, "supported_languages": null}, "macro.dbt.default_last_day": {"unique_id": "macro.dbt.default_last_day", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "name": "default_last_day", "macro_sql": "\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd(datepart, '1', dbt.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.115971, "supported_languages": null}, "macro.dbt.default__last_day": {"unique_id": "macro.dbt.default__last_day", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "name": "default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt.default_last_day(date, datepart)}}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1161191, "supported_languages": null}, "macro.dbt.split_part": {"unique_id": "macro.dbt.split_part", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "name": "split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ return(adapter.dispatch('split_part', 'dbt') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.11668, "supported_languages": null}, "macro.dbt.default__split_part": {"unique_id": "macro.dbt.default__split_part", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "name": "default__split_part", "macro_sql": "{% macro default__split_part(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n {{ part_number }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.116841, "supported_languages": null}, "macro.dbt._split_part_negative": {"unique_id": "macro.dbt._split_part_negative", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "name": "_split_part_negative", "macro_sql": "{% macro _split_part_negative(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n length({{ string_text }})\n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 2 {{ part_number }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.117135, "supported_languages": null}, "macro.dbt.date_trunc": {"unique_id": "macro.dbt.date_trunc", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "name": "date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt') (datepart, date)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.117465, "supported_languages": null}, "macro.dbt.default__date_trunc": {"unique_id": "macro.dbt.default__date_trunc", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "name": "default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) -%}\n date_trunc('{{datepart}}', {{date}})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.117596, "supported_languages": null}, "macro.dbt.array_construct": {"unique_id": "macro.dbt.array_construct", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "name": "array_construct", "macro_sql": "{% macro array_construct(inputs=[], data_type=api.Column.translate_type('integer')) -%}\n {{ return(adapter.dispatch('array_construct', 'dbt')(inputs, data_type)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__array_construct"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.118021, "supported_languages": null}, "macro.dbt.default__array_construct": {"unique_id": "macro.dbt.default__array_construct", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "name": "default__array_construct", "macro_sql": "{% macro default__array_construct(inputs, data_type) -%}\n {% if inputs|length > 0 %}\n array[ {{ inputs|join(' , ') }} ]\n {% else %}\n array[]::{{data_type}}[]\n {% endif %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1182709, "supported_languages": null}, "macro.dbt.array_append": {"unique_id": "macro.dbt.array_append", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "name": "array_append", "macro_sql": "{% macro array_append(array, new_element) -%}\n {{ return(adapter.dispatch('array_append', 'dbt')(array, new_element)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__array_append"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.11861, "supported_languages": null}, "macro.dbt.default__array_append": {"unique_id": "macro.dbt.default__array_append", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "name": "default__array_append", "macro_sql": "{% macro default__array_append(array, new_element) -%}\n array_append({{ array }}, {{ new_element }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.118743, "supported_languages": null}, "macro.dbt.create_schema": {"unique_id": "macro.dbt.create_schema", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema', 'dbt')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.119167, "supported_languages": null}, "macro.dbt.default__create_schema": {"unique_id": "macro.dbt.default__create_schema", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.11935, "supported_languages": null}, "macro.dbt.drop_schema": {"unique_id": "macro.dbt.drop_schema", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.119512, "supported_languages": null}, "macro.dbt.default__drop_schema": {"unique_id": "macro.dbt.default__drop_schema", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.119694, "supported_languages": null}, "macro.dbt.current_timestamp": {"unique_id": "macro.dbt.current_timestamp", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "current_timestamp", "macro_sql": "{%- macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.12021, "supported_languages": null}, "macro.dbt.default__current_timestamp": {"unique_id": "macro.dbt.default__current_timestamp", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter ' + adapter.type()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.120359, "supported_languages": null}, "macro.dbt.snapshot_get_time": {"unique_id": "macro.dbt.snapshot_get_time", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "snapshot_get_time", "macro_sql": "\n\n{%- macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.120497, "supported_languages": null}, "macro.dbt.default__snapshot_get_time": {"unique_id": "macro.dbt.default__snapshot_get_time", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() %}\n {{ current_timestamp() }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.120598, "supported_languages": null}, "macro.dbt.current_timestamp_backcompat": {"unique_id": "macro.dbt.current_timestamp_backcompat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "current_timestamp_backcompat", "macro_sql": "{% macro current_timestamp_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.120766, "supported_languages": null}, "macro.dbt.default__current_timestamp_backcompat": {"unique_id": "macro.dbt.default__current_timestamp_backcompat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "default__current_timestamp_backcompat", "macro_sql": "{% macro default__current_timestamp_backcompat() %}\n current_timestamp::timestamp\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.120842, "supported_languages": null}, "macro.dbt.current_timestamp_in_utc_backcompat": {"unique_id": "macro.dbt.current_timestamp_in_utc_backcompat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "current_timestamp_in_utc_backcompat", "macro_sql": "{% macro current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_in_utc_backcompat', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__current_timestamp_in_utc_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1210098, "supported_languages": null}, "macro.dbt.default__current_timestamp_in_utc_backcompat": {"unique_id": "macro.dbt.default__current_timestamp_in_utc_backcompat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "default__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro default__current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt_bigquery.bigquery__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.121172, "supported_languages": null}, "macro.dbt.get_create_index_sql": {"unique_id": "macro.dbt.get_create_index_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.121669, "supported_languages": null}, "macro.dbt.default__get_create_index_sql": {"unique_id": "macro.dbt.default__get_create_index_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.121871, "supported_languages": null}, "macro.dbt.create_indexes": {"unique_id": "macro.dbt.create_indexes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes', 'dbt')(relation) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.122029, "supported_languages": null}, "macro.dbt.default__create_indexes": {"unique_id": "macro.dbt.default__create_indexes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.122426, "supported_languages": null}, "macro.dbt.make_intermediate_relation": {"unique_id": "macro.dbt.make_intermediate_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "make_intermediate_relation", "macro_sql": "{% macro make_intermediate_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_intermediate_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_intermediate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.125529, "supported_languages": null}, "macro.dbt.default__make_intermediate_relation": {"unique_id": "macro.dbt.default__make_intermediate_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__make_intermediate_relation", "macro_sql": "{% macro default__make_intermediate_relation(base_relation, suffix) %}\n {{ return(default__make_temp_relation(base_relation, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.125699, "supported_languages": null}, "macro.dbt.make_temp_relation": {"unique_id": "macro.dbt.make_temp_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.125918, "supported_languages": null}, "macro.dbt.default__make_temp_relation": {"unique_id": "macro.dbt.default__make_temp_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {%- set temp_identifier = base_relation.identifier ~ suffix -%}\n {%- set temp_relation = base_relation.incorporate(\n path={\"identifier\": temp_identifier}) -%}\n\n {{ return(temp_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.126215, "supported_languages": null}, "macro.dbt.make_backup_relation": {"unique_id": "macro.dbt.make_backup_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "make_backup_relation", "macro_sql": "{% macro make_backup_relation(base_relation, backup_relation_type, suffix='__dbt_backup') %}\n {{ return(adapter.dispatch('make_backup_relation', 'dbt')(base_relation, backup_relation_type, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_backup_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.126464, "supported_languages": null}, "macro.dbt.default__make_backup_relation": {"unique_id": "macro.dbt.default__make_backup_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__make_backup_relation", "macro_sql": "{% macro default__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {%- set backup_identifier = base_relation.identifier ~ suffix -%}\n {%- set backup_relation = base_relation.incorporate(\n path={\"identifier\": backup_identifier},\n type=backup_relation_type\n ) -%}\n {{ return(backup_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1267982, "supported_languages": null}, "macro.dbt.drop_relation": {"unique_id": "macro.dbt.drop_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.126982, "supported_languages": null}, "macro.dbt.default__drop_relation": {"unique_id": "macro.dbt.default__drop_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__drop_relation", "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.127193, "supported_languages": null}, "macro.dbt.truncate_relation": {"unique_id": "macro.dbt.truncate_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1273768, "supported_languages": null}, "macro.dbt.default__truncate_relation": {"unique_id": "macro.dbt.default__truncate_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.127535, "supported_languages": null}, "macro.dbt.rename_relation": {"unique_id": "macro.dbt.rename_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.127754, "supported_languages": null}, "macro.dbt.default__rename_relation": {"unique_id": "macro.dbt.default__rename_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.128028, "supported_languages": null}, "macro.dbt.get_or_create_relation": {"unique_id": "macro.dbt.get_or_create_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) -%}\n {{ return(adapter.dispatch('get_or_create_relation', 'dbt')(database, schema, identifier, type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_or_create_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.128281, "supported_languages": null}, "macro.dbt.default__get_or_create_relation": {"unique_id": "macro.dbt.default__get_or_create_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__get_or_create_relation", "macro_sql": "{% macro default__get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.12884, "supported_languages": null}, "macro.dbt.load_cached_relation": {"unique_id": "macro.dbt.load_cached_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "load_cached_relation", "macro_sql": "{% macro load_cached_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1291342, "supported_languages": null}, "macro.dbt.load_relation": {"unique_id": "macro.dbt.load_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {{ return(load_cached_relation(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.129277, "supported_languages": null}, "macro.dbt.drop_relation_if_exists": {"unique_id": "macro.dbt.drop_relation_if_exists", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1294699, "supported_languages": null}, "macro.dbt.collect_freshness": {"unique_id": "macro.dbt.collect_freshness", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness', 'dbt')(source, loaded_at_field, filter))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1299992, "supported_languages": null}, "macro.dbt.default__collect_freshness": {"unique_id": "macro.dbt.default__collect_freshness", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.130422, "supported_languages": null}, "macro.dbt.copy_grants": {"unique_id": "macro.dbt.copy_grants", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "copy_grants", "macro_sql": "{% macro copy_grants() %}\n {{ return(adapter.dispatch('copy_grants', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.132066, "supported_languages": null}, "macro.dbt.default__copy_grants": {"unique_id": "macro.dbt.default__copy_grants", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__copy_grants", "macro_sql": "{% macro default__copy_grants() %}\n {{ return(True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.132181, "supported_languages": null}, "macro.dbt.support_multiple_grantees_per_dcl_statement": {"unique_id": "macro.dbt.support_multiple_grantees_per_dcl_statement", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "support_multiple_grantees_per_dcl_statement", "macro_sql": "{% macro support_multiple_grantees_per_dcl_statement() %}\n {{ return(adapter.dispatch('support_multiple_grantees_per_dcl_statement', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.13235, "supported_languages": null}, "macro.dbt.default__support_multiple_grantees_per_dcl_statement": {"unique_id": "macro.dbt.default__support_multiple_grantees_per_dcl_statement", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__support_multiple_grantees_per_dcl_statement", "macro_sql": "\n\n{%- macro default__support_multiple_grantees_per_dcl_statement() -%}\n {{ return(True) }}\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.13246, "supported_languages": null}, "macro.dbt.should_revoke": {"unique_id": "macro.dbt.should_revoke", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "should_revoke", "macro_sql": "{% macro should_revoke(existing_relation, full_refresh_mode=True) %}\n\n {% if not existing_relation %}\n {#-- The table doesn't already exist, so no grants to copy over --#}\n {{ return(False) }}\n {% elif full_refresh_mode %}\n {#-- The object is being REPLACED -- whether grants are copied over depends on the value of user config --#}\n {{ return(copy_grants()) }}\n {% else %}\n {#-- The table is being merged/upserted/inserted -- grants will be carried over --#}\n {{ return(True) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1328099, "supported_languages": null}, "macro.dbt.get_show_grant_sql": {"unique_id": "macro.dbt.get_show_grant_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_show_grant_sql", "macro_sql": "{% macro get_show_grant_sql(relation) %}\n {{ return(adapter.dispatch(\"get_show_grant_sql\", \"dbt\")(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_show_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.132997, "supported_languages": null}, "macro.dbt.default__get_show_grant_sql": {"unique_id": "macro.dbt.default__get_show_grant_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_show_grant_sql", "macro_sql": "{% macro default__get_show_grant_sql(relation) %}\n show grants on {{ relation }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.133096, "supported_languages": null}, "macro.dbt.get_grant_sql": {"unique_id": "macro.dbt.get_grant_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_grant_sql", "macro_sql": "{% macro get_grant_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_grant_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.133316, "supported_languages": null}, "macro.dbt.default__get_grant_sql": {"unique_id": "macro.dbt.default__get_grant_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_grant_sql", "macro_sql": "\n\n{%- macro default__get_grant_sql(relation, privilege, grantees) -%}\n grant {{ privilege }} on {{ relation }} to {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.133504, "supported_languages": null}, "macro.dbt.get_revoke_sql": {"unique_id": "macro.dbt.get_revoke_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_revoke_sql", "macro_sql": "{% macro get_revoke_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_revoke_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_revoke_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.133727, "supported_languages": null}, "macro.dbt.default__get_revoke_sql": {"unique_id": "macro.dbt.default__get_revoke_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_revoke_sql", "macro_sql": "\n\n{%- macro default__get_revoke_sql(relation, privilege, grantees) -%}\n revoke {{ privilege }} on {{ relation }} from {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.133914, "supported_languages": null}, "macro.dbt.get_dcl_statement_list": {"unique_id": "macro.dbt.get_dcl_statement_list", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_dcl_statement_list", "macro_sql": "{% macro get_dcl_statement_list(relation, grant_config, get_dcl_macro) %}\n {{ return(adapter.dispatch('get_dcl_statement_list', 'dbt')(relation, grant_config, get_dcl_macro)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_dcl_statement_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1341372, "supported_languages": null}, "macro.dbt.default__get_dcl_statement_list": {"unique_id": "macro.dbt.default__get_dcl_statement_list", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_dcl_statement_list", "macro_sql": "\n\n{%- macro default__get_dcl_statement_list(relation, grant_config, get_dcl_macro) -%}\n {#\n -- Unpack grant_config into specific privileges and the set of users who need them granted/revoked.\n -- Depending on whether this database supports multiple grantees per statement, pass in the list of\n -- all grantees per privilege, or (if not) template one statement per privilege-grantee pair.\n -- `get_dcl_macro` will be either `get_grant_sql` or `get_revoke_sql`\n #}\n {%- set dcl_statements = [] -%}\n {%- for privilege, grantees in grant_config.items() %}\n {%- if support_multiple_grantees_per_dcl_statement() and grantees -%}\n {%- set dcl = get_dcl_macro(relation, privilege, grantees) -%}\n {%- do dcl_statements.append(dcl) -%}\n {%- else -%}\n {%- for grantee in grantees -%}\n {% set dcl = get_dcl_macro(relation, privilege, [grantee]) %}\n {%- do dcl_statements.append(dcl) -%}\n {% endfor -%}\n {%- endif -%}\n {%- endfor -%}\n {{ return(dcl_statements) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.134822, "supported_languages": null}, "macro.dbt.call_dcl_statements": {"unique_id": "macro.dbt.call_dcl_statements", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "call_dcl_statements", "macro_sql": "{% macro call_dcl_statements(dcl_statement_list) %}\n {{ return(adapter.dispatch(\"call_dcl_statements\", \"dbt\")(dcl_statement_list)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.135085, "supported_languages": null}, "macro.dbt.default__call_dcl_statements": {"unique_id": "macro.dbt.default__call_dcl_statements", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__call_dcl_statements", "macro_sql": "{% macro default__call_dcl_statements(dcl_statement_list) %}\n {#\n -- By default, supply all grant + revoke statements in a single semicolon-separated block,\n -- so that they're all processed together.\n\n -- Some databases do not support this. Those adapters will need to override this macro\n -- to run each statement individually.\n #}\n {% call statement('grants') %}\n {% for dcl_statement in dcl_statement_list %}\n {{ dcl_statement }};\n {% endfor %}\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.135329, "supported_languages": null}, "macro.dbt.apply_grants": {"unique_id": "macro.dbt.apply_grants", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "apply_grants", "macro_sql": "{% macro apply_grants(relation, grant_config, should_revoke) %}\n {{ return(adapter.dispatch(\"apply_grants\", \"dbt\")(relation, grant_config, should_revoke)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1355588, "supported_languages": null}, "macro.dbt.default__apply_grants": {"unique_id": "macro.dbt.default__apply_grants", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__apply_grants", "macro_sql": "{% macro default__apply_grants(relation, grant_config, should_revoke=True) %}\n {#-- If grant_config is {} or None, this is a no-op --#}\n {% if grant_config %}\n {% if should_revoke %}\n {#-- We think previous grants may have carried over --#}\n {#-- Show current grants and calculate diffs --#}\n {% set current_grants_table = run_query(get_show_grant_sql(relation)) %}\n {% set current_grants_dict = adapter.standardize_grants_dict(current_grants_table) %}\n {% set needs_granting = diff_of_two_dicts(grant_config, current_grants_dict) %}\n {% set needs_revoking = diff_of_two_dicts(current_grants_dict, grant_config) %}\n {% if not (needs_granting or needs_revoking) %}\n {{ log('On ' ~ relation ~': All grants are in place, no revocation or granting needed.')}}\n {% endif %}\n {% else %}\n {#-- We don't think there's any chance of previous grants having carried over. --#}\n {#-- Jump straight to granting what the user has configured. --#}\n {% set needs_revoking = {} %}\n {% set needs_granting = grant_config %}\n {% endif %}\n {% if needs_granting or needs_revoking %}\n {% set revoke_statement_list = get_dcl_statement_list(relation, needs_revoking, get_revoke_sql) %}\n {% set grant_statement_list = get_dcl_statement_list(relation, needs_granting, get_grant_sql) %}\n {% set dcl_statement_list = revoke_statement_list + grant_statement_list %}\n {% if dcl_statement_list %}\n {{ call_dcl_statements(dcl_statement_list) }}\n {% endif %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_grant_sql", "macro.dbt.get_dcl_statement_list", "macro.dbt.call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.136693, "supported_languages": null}, "macro.dbt.alter_column_comment": {"unique_id": "macro.dbt.alter_column_comment", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment', 'dbt')(relation, column_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.137441, "supported_languages": null}, "macro.dbt.default__alter_column_comment": {"unique_id": "macro.dbt.default__alter_column_comment", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.137613, "supported_languages": null}, "macro.dbt.alter_relation_comment": {"unique_id": "macro.dbt.alter_relation_comment", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment', 'dbt')(relation, relation_comment)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1378188, "supported_languages": null}, "macro.dbt.default__alter_relation_comment": {"unique_id": "macro.dbt.default__alter_relation_comment", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.137985, "supported_languages": null}, "macro.dbt.persist_docs": {"unique_id": "macro.dbt.persist_docs", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs', 'dbt')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1382499, "supported_languages": null}, "macro.dbt.default__persist_docs": {"unique_id": "macro.dbt.default__persist_docs", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do run_query(alter_column_comment(relation, model.columns)) %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.138732, "supported_languages": null}, "macro.dbt.get_catalog": {"unique_id": "macro.dbt.get_catalog", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.140179, "supported_languages": null}, "macro.dbt.default__get_catalog": {"unique_id": "macro.dbt.default__get_catalog", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1404421, "supported_languages": null}, "macro.dbt.information_schema_name": {"unique_id": "macro.dbt.information_schema_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.140627, "supported_languages": null}, "macro.dbt.default__information_schema_name": {"unique_id": "macro.dbt.default__information_schema_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.140784, "supported_languages": null}, "macro.dbt.list_schemas": {"unique_id": "macro.dbt.list_schemas", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.14096, "supported_languages": null}, "macro.dbt.default__list_schemas": {"unique_id": "macro.dbt.default__list_schemas", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1412039, "supported_languages": null}, "macro.dbt.check_schema_exists": {"unique_id": "macro.dbt.check_schema_exists", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists', 'dbt')(information_schema, schema)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.141411, "supported_languages": null}, "macro.dbt.default__check_schema_exists": {"unique_id": "macro.dbt.default__check_schema_exists", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.141707, "supported_languages": null}, "macro.dbt.list_relations_without_caching": {"unique_id": "macro.dbt.list_relations_without_caching", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1418948, "supported_languages": null}, "macro.dbt.default__list_relations_without_caching": {"unique_id": "macro.dbt.default__list_relations_without_caching", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.142058, "supported_languages": null}, "macro.dbt.get_columns_in_relation": {"unique_id": "macro.dbt.get_columns_in_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1437042, "supported_languages": null}, "macro.dbt.default__get_columns_in_relation": {"unique_id": "macro.dbt.default__get_columns_in_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1439412, "supported_languages": null}, "macro.dbt.sql_convert_columns_in_relation": {"unique_id": "macro.dbt.sql_convert_columns_in_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.144257, "supported_languages": null}, "macro.dbt.get_columns_in_query": {"unique_id": "macro.dbt.get_columns_in_query", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1444402, "supported_languages": null}, "macro.dbt.default__get_columns_in_query": {"unique_id": "macro.dbt.default__get_columns_in_query", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.14478, "supported_languages": null}, "macro.dbt.alter_column_type": {"unique_id": "macro.dbt.alter_column_type", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type', 'dbt')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1450171, "supported_languages": null}, "macro.dbt.default__alter_column_type": {"unique_id": "macro.dbt.default__alter_column_type", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.145612, "supported_languages": null}, "macro.dbt.alter_relation_add_remove_columns": {"unique_id": "macro.dbt.alter_relation_add_remove_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "alter_relation_add_remove_columns", "macro_sql": "{% macro alter_relation_add_remove_columns(relation, add_columns = none, remove_columns = none) -%}\n {{ return(adapter.dispatch('alter_relation_add_remove_columns', 'dbt')(relation, add_columns, remove_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__alter_relation_add_remove_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1458712, "supported_languages": null}, "macro.dbt.default__alter_relation_add_remove_columns": {"unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__alter_relation_add_remove_columns", "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation }}\n\n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n\n {% for column in remove_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.14665, "supported_languages": null}, "macro.dbt.build_ref_function": {"unique_id": "macro.dbt.build_ref_function", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "build_ref_function", "macro_sql": "{% macro build_ref_function(model) %}\n\n {%- set ref_dict = {} -%}\n {%- for _ref in model.refs -%}\n {%- set resolved = ref(*_ref) -%}\n {%- do ref_dict.update({_ref | join(\".\"): resolved.quote(database=False, schema=False, identifier=False) | string}) -%}\n {%- endfor -%}\n\ndef ref(*args,dbt_load_df_function):\n refs = {{ ref_dict | tojson }}\n key = \".\".join(args)\n return dbt_load_df_function(refs[key])\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1481369, "supported_languages": null}, "macro.dbt.build_source_function": {"unique_id": "macro.dbt.build_source_function", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "build_source_function", "macro_sql": "{% macro build_source_function(model) %}\n\n {%- set source_dict = {} -%}\n {%- for _source in model.sources -%}\n {%- set resolved = source(*_source) -%}\n {%- do source_dict.update({_source | join(\".\"): resolved.quote(database=False, schema=False, identifier=False) | string}) -%}\n {%- endfor -%}\n\ndef source(*args, dbt_load_df_function):\n sources = {{ source_dict | tojson }}\n key = \".\".join(args)\n return dbt_load_df_function(sources[key])\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.148617, "supported_languages": null}, "macro.dbt.build_config_dict": {"unique_id": "macro.dbt.build_config_dict", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "build_config_dict", "macro_sql": "{% macro build_config_dict(model) %}\n {%- set config_dict = {} -%}\n {%- for key in model.config.config_keys_used -%}\n {# weird type testing with enum, would be much easier to write this logic in Python! #}\n {%- if key == 'language' -%}\n {%- set value = 'python' -%}\n {%- endif -%}\n {%- set value = model.config[key] -%}\n {%- do config_dict.update({key: value}) -%}\n {%- endfor -%}\nconfig_dict = {{ config_dict }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1490712, "supported_languages": null}, "macro.dbt.py_script_postfix": {"unique_id": "macro.dbt.py_script_postfix", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "py_script_postfix", "macro_sql": "{% macro py_script_postfix(model) %}\n# This part is user provided model code\n# you will need to copy the next section to run the code\n# COMMAND ----------\n# this part is dbt logic for get ref work, do not modify\n\n{{ build_ref_function(model ) }}\n{{ build_source_function(model ) }}\n{{ build_config_dict(model) }}\n\nclass config:\n def __init__(self, *args, **kwargs):\n pass\n\n @staticmethod\n def get(key, default=None):\n return config_dict.get(key, default)\n\nclass this:\n \"\"\"dbt.this() or dbt.this.identifier\"\"\"\n database = '{{ this.database }}'\n schema = '{{ this.schema }}'\n identifier = '{{ this.identifier }}'\n def __repr__(self):\n return '{{ this }}'\n\n\nclass dbtObj:\n def __init__(self, load_df_function) -> None:\n self.source = lambda *args: source(*args, dbt_load_df_function=load_df_function)\n self.ref = lambda *args: ref(*args, dbt_load_df_function=load_df_function)\n self.config = config\n self.this = this()\n self.is_incremental = {{ is_incremental() }}\n\n# COMMAND ----------\n{{py_script_comment()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.build_ref_function", "macro.dbt.build_source_function", "macro.dbt.build_config_dict", "macro.dbt.is_incremental", "macro.dbt.py_script_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1494799, "supported_languages": null}, "macro.dbt.py_script_comment": {"unique_id": "macro.dbt.py_script_comment", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "py_script_comment", "macro_sql": "{%macro py_script_comment()%}\n{%endmacro%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.149552, "supported_languages": null}, "macro.dbt.test_unique": {"unique_id": "macro.dbt.test_unique", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1501281, "supported_languages": null}, "macro.dbt.test_not_null": {"unique_id": "macro.dbt.test_not_null", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.150362, "supported_languages": null}, "macro.dbt.test_accepted_values": {"unique_id": "macro.dbt.test_accepted_values", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values', 'dbt') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.150649, "supported_languages": null}, "macro.dbt.test_relationships": {"unique_id": "macro.dbt.test_relationships", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships', 'dbt') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.150931, "supported_languages": null}, "macro.dbt_utils.xdb_deprecation_warning_without_replacement": {"unique_id": "macro.dbt_utils.xdb_deprecation_warning_without_replacement", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/deprecated/xdb_deprecation_warning.sql", "original_file_path": "macros/cross_db_utils/deprecated/xdb_deprecation_warning.sql", "name": "xdb_deprecation_warning_without_replacement", "macro_sql": "{% macro xdb_deprecation_warning_without_replacement(macro, package, model) %}\n {%- set error_message = \"Warning: the `\" ~ macro ~\"` macro is deprecated and will be removed in a future version of the package, once equivalent functionality is implemented in dbt Core. The \" ~ package ~ \".\" ~ model ~ \" model triggered this warning.\" -%}\n {%- do exceptions.warn(error_message) -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.151318, "supported_languages": null}, "macro.dbt_utils.get_url_host": {"unique_id": "macro.dbt_utils.get_url_host", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "name": "get_url_host", "macro_sql": "{% macro get_url_host(field) -%}\n {{ return(adapter.dispatch('get_url_host', 'dbt_utils')(field)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_host"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.151712, "supported_languages": null}, "macro.dbt_utils.default__get_url_host": {"unique_id": "macro.dbt_utils.default__get_url_host", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "name": "default__get_url_host", "macro_sql": "{% macro default__get_url_host(field) -%}\n\n{%- set parsed =\n split_part(\n split_part(\n replace(\n replace(\n replace(field, \"'android-app://'\", \"''\"\n ), \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n\n-%}\n\n\n {{ dbt.safe_cast(\n parsed,\n type_string()\n )}}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.split_part", "macro.dbt.replace", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.152228, "supported_languages": null}, "macro.dbt_utils.get_url_path": {"unique_id": "macro.dbt_utils.get_url_path", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "name": "get_url_path", "macro_sql": "{% macro get_url_path(field) -%}\n {{ return(adapter.dispatch('get_url_path', 'dbt_utils')(field)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_path"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1527371, "supported_languages": null}, "macro.dbt_utils.default__get_url_path": {"unique_id": "macro.dbt_utils.default__get_url_path", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "name": "default__get_url_path", "macro_sql": "{% macro default__get_url_path(field) -%}\n\n {%- set stripped_url =\n replace(\n replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{ position(\"'/'\", stripped_url) }}, 0),\n {{ position(\"'?'\", stripped_url) }} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n split_part(\n right(\n stripped_url,\n length(stripped_url) ~ \"-\" ~ first_slash_pos\n ),\n \"'?'\", 1\n )\n -%}\n\n {{ safe_cast(\n parsed_path,\n type_string()\n )}}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.position", "macro.dbt.split_part", "macro.dbt.right", "macro.dbt.length", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.153323, "supported_languages": null}, "macro.dbt_utils.get_url_parameter": {"unique_id": "macro.dbt_utils.get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "name": "get_url_parameter", "macro_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n {{ return(adapter.dispatch('get_url_parameter', 'dbt_utils')(field, url_parameter)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1536891, "supported_languages": null}, "macro.dbt_utils.default__get_url_parameter": {"unique_id": "macro.dbt_utils.default__get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "name": "default__get_url_parameter", "macro_sql": "{% macro default__get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = split_part(split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1539998, "supported_languages": null}, "macro.dbt_utils.test_fewer_rows_than": {"unique_id": "macro.dbt_utils.test_fewer_rows_than", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "name": "test_fewer_rows_than", "macro_sql": "{% test fewer_rows_than(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_fewer_rows_than', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_fewer_rows_than"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1550772, "supported_languages": null}, "macro.dbt_utils.default__test_fewer_rows_than": {"unique_id": "macro.dbt_utils.default__test_fewer_rows_than", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "name": "default__test_fewer_rows_than", "macro_sql": "{% macro default__test_fewer_rows_than(model, compare_model, group_by_columns) %}\n\n{{ config(fail_calc = 'sum(coalesce(row_count_delta, 0))') }}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in equal_rowcount. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_fewer_rows_than'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_our_model \n from {{ model }}\n {{ groupby_gb_cols }}\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_comparison_model \n from {{ compare_model }}\n {{ groupby_gb_cols }}\n\n),\ncounts as (\n\n select\n\n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_our_model,\n count_comparison_model\n from a\n full join b on \n a.id_dbtutils_test_fewer_rows_than = b.id_dbtutils_test_fewer_rows_than\n {{ join_gb_cols }}\n\n),\nfinal as (\n\n select *,\n case\n -- fail the test if we have more rows than the reference model and return the row count delta\n when count_our_model > count_comparison_model then (count_our_model - count_comparison_model)\n -- fail the test if they are the same number\n when count_our_model = count_comparison_model then 1\n -- pass the test if the delta is positive (i.e. return the number 0)\n else 0\n end as row_count_delta\n from counts\n\n)\n\nselect * from final\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1561038, "supported_languages": null}, "macro.dbt_utils.test_equal_rowcount": {"unique_id": "macro.dbt_utils.test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "name": "test_equal_rowcount", "macro_sql": "{% test equal_rowcount(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_equal_rowcount', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_equal_rowcount"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.156995, "supported_languages": null}, "macro.dbt_utils.default__test_equal_rowcount": {"unique_id": "macro.dbt_utils.default__test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "name": "default__test_equal_rowcount", "macro_sql": "{% macro default__test_equal_rowcount(model, compare_model, group_by_columns) %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = 'sum(coalesce(diff_count, 0))') }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(', ') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in fewer_rows_than. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_equal_rowcount'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_a \n from {{ model }}\n {{groupby_gb_cols}}\n\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_b \n from {{ compare_model }}\n {{groupby_gb_cols}}\n\n),\nfinal as (\n\n select\n \n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_a,\n count_b,\n abs(count_a - count_b) as diff_count\n\n from a\n full join b\n on\n a.id_dbtutils_test_equal_rowcount = b.id_dbtutils_test_equal_rowcount\n {{join_gb_cols}}\n\n\n)\n\nselect * from final\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1580749, "supported_languages": null}, "macro.dbt_utils.test_relationships_where": {"unique_id": "macro.dbt_utils.test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "name": "test_relationships_where", "macro_sql": "{% test relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n {{ return(adapter.dispatch('test_relationships_where', 'dbt_utils')(model, column_name, to, field, from_condition, to_condition)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_relationships_where"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.158984, "supported_languages": null}, "macro.dbt_utils.default__test_relationships_where": {"unique_id": "macro.dbt_utils.default__test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "name": "default__test_relationships_where", "macro_sql": "{% macro default__test_relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n\nwith left_table as (\n\n select\n {{column_name}} as id\n\n from {{model}}\n\n where {{column_name}} is not null\n and {{from_condition}}\n\n),\n\nright_table as (\n\n select\n {{field}} as id\n\n from {{to}}\n\n where {{field}} is not null\n and {{to_condition}}\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1593652, "supported_languages": null}, "macro.dbt_utils.test_recency": {"unique_id": "macro.dbt_utils.test_recency", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "name": "test_recency", "macro_sql": "{% test recency(model, field, datepart, interval, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_recency', 'dbt_utils')(model, field, datepart, interval, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_recency"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.160099, "supported_languages": null}, "macro.dbt_utils.default__test_recency": {"unique_id": "macro.dbt_utils.default__test_recency", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "name": "default__test_recency", "macro_sql": "{% macro default__test_recency(model, field, datepart, interval, group_by_columns) %}\n\n{% set threshold = dateadd(datepart, interval * -1, current_timestamp_backcompat()) %}\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nwith recency as (\n\n select \n\n {{ select_gb_cols }}\n max({{field}}) as most_recent\n\n from {{ model }}\n\n {{ groupby_gb_cols }}\n\n)\n\nselect\n\n {{ select_gb_cols }}\n most_recent,\n {{ threshold }} as threshold\n\nfrom recency\nwhere most_recent < {{ threshold }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.160778, "supported_languages": null}, "macro.dbt_utils.test_not_constant": {"unique_id": "macro.dbt_utils.test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "name": "test_not_constant", "macro_sql": "{% test not_constant(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_constant', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_constant"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.161331, "supported_languages": null}, "macro.dbt_utils.default__test_not_constant": {"unique_id": "macro.dbt_utils.default__test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "name": "default__test_not_constant", "macro_sql": "{% macro default__test_not_constant(model, column_name, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nselect\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count(distinct {{ column_name }}) as filler_column\n\nfrom {{ model }}\n\n {{groupby_gb_cols}}\n\nhaving count(distinct {{ column_name }}) = 1\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.161815, "supported_languages": null}, "macro.dbt_utils.test_accepted_range": {"unique_id": "macro.dbt_utils.test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "name": "test_accepted_range", "macro_sql": "{% test accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n {{ return(adapter.dispatch('test_accepted_range', 'dbt_utils')(model, column_name, min_value, max_value, inclusive)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_accepted_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.162514, "supported_languages": null}, "macro.dbt_utils.default__test_accepted_range": {"unique_id": "macro.dbt_utils.default__test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "name": "default__test_accepted_range", "macro_sql": "{% macro default__test_accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n\nwith meet_condition as(\n select *\n from {{ model }}\n),\n\nvalidation_errors as (\n select *\n from meet_condition\n where\n -- never true, defaults to an empty result set. Exists to ensure any combo of the `or` clauses below succeeds\n 1 = 2\n\n {%- if min_value is not none %}\n -- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} > {{- \"=\" if inclusive }} {{ min_value }}\n {%- endif %}\n\n {%- if max_value is not none %}\n -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} < {{- \"=\" if inclusive }} {{ max_value }}\n {%- endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.163003, "supported_languages": null}, "macro.dbt_utils.test_not_accepted_values": {"unique_id": "macro.dbt_utils.test_not_accepted_values", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "name": "test_not_accepted_values", "macro_sql": "{% test not_accepted_values(model, column_name, values, quote=True) %}\n {{ return(adapter.dispatch('test_not_accepted_values', 'dbt_utils')(model, column_name, values, quote)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1636212, "supported_languages": null}, "macro.dbt_utils.default__test_not_accepted_values": {"unique_id": "macro.dbt_utils.default__test_not_accepted_values", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "name": "default__test_not_accepted_values", "macro_sql": "{% macro default__test_not_accepted_values(model, column_name, values, quote=True) %}\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1641119, "supported_languages": null}, "macro.dbt_utils.test_at_least_one": {"unique_id": "macro.dbt_utils.test_at_least_one", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "name": "test_at_least_one", "macro_sql": "{% test at_least_one(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_at_least_one', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_at_least_one"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1646469, "supported_languages": null}, "macro.dbt_utils.default__test_at_least_one": {"unique_id": "macro.dbt_utils.default__test_at_least_one", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "name": "default__test_at_least_one", "macro_sql": "{% macro default__test_at_least_one(model, column_name, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nselect *\nfrom (\n select\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count({{ column_name }}) as filler_column\n\n from {{ model }}\n\n {{groupby_gb_cols}}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.165138, "supported_languages": null}, "macro.dbt_utils.test_unique_combination_of_columns": {"unique_id": "macro.dbt_utils.test_unique_combination_of_columns", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "name": "test_unique_combination_of_columns", "macro_sql": "{% test unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n {{ return(adapter.dispatch('test_unique_combination_of_columns', 'dbt_utils')(model, combination_of_columns, quote_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_combination_of_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.16583, "supported_languages": null}, "macro.dbt_utils.default__test_unique_combination_of_columns": {"unique_id": "macro.dbt_utils.default__test_unique_combination_of_columns", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "name": "default__test_unique_combination_of_columns", "macro_sql": "{% macro default__test_unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n\n{% if not quote_columns %}\n {%- set column_list=combination_of_columns %}\n{% elif quote_columns %}\n {%- set column_list=[] %}\n {% for column in combination_of_columns -%}\n {% set column_list = column_list.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set columns_csv=column_list | join(', ') %}\n\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.166495, "supported_languages": null}, "macro.dbt_utils.test_cardinality_equality": {"unique_id": "macro.dbt_utils.test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "name": "test_cardinality_equality", "macro_sql": "{% test cardinality_equality(model, column_name, to, field) %}\n {{ return(adapter.dispatch('test_cardinality_equality', 'dbt_utils')(model, column_name, to, field)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_cardinality_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.167118, "supported_languages": null}, "macro.dbt_utils.default__test_cardinality_equality": {"unique_id": "macro.dbt_utils.default__test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "name": "default__test_cardinality_equality", "macro_sql": "{% macro default__test_cardinality_equality(model, column_name, to, field) %}\n\n{# T-SQL does not let you use numbers as aliases for columns #}\n{# Thus, no \"GROUP BY 1\" #}\n\nwith table_a as (\nselect\n {{ column_name }},\n count(*) as num_rows\nfrom {{ model }}\ngroup by {{ column_name }}\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by {{ field }}\n),\n\nexcept_a as (\n select *\n from table_a\n {{ except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ except() }}\n select *\n from table_a\n),\n\nunioned as (\n select *\n from except_a\n union all\n select *\n from except_b\n)\n\nselect *\nfrom unioned\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1674619, "supported_languages": null}, "macro.dbt_utils.test_expression_is_true": {"unique_id": "macro.dbt_utils.test_expression_is_true", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "name": "test_expression_is_true", "macro_sql": "{% test expression_is_true(model, expression, column_name=None, condition='1=1') %}\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n {{ return(adapter.dispatch('test_expression_is_true', 'dbt_utils')(model, expression, column_name, condition)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.168035, "supported_languages": null}, "macro.dbt_utils.default__test_expression_is_true": {"unique_id": "macro.dbt_utils.default__test_expression_is_true", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "name": "default__test_expression_is_true", "macro_sql": "{% macro default__test_expression_is_true(model, expression, column_name, condition) %}\n\n{% set column_list = '*' if should_store_failures() else \"1\" %}\n\nwith meet_condition as (\n select * from {{ model }} where {{ condition }}\n)\n\nselect\n {{ column_list }}\nfrom meet_condition\n{% if column_name is none %}\nwhere not({{ expression }})\n{%- else %}\nwhere not({{ column_name }} {{ expression }})\n{%- endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1684291, "supported_languages": null}, "macro.dbt_utils.test_not_null_proportion": {"unique_id": "macro.dbt_utils.test_not_null_proportion", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "name": "test_not_null_proportion", "macro_sql": "{% macro test_not_null_proportion(model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_null_proportion', 'dbt_utils')(model, group_by_columns, **kwargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_proportion"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1691442, "supported_languages": null}, "macro.dbt_utils.default__test_not_null_proportion": {"unique_id": "macro.dbt_utils.default__test_not_null_proportion", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "name": "default__test_not_null_proportion", "macro_sql": "{% macro default__test_not_null_proportion(model, group_by_columns) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n{% set at_least = kwargs.get('at_least', kwargs.get('arg')) %}\n{% set at_most = kwargs.get('at_most', kwargs.get('arg', 1)) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith validation as (\n select\n {{select_gb_cols}}\n sum(case when {{ column_name }} is null then 0 else 1 end) / cast(count(*) as numeric) as not_null_proportion\n from {{ model }}\n {{groupby_gb_cols}}\n),\nvalidation_errors as (\n select\n {{select_gb_cols}}\n not_null_proportion\n from validation\n where not_null_proportion < {{ at_least }} or not_null_proportion > {{ at_most }}\n)\nselect\n *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.170003, "supported_languages": null}, "macro.dbt_utils.test_sequential_values": {"unique_id": "macro.dbt_utils.test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "name": "test_sequential_values", "macro_sql": "{% test sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n {{ return(adapter.dispatch('test_sequential_values', 'dbt_utils')(model, column_name, interval, datepart, group_by_columns)) }}\n\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_sequential_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.171021, "supported_languages": null}, "macro.dbt_utils.default__test_sequential_values": {"unique_id": "macro.dbt_utils.default__test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "name": "default__test_sequential_values", "macro_sql": "{% macro default__test_sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n{% set previous_column_name = \"previous_\" ~ dbt_utils.slugify(column_name) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(',') + ', ' %}\n {% set partition_gb_cols = 'partition by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith windowed as (\n\n select\n {{ select_gb_cols }}\n {{ column_name }},\n lag({{ column_name }}) over (\n {{partition_gb_cols}}\n order by {{ column_name }}\n ) as {{ previous_column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ type_timestamp() }})= cast({{ dateadd(datepart, interval, previous_column_name) }} as {{ type_timestamp() }}))\n {% else %}\n where not({{ column_name }} = {{ previous_column_name }} + {{ interval }})\n {% endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.slugify", "macro.dbt.type_timestamp", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.171902, "supported_languages": null}, "macro.dbt_utils.test_equality": {"unique_id": "macro.dbt_utils.test_equality", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "name": "test_equality", "macro_sql": "{% test equality(model, compare_model, compare_columns=None) %}\n {{ return(adapter.dispatch('test_equality', 'dbt_utils')(model, compare_model, compare_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1727118, "supported_languages": null}, "macro.dbt_utils.default__test_equality": {"unique_id": "macro.dbt_utils.default__test_equality", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "name": "default__test_equality", "macro_sql": "{% macro default__test_equality(model, compare_model, compare_columns=None) %}\n\n{% set set_diff %}\n count(*) + coalesce(abs(\n sum(case when which_diff = 'a_minus_b' then 1 else 0 end) -\n sum(case when which_diff = 'b_minus_a' then 1 else 0 end)\n ), 0)\n{% endset %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = set_diff) }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n-- setup\n{%- do dbt_utils._is_relation(model, 'test_equality') -%}\n\n{#-\nIf the compare_cols arg is provided, we can run this test without querying the\ninformation schema\u00a0\u2014 this allows the model to be an ephemeral model\n-#}\n\n{%- if not compare_columns -%}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set compare_columns = adapter.get_columns_in_relation(model) | map(attribute='quoted') -%}\n{%- endif -%}\n\n{% set compare_cols_csv = compare_columns | join(', ') %}\n\nwith a as (\n\n select * from {{ model }}\n\n),\n\nb as (\n\n select * from {{ compare_model }}\n\n),\n\na_minus_b as (\n\n select {{compare_cols_csv}} from a\n {{ except() }}\n select {{compare_cols_csv}} from b\n\n),\n\nb_minus_a as (\n\n select {{compare_cols_csv}} from b\n {{ except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select 'a_minus_b' as which_diff, a_minus_b.* from a_minus_b\n union all\n select 'b_minus_a' as which_diff, b_minus_a.* from b_minus_a\n\n)\n\nselect * from unioned\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.173575, "supported_languages": null}, "macro.dbt_utils.test_not_empty_string": {"unique_id": "macro.dbt_utils.test_not_empty_string", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "name": "test_not_empty_string", "macro_sql": "{% test not_empty_string(model, column_name, trim_whitespace=true) %}\n\n {{ return(adapter.dispatch('test_not_empty_string', 'dbt_utils')(model, column_name, trim_whitespace)) }}\n\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_empty_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.174117, "supported_languages": null}, "macro.dbt_utils.default__test_not_empty_string": {"unique_id": "macro.dbt_utils.default__test_not_empty_string", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "name": "default__test_not_empty_string", "macro_sql": "{% macro default__test_not_empty_string(model, column_name, trim_whitespace=true) %}\n\n with\n \n all_values as (\n\n select \n\n\n {% if trim_whitespace == true -%}\n\n trim({{ column_name }}) as {{ column_name }}\n\n {%- else -%}\n\n {{ column_name }}\n\n {%- endif %}\n \n from {{ model }}\n\n ),\n\n errors as (\n\n select * from all_values\n where {{ column_name }} = ''\n\n )\n\n select * from errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.174412, "supported_languages": null}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "name": "test_mutually_exclusive_ranges", "macro_sql": "{% test mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', 'dbt_utils')(model, lower_bound_column, upper_bound_column, partition_by, gaps, zero_length_range_allowed)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_mutually_exclusive_ranges"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.177548, "supported_languages": null}, "macro.dbt_utils.default__test_mutually_exclusive_ranges": {"unique_id": "macro.dbt_utils.default__test_mutually_exclusive_ranges", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "name": "default__test_mutually_exclusive_ranges", "macro_sql": "{% macro default__test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n{% if gaps == 'not_allowed' %}\n {% set allow_gaps_operator='=' %}\n {% set allow_gaps_operator_in_words='equal_to' %}\n{% elif gaps == 'allowed' %}\n {% set allow_gaps_operator='<=' %}\n {% set allow_gaps_operator_in_words='less_than_or_equal_to' %}\n{% elif gaps == 'required' %}\n {% set allow_gaps_operator='<' %}\n {% set allow_gaps_operator_in_words='less_than' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '\" ~ gaps ~\"'.'\"\n ) }}\n{% endif %}\n{% if not zero_length_range_allowed %}\n {% set allow_zero_length_operator='<' %}\n {% set allow_zero_length_operator_in_words='less_than' %}\n{% elif zero_length_range_allowed %}\n {% set allow_zero_length_operator='<=' %}\n {% set allow_zero_length_operator_in_words='less_than_or_equal_to' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`zero_length_range_allowed` argument for mutually_exclusive_ranges test must be one of [true, false] Got: '\" ~ zero_length_range_allowed ~\"'.'\"\n ) }}\n{% endif %}\n\n{% set partition_clause=\"partition by \" ~ partition_by if partition_by else '' %}\n\nwith window_functions as (\n\n select\n {% if partition_by %}\n {{ partition_by }} as partition_by_col,\n {% endif %}\n {{ lower_bound_column }} as lower_bound,\n {{ upper_bound_column }} as upper_bound,\n\n lead({{ lower_bound_column }}) over (\n {{ partition_clause }}\n order by {{ lower_bound_column }}, {{ upper_bound_column }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_bound_column }} desc, {{ upper_bound_column }} desc\n ) = 1 as is_last_record\n\n from {{ model }}\n\n),\n\ncalc as (\n -- We want to return records where one of our assumptions fails, so we'll use\n -- the `not` function with `and` statements so we can write our assumptions more cleanly\n select\n *,\n\n -- For each record: lower_bound should be < upper_bound.\n -- Coalesce it to return an error on the null case (implicit assumption\n -- these columns are not_null)\n coalesce(\n lower_bound {{ allow_zero_length_operator }} upper_bound,\n false\n ) as lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect * from validation_errors\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.179147, "supported_languages": null}, "macro.dbt_utils.pretty_log_format": {"unique_id": "macro.dbt_utils.pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "name": "pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n {{ return(adapter.dispatch('pretty_log_format', 'dbt_utils')(message)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.179472, "supported_languages": null}, "macro.dbt_utils.default__pretty_log_format": {"unique_id": "macro.dbt_utils.default__pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "name": "default__pretty_log_format", "macro_sql": "{% macro default__pretty_log_format(message) %}\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.179637, "supported_languages": null}, "macro.dbt_utils._is_relation": {"unique_id": "macro.dbt_utils._is_relation", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/_is_relation.sql", "original_file_path": "macros/jinja_helpers/_is_relation.sql", "name": "_is_relation", "macro_sql": "{% macro _is_relation(obj, macro) %}\n {%- if not (obj is mapping and obj.get('metadata', {}).get('type', '').endswith('Relation')) -%}\n {%- do exceptions.raise_compiler_error(\"Macro \" ~ macro ~ \" expected a Relation but received the value: \" ~ obj) -%}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.180128, "supported_languages": null}, "macro.dbt_utils.pretty_time": {"unique_id": "macro.dbt_utils.pretty_time", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "name": "pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n {{ return(adapter.dispatch('pretty_time', 'dbt_utils')(format)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1804612, "supported_languages": null}, "macro.dbt_utils.default__pretty_time": {"unique_id": "macro.dbt_utils.default__pretty_time", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "name": "default__pretty_time", "macro_sql": "{% macro default__pretty_time(format='%H:%M:%S') %}\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.180655, "supported_languages": null}, "macro.dbt_utils.log_info": {"unique_id": "macro.dbt_utils.log_info", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "name": "log_info", "macro_sql": "{% macro log_info(message) %}\n {{ return(adapter.dispatch('log_info', 'dbt_utils')(message)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__log_info"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.180958, "supported_languages": null}, "macro.dbt_utils.default__log_info": {"unique_id": "macro.dbt_utils.default__log_info", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "name": "default__log_info", "macro_sql": "{% macro default__log_info(message) %}\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1811259, "supported_languages": null}, "macro.dbt_utils.slugify": {"unique_id": "macro.dbt_utils.slugify", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/slugify.sql", "original_file_path": "macros/jinja_helpers/slugify.sql", "name": "slugify", "macro_sql": "{% macro slugify(string) %}\n\n{#- Lower case the string -#}\n{% set string = string | lower %}\n{#- Replace spaces and dashes with underscores -#}\n{% set string = modules.re.sub('[ -]+', '_', string) %}\n{#- Only take letters, numbers, and underscores -#}\n{% set string = modules.re.sub('[^a-z0-9_]+', '', string) %}\n\n{{ return(string) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.181626, "supported_languages": null}, "macro.dbt_utils._is_ephemeral": {"unique_id": "macro.dbt_utils._is_ephemeral", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/_is_ephemeral.sql", "original_file_path": "macros/jinja_helpers/_is_ephemeral.sql", "name": "_is_ephemeral", "macro_sql": "{% macro _is_ephemeral(obj, macro) %}\n {%- if obj.is_cte -%}\n {% set ephemeral_prefix = api.Relation.add_ephemeral_prefix('') %}\n {% if obj.name.startswith(ephemeral_prefix) %}\n {% set model_name = obj.name[(ephemeral_prefix|length):] %}\n {% else %}\n {% set model_name = obj.name %}\n {%- endif -%}\n {% set error_message %}\nThe `{{ macro }}` macro cannot be used with ephemeral models, as it relies on the information schema.\n\n`{{ model_name }}` is an ephemeral model. Consider making it a view or table instead.\n {% endset %}\n {%- do exceptions.raise_compiler_error(error_message) -%}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.182512, "supported_languages": null}, "macro.dbt_utils.get_intervals_between": {"unique_id": "macro.dbt_utils.get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_utils')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1832142, "supported_languages": null}, "macro.dbt_utils.default__get_intervals_between": {"unique_id": "macro.dbt_utils.default__get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.183789, "supported_languages": null}, "macro.dbt_utils.date_spine": {"unique_id": "macro.dbt_utils.date_spine", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_utils')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.184017, "supported_languages": null}, "macro.dbt_utils.default__date_spine": {"unique_id": "macro.dbt_utils.default__date_spine", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{dbt_utils.generate_series(\n dbt_utils.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n),\n\nall_periods as (\n\n select (\n {{\n dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.generate_series", "macro.dbt_utils.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.184354, "supported_languages": null}, "macro.dbt_utils.nullcheck_table": {"unique_id": "macro.dbt_utils.nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "name": "nullcheck_table", "macro_sql": "{% macro nullcheck_table(relation) %}\n {{ return(adapter.dispatch('nullcheck_table', 'dbt_utils')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.184706, "supported_languages": null}, "macro.dbt_utils.default__nullcheck_table": {"unique_id": "macro.dbt_utils.default__nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "name": "default__nullcheck_table", "macro_sql": "{% macro default__nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(relation, 'nullcheck_table') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'nullcheck_table') -%}\n {% set cols = adapter.get_columns_in_relation(relation) %}\n\n select {{ dbt_utils.nullcheck(cols) }}\n from {{relation}}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.185035, "supported_languages": null}, "macro.dbt_utils.get_relations_by_pattern": {"unique_id": "macro.dbt_utils.get_relations_by_pattern", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "name": "get_relations_by_pattern", "macro_sql": "{% macro get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_pattern', 'dbt_utils')(schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.185719, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_pattern": {"unique_id": "macro.dbt_utils.default__get_relations_by_pattern", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "name": "default__get_relations_by_pattern", "macro_sql": "{% macro default__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.186622, "supported_languages": null}, "macro.dbt_utils.get_powers_of_two": {"unique_id": "macro.dbt_utils.get_powers_of_two", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.187464, "supported_languages": null}, "macro.dbt_utils.default__get_powers_of_two": {"unique_id": "macro.dbt_utils.default__get_powers_of_two", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.187871, "supported_languages": null}, "macro.dbt_utils.generate_series": {"unique_id": "macro.dbt_utils.generate_series", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.188053, "supported_languages": null}, "macro.dbt_utils.default__generate_series": {"unique_id": "macro.dbt_utils.default__generate_series", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_utils.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.188551, "supported_languages": null}, "macro.dbt_utils.get_relations_by_prefix": {"unique_id": "macro.dbt_utils.get_relations_by_prefix", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "name": "get_relations_by_prefix", "macro_sql": "{% macro get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_prefix', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.189257, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_prefix": {"unique_id": "macro.dbt_utils.default__get_relations_by_prefix", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "name": "default__get_relations_by_prefix", "macro_sql": "{% macro default__get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_prefix_sql(schema, prefix, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.190091, "supported_languages": null}, "macro.dbt_utils.get_tables_by_prefix_sql": {"unique_id": "macro.dbt_utils.get_tables_by_prefix_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "name": "get_tables_by_prefix_sql", "macro_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_prefix_sql', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.190552, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_prefix_sql": {"unique_id": "macro.dbt_utils.default__get_tables_by_prefix_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "name": "default__get_tables_by_prefix_sql", "macro_sql": "{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(\n schema_pattern = schema,\n table_pattern = prefix ~ '%',\n exclude = exclude,\n database = database\n ) }}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.190829, "supported_languages": null}, "macro.dbt_utils.star": {"unique_id": "macro.dbt_utils.star", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "name": "star", "macro_sql": "{% macro star(from, relation_alias=False, except=[], prefix='', suffix='') -%}\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, prefix, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.191534, "supported_languages": null}, "macro.dbt_utils.default__star": {"unique_id": "macro.dbt_utils.default__star", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "name": "default__star", "macro_sql": "{% macro default__star(from, relation_alias=False, except=[], prefix='', suffix='') -%}\n {%- do dbt_utils._is_relation(from, 'star') -%}\n {%- do dbt_utils._is_ephemeral(from, 'star') -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return('*') }}\n {%- endif -%}\n\n {% set cols = dbt_utils.get_filtered_columns_in_relation(from, except) %}\n\n {%- if cols|length <= 0 -%}\n {{- return('*') -}}\n {%- else -%}\n {%- for col in cols %}\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}{{ adapter.quote(col)|trim }} {%- if prefix!='' or suffix!='' %} as {{ adapter.quote(prefix ~ col ~ suffix)|trim }} {%- endif -%}\n {%- if not loop.last %},{{ '\\n ' }}{% endif %}\n {%- endfor -%}\n {% endif %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.192488, "supported_languages": null}, "macro.dbt_utils.unpivot": {"unique_id": "macro.dbt_utils.unpivot", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "name": "unpivot", "macro_sql": "{% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value') -%}\n {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1937559, "supported_languages": null}, "macro.dbt_utils.default__unpivot": {"unique_id": "macro.dbt_utils.default__unpivot", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "name": "default__unpivot", "macro_sql": "{% macro default__unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value') -%}\n\n {% if not relation %}\n {{ exceptions.raise_compiler_error(\"Error: argument `relation` is required for `unpivot` macro.\") }}\n {% endif %}\n\n {%- set exclude = exclude if exclude is not none else [] %}\n {%- set remove = remove if remove is not none else [] %}\n\n {%- set include_cols = [] %}\n\n {%- set table_columns = {} %}\n\n {%- do table_columns.update({relation: []}) %}\n\n {%- do dbt_utils._is_relation(relation, 'unpivot') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'unpivot') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) %}\n\n {%- for col in cols -%}\n {%- if col.column.lower() not in remove|map('lower') and col.column.lower() not in exclude|map('lower') -%}\n {% do include_cols.append(col) %}\n {%- endif %}\n {%- endfor %}\n\n\n {%- for col in include_cols -%}\n select\n {%- for exclude_col in exclude %}\n {{ exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ type_string() }}) as {{ field_name }},\n cast( {% if col.data_type == 'boolean' %}\n {{ cast_bool_to_text(col.column) }}\n {% else %}\n {{ col.column }}\n {% endif %}\n as {{ cast_to }}) as {{ value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_string", "macro.dbt.cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.195541, "supported_languages": null}, "macro.dbt_utils.union_relations": {"unique_id": "macro.dbt_utils.union_relations", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "name": "union_relations", "macro_sql": "{%- macro union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n {{ return(adapter.dispatch('union_relations', 'dbt_utils')(relations, column_override, include, exclude, source_column_name, where)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.198436, "supported_languages": null}, "macro.dbt_utils.default__union_relations": {"unique_id": "macro.dbt_utils.default__union_relations", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "name": "default__union_relations", "macro_sql": "\n\n{%- macro default__union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n cast({{ string_literal(relation) }} as {{ type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ relation }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2017632, "supported_languages": null}, "macro.dbt_utils.group_by": {"unique_id": "macro.dbt_utils.group_by", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "name": "group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_utils')(n)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2021172, "supported_languages": null}, "macro.dbt_utils.default__group_by": {"unique_id": "macro.dbt_utils.default__group_by", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "name": "default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }} \n {%- endfor -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.202362, "supported_languages": null}, "macro.dbt_utils.deduplicate": {"unique_id": "macro.dbt_utils.deduplicate", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "deduplicate", "macro_sql": "{%- macro deduplicate(relation, partition_by, order_by) -%}\n {{ return(adapter.dispatch('deduplicate', 'dbt_utils')(relation, partition_by, order_by)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.203114, "supported_languages": null}, "macro.dbt_utils.default__deduplicate": {"unique_id": "macro.dbt_utils.default__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "default__deduplicate", "macro_sql": "\n\n{%- macro default__deduplicate(relation, partition_by, order_by) -%}\n\n with row_numbered as (\n select\n _inner.*,\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) as rn\n from {{ relation }} as _inner\n )\n\n select\n distinct data.*\n from {{ relation }} as data\n {#\n -- Not all DBs will support natural joins but the ones that do include:\n -- Oracle, MySQL, SQLite, Redshift, Teradata, Materialize, Databricks\n -- Apache Spark, SingleStore, Vertica\n -- Those that do not appear to support natural joins include:\n -- SQLServer, Trino, Presto, Rockset, Athena\n #}\n natural join row_numbered\n where row_numbered.rn = 1\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.203328, "supported_languages": null}, "macro.dbt_utils.redshift__deduplicate": {"unique_id": "macro.dbt_utils.redshift__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "redshift__deduplicate", "macro_sql": "{% macro redshift__deduplicate(relation, partition_by, order_by) -%}\n\n {{ return(dbt_utils.default__deduplicate(relation, partition_by, order_by=order_by)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2035232, "supported_languages": null}, "macro.dbt_utils.postgres__deduplicate": {"unique_id": "macro.dbt_utils.postgres__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "postgres__deduplicate", "macro_sql": "\n{%- macro postgres__deduplicate(relation, partition_by, order_by) -%}\n\n select\n distinct on ({{ partition_by }}) *\n from {{ relation }}\n order by {{ partition_by }}{{ ',' ~ order_by }}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.203709, "supported_languages": null}, "macro.dbt_utils.snowflake__deduplicate": {"unique_id": "macro.dbt_utils.snowflake__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "snowflake__deduplicate", "macro_sql": "\n{%- macro snowflake__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.203865, "supported_languages": null}, "macro.dbt_utils.bigquery__deduplicate": {"unique_id": "macro.dbt_utils.bigquery__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "bigquery__deduplicate", "macro_sql": "\n{%- macro bigquery__deduplicate(relation, partition_by, order_by) -%}\n\n select unique.*\n from (\n select\n array_agg (\n original\n order by {{ order_by }}\n limit 1\n )[offset(0)] unique\n from {{ relation }} original\n group by {{ partition_by }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2040288, "supported_languages": null}, "macro.dbt_utils.surrogate_key": {"unique_id": "macro.dbt_utils.surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "name": "surrogate_key", "macro_sql": "{%- macro surrogate_key(field_list) -%}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('surrogate_key', 'dbt_utils')(field_list, *varargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.204457, "supported_languages": null}, "macro.dbt_utils.default__surrogate_key": {"unique_id": "macro.dbt_utils.default__surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "name": "default__surrogate_key", "macro_sql": "\n\n{%- macro default__surrogate_key(field_list) -%}\n\n{%- set error_message = '\nWarning: `dbt_utils.surrogate_key` has been replaced by \\\n`dbt_utils.generate_surrogate_key`. The new macro treats null values \\\ndifferently to empty strings. To restore the behaviour of the original \\\nmacro, add a variable scoped to the dbt_utils package called \\\n`surrogate_key_treat_nulls_as_empty_strings` to your \\\ndbt_project.yml file with a value of True. \\\nThe {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.204685, "supported_languages": null}, "macro.dbt_utils.safe_add": {"unique_id": "macro.dbt_utils.safe_add", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "name": "safe_add", "macro_sql": "{%- macro safe_add(field_list) -%}\n {{ return(adapter.dispatch('safe_add', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__safe_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.205096, "supported_languages": null}, "macro.dbt_utils.default__safe_add": {"unique_id": "macro.dbt_utils.default__safe_add", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "name": "default__safe_add", "macro_sql": "\n\n{%- macro default__safe_add(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_add` macro now takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.warn(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.205625, "supported_languages": null}, "macro.dbt_utils.nullcheck": {"unique_id": "macro.dbt_utils.nullcheck", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "name": "nullcheck", "macro_sql": "{% macro nullcheck(cols) %}\n {{ return(adapter.dispatch('nullcheck', 'dbt_utils')(cols)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.206004, "supported_languages": null}, "macro.dbt_utils.default__nullcheck": {"unique_id": "macro.dbt_utils.default__nullcheck", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "name": "default__nullcheck", "macro_sql": "{% macro default__nullcheck(cols) %}\n{%- for col in cols %}\n\n {% if col.is_string() -%}\n\n nullif({{col.name}},'') as {{col.name}}\n\n {%- else -%}\n\n {{col.name}}\n\n {%- endif -%}\n\n{%- if not loop.last -%} , {%- endif -%}\n\n{%- endfor -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.206326, "supported_languages": null}, "macro.dbt_utils.get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "get_tables_by_pattern_sql", "macro_sql": "{% macro get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_pattern_sql', 'dbt_utils')\n (schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.207904, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.default__get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "default__get_tables_by_pattern_sql", "macro_sql": "{% macro default__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.208252, "supported_languages": null}, "macro.dbt_utils.bigquery__get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.bigquery__get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "bigquery__get_tables_by_pattern_sql", "macro_sql": "{% macro bigquery__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% if '%' in schema_pattern %}\n {% set schemata=dbt_utils._bigquery__get_matching_schemata(schema_pattern, database) %}\n {% else %}\n {% set schemata=[schema_pattern] %}\n {% endif %}\n\n {% set sql %}\n {% for schema in schemata %}\n select distinct\n table_schema,\n table_name,\n {{ dbt_utils.get_table_types_sql() }}\n\n from {{ adapter.quote(database) }}.{{ schema }}.INFORMATION_SCHEMA.TABLES\n where lower(table_name) like lower ('{{ table_pattern }}')\n and lower(table_name) not like lower ('{{ exclude }}')\n\n {% if not loop.last %} union all {% endif %}\n\n {% endfor %}\n {% endset %}\n\n {{ return(sql) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._bigquery__get_matching_schemata", "macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2090151, "supported_languages": null}, "macro.dbt_utils._bigquery__get_matching_schemata": {"unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "_bigquery__get_matching_schemata", "macro_sql": "{% macro _bigquery__get_matching_schemata(schema_pattern, database) %}\n {% if execute %}\n\n {% set sql %}\n select schema_name from {{ adapter.quote(database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like lower('{{ schema_pattern }}')\n {% endset %}\n\n {% set results=run_query(sql) %}\n\n {% set schemata=results.columns['schema_name'].values() %}\n\n {{ return(schemata) }}\n\n {% else %}\n\n {{ return([]) }}\n\n {% endif %}\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.209503, "supported_languages": null}, "macro.dbt_utils.get_column_values": {"unique_id": "macro.dbt_utils.get_column_values", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "name": "get_column_values", "macro_sql": "{% macro get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {{ return(adapter.dispatch('get_column_values', 'dbt_utils')(table, column, order_by, max_records, default, where)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_column_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.210594, "supported_languages": null}, "macro.dbt_utils.default__get_column_values": {"unique_id": "macro.dbt_utils.default__get_column_values", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "name": "default__get_column_values", "macro_sql": "{% macro default__get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {% set default = [] if not default %}\n {{ return(default) }}\n {% endif %}\n\n {%- do dbt_utils._is_ephemeral(table, 'get_column_values') -%}\n\n {# Not all relations are tables. Renaming for internal clarity without breaking functionality for anyone using named arguments #}\n {# TODO: Change the method signature in a future 0.x.0 release #}\n {%- set target_relation = table -%}\n\n {# adapter.load_relation is a convenience wrapper to avoid building a Relation when we already have one #}\n {% set relation_exists = (load_relation(target_relation)) is not none %}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not relation_exists and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ target_relation ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not relation_exists and default is not none -%}\n\n {{ log(\"Relation \" ~ target_relation ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n\n {% if where is not none %}\n where {{ where }}\n {% endif %}\n\n group by {{ column }}\n order by {{ order_by }}\n\n {% if max_records is not none %}\n limit {{ max_records }}\n {% endif %}\n\n {% endif %}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_column_values') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values) }}\n {%- else -%}\n {{ return(default) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_ephemeral", "macro.dbt.load_relation", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.212062, "supported_languages": null}, "macro.dbt_utils.pivot": {"unique_id": "macro.dbt_utils.pivot", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "name": "pivot", "macro_sql": "{% macro pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {{ return(adapter.dispatch('pivot', 'dbt_utils')(column, values, alias, agg, cmp, prefix, suffix, then_value, else_value, quote_identifiers, distinct)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.213105, "supported_languages": null}, "macro.dbt_utils.default__pivot": {"unique_id": "macro.dbt_utils.default__pivot", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "name": "default__pivot", "macro_sql": "{% macro default__pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {% for value in values %}\n {{ agg }}(\n {% if distinct %} distinct {% endif %}\n case\n when {{ column }} {{ cmp }} '{{ escape_single_quotes(value) }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ value ~ suffix) }}\n {% else %}\n as {{ dbt_utils.slugify(prefix ~ value ~ suffix) }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.escape_single_quotes", "macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.213917, "supported_languages": null}, "macro.dbt_utils.get_filtered_columns_in_relation": {"unique_id": "macro.dbt_utils.get_filtered_columns_in_relation", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "name": "get_filtered_columns_in_relation", "macro_sql": "{% macro get_filtered_columns_in_relation(from, except=[]) -%}\n {{ return(adapter.dispatch('get_filtered_columns_in_relation', 'dbt_utils')(from, except)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2144158, "supported_languages": null}, "macro.dbt_utils.default__get_filtered_columns_in_relation": {"unique_id": "macro.dbt_utils.default__get_filtered_columns_in_relation", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "name": "default__get_filtered_columns_in_relation", "macro_sql": "{% macro default__get_filtered_columns_in_relation(from, except=[]) -%}\n {%- do dbt_utils._is_relation(from, 'get_filtered_columns_in_relation') -%}\n {%- do dbt_utils._is_ephemeral(from, 'get_filtered_columns_in_relation') -%}\n\n {# -- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return('') }}\n {% endif %}\n\n {%- set include_cols = [] %}\n {%- set cols = adapter.get_columns_in_relation(from) -%}\n {%- set except = except | map(\"lower\") | list %}\n {%- for col in cols -%}\n {%- if col.column|lower not in except -%}\n {% do include_cols.append(col.column) %}\n {%- endif %}\n {%- endfor %}\n\n {{ return(include_cols) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.215127, "supported_languages": null}, "macro.dbt_utils.width_bucket": {"unique_id": "macro.dbt_utils.width_bucket", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "name": "width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ return(adapter.dispatch('width_bucket', 'dbt_utils') (expr, min_value, max_value, num_buckets)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__width_bucket"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.216487, "supported_languages": null}, "macro.dbt_utils.default__width_bucket": {"unique_id": "macro.dbt_utils.default__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "name": "default__width_bucket", "macro_sql": "{% macro default__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is eaxtly at the bucket egde\n case\n when\n mod(\n {{ dbt.safe_cast(expr, type_numeric() ) }},\n {{ dbt.safe_cast(bin_size, type_numeric() ) }}\n ) = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.216917, "supported_languages": null}, "macro.dbt_utils.redshift__width_bucket": {"unique_id": "macro.dbt_utils.redshift__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "name": "redshift__width_bucket", "macro_sql": "{% macro redshift__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is exactly at the bucket edge\n case\n when\n {{ dbt.safe_cast(expr, type_numeric() ) }} %\n {{ dbt.safe_cast(bin_size, type_numeric() ) }}\n = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.217348, "supported_languages": null}, "macro.dbt_utils.snowflake__width_bucket": {"unique_id": "macro.dbt_utils.snowflake__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "name": "snowflake__width_bucket", "macro_sql": "{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.217536, "supported_languages": null}, "macro.dbt_utils.get_query_results_as_dict": {"unique_id": "macro.dbt_utils.get_query_results_as_dict", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "name": "get_query_results_as_dict", "macro_sql": "{% macro get_query_results_as_dict(query) %}\n {{ return(adapter.dispatch('get_query_results_as_dict', 'dbt_utils')(query)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_query_results_as_dict"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.21796, "supported_languages": null}, "macro.dbt_utils.default__get_query_results_as_dict": {"unique_id": "macro.dbt_utils.default__get_query_results_as_dict", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "name": "default__get_query_results_as_dict", "macro_sql": "{% macro default__get_query_results_as_dict(query) %}\n\n{# This macro returns a dictionary of the form {column_name: (tuple_of_results)} #}\n\n {%- call statement('get_query_results', fetch_result=True,auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {% set sql_results={} %}\n\n {%- if execute -%}\n {% set sql_results_table = load_result('get_query_results').table.columns %}\n {% for column_name, column in sql_results_table.items() %}\n {% do sql_results.update({column_name: column.values()}) %}\n {% endfor %}\n {%- endif -%}\n\n {{ return(sql_results) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.218543, "supported_languages": null}, "macro.dbt_utils.generate_surrogate_key": {"unique_id": "macro.dbt_utils.generate_surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "name": "generate_surrogate_key", "macro_sql": "{%- macro generate_surrogate_key(field_list) -%}\n {{ return(adapter.dispatch('generate_surrogate_key', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__generate_surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.219029, "supported_languages": null}, "macro.dbt_utils.default__generate_surrogate_key": {"unique_id": "macro.dbt_utils.default__generate_surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "name": "default__generate_surrogate_key", "macro_sql": "\n\n{%- macro default__generate_surrogate_key(field_list) -%}\n\n{% if var('surrogate_key_treat_nulls_as_empty_strings', False) %}\n {% set default_null_value = \"\" %}\n{% else %}\n {% set default_null_value = '_dbt_utils_surrogate_key_null_'%}\n{% endif %}\n\n{%- set fields = [] -%}\n\n{%- for field in field_list -%}\n\n {%- do fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ type_string() ~ \"), '\" ~ default_null_value ~\"')\"\n ) -%}\n\n {%- if not loop.last %}\n {%- do fields.append(\"'-'\") -%}\n {%- endif -%}\n\n{%- endfor -%}\n\n{{ hash(concat(fields)) }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.hash", "macro.dbt.concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.219638, "supported_languages": null}, "macro.dbt_utils.get_table_types_sql": {"unique_id": "macro.dbt_utils.get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "name": "get_table_types_sql", "macro_sql": "{%- macro get_table_types_sql() -%}\n {{ return(adapter.dispatch('get_table_types_sql', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.220063, "supported_languages": null}, "macro.dbt_utils.default__get_table_types_sql": {"unique_id": "macro.dbt_utils.default__get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "name": "default__get_table_types_sql", "macro_sql": "{% macro default__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.220201, "supported_languages": null}, "macro.dbt_utils.postgres__get_table_types_sql": {"unique_id": "macro.dbt_utils.postgres__get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "name": "postgres__get_table_types_sql", "macro_sql": "{% macro postgres__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'FOREIGN' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.220337, "supported_languages": null}, "macro.dbt_utils.degrees_to_radians": {"unique_id": "macro.dbt_utils.degrees_to_radians", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "degrees_to_radians", "macro_sql": "{% macro degrees_to_radians(degrees) -%}\n acos(-1) * {{degrees}} / 180\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.221357, "supported_languages": null}, "macro.dbt_utils.haversine_distance": {"unique_id": "macro.dbt_utils.haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "haversine_distance", "macro_sql": "{% macro haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n {{ return(adapter.dispatch('haversine_distance', 'dbt_utils')(lat1,lon1,lat2,lon2,unit)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.221693, "supported_languages": null}, "macro.dbt_utils.default__haversine_distance": {"unique_id": "macro.dbt_utils.default__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n\n 2 * 3961 * asin(sqrt(power((sin(radians(({{ lat2 }} - {{ lat1 }}) / 2))), 2) +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n power((sin(radians(({{ lon2 }} - {{ lon1 }}) / 2))), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2222521, "supported_languages": null}, "macro.dbt_utils.bigquery__haversine_distance": {"unique_id": "macro.dbt_utils.bigquery__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "bigquery__haversine_distance", "macro_sql": "{% macro bigquery__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{% set radians_lat1 = dbt_utils.degrees_to_radians(lat1) %}\n{% set radians_lat2 = dbt_utils.degrees_to_radians(lat2) %}\n{% set radians_lon1 = dbt_utils.degrees_to_radians(lon1) %}\n{% set radians_lon2 = dbt_utils.degrees_to_radians(lon2) %}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n 2 * 3961 * asin(sqrt(power(sin(({{ radians_lat2 }} - {{ radians_lat1 }}) / 2), 2) +\n cos({{ radians_lat1 }}) * cos({{ radians_lat2 }}) *\n power(sin(({{ radians_lon2 }} - {{ radians_lon1 }}) / 2), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.degrees_to_radians"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.22304, "supported_languages": null}, "macro.fivetran_utils.enabled_vars": {"unique_id": "macro.fivetran_utils.enabled_vars", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/enabled_vars.sql", "original_file_path": "macros/enabled_vars.sql", "name": "enabled_vars", "macro_sql": "{% macro enabled_vars(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, True) == False %}\n {{ return(False) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(True) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.223495, "supported_languages": null}, "macro.fivetran_utils.percentile": {"unique_id": "macro.fivetran_utils.percentile", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "percentile", "macro_sql": "{% macro percentile(percentile_field, partition_field, percent) -%}\n\n{{ adapter.dispatch('percentile', 'fivetran_utils') (percentile_field, partition_field, percent) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__percentile"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.224407, "supported_languages": null}, "macro.fivetran_utils.default__percentile": {"unique_id": "macro.fivetran_utils.default__percentile", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "default__percentile", "macro_sql": "{% macro default__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.22457, "supported_languages": null}, "macro.fivetran_utils.redshift__percentile": {"unique_id": "macro.fivetran_utils.redshift__percentile", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "redshift__percentile", "macro_sql": "{% macro redshift__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.224724, "supported_languages": null}, "macro.fivetran_utils.bigquery__percentile": {"unique_id": "macro.fivetran_utils.bigquery__percentile", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "bigquery__percentile", "macro_sql": "{% macro bigquery__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.224877, "supported_languages": null}, "macro.fivetran_utils.postgres__percentile": {"unique_id": "macro.fivetran_utils.postgres__percentile", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "postgres__percentile", "macro_sql": "{% macro postgres__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n /* have to group by partition field */\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.225015, "supported_languages": null}, "macro.fivetran_utils.spark__percentile": {"unique_id": "macro.fivetran_utils.spark__percentile", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "spark__percentile", "macro_sql": "{% macro spark__percentile(percentile_field, partition_field, percent) %}\n\n percentile( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.225166, "supported_languages": null}, "macro.fivetran_utils.pivot_json_extract": {"unique_id": "macro.fivetran_utils.pivot_json_extract", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/pivot_json_extract.sql", "original_file_path": "macros/pivot_json_extract.sql", "name": "pivot_json_extract", "macro_sql": "{% macro pivot_json_extract(string, list_of_properties) %}\n\n{%- for property in list_of_properties -%}\n\nreplace( {{ fivetran_utils.json_extract(string, property) }}, '\"', '') as {{ property | replace(' ', '_') | lower }}\n\n{%- if not loop.last -%},{%- endif %}\n{% endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.225632, "supported_languages": null}, "macro.fivetran_utils.persist_pass_through_columns": {"unique_id": "macro.fivetran_utils.persist_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/persist_pass_through_columns.sql", "original_file_path": "macros/persist_pass_through_columns.sql", "name": "persist_pass_through_columns", "macro_sql": "{% macro persist_pass_through_columns(pass_through_variable, identifier=none, transform='') %}\n\n{% if var(pass_through_variable, none) %}\n {% for field in var(pass_through_variable) %}\n , {{ transform ~ '(' ~ (identifier ~ '.' if identifier else '') ~ (field.alias if field.alias else field.name) ~ ')' }} as {{ field.alias if field.alias else field.name }}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.226304, "supported_languages": null}, "macro.fivetran_utils.json_parse": {"unique_id": "macro.fivetran_utils.json_parse", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "json_parse", "macro_sql": "{% macro json_parse(string, string_path) -%}\n\n{{ adapter.dispatch('json_parse', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__json_parse"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2273579, "supported_languages": null}, "macro.fivetran_utils.default__json_parse": {"unique_id": "macro.fivetran_utils.default__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "default__json_parse", "macro_sql": "{% macro default__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.227596, "supported_languages": null}, "macro.fivetran_utils.redshift__json_parse": {"unique_id": "macro.fivetran_utils.redshift__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "redshift__json_parse", "macro_sql": "{% macro redshift__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.227833, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_parse": {"unique_id": "macro.fivetran_utils.bigquery__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "bigquery__json_parse", "macro_sql": "{% macro bigquery__json_parse(string, string_path) %}\n\n \n json_extract_scalar({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.228064, "supported_languages": null}, "macro.fivetran_utils.postgres__json_parse": {"unique_id": "macro.fivetran_utils.postgres__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "postgres__json_parse", "macro_sql": "{% macro postgres__json_parse(string, string_path) %}\n\n {{string}}::json #>> '{ {%- for s in string_path -%}{{ s }}{%- if not loop.last -%},{%- endif -%}{%- endfor -%} }'\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.228292, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_parse": {"unique_id": "macro.fivetran_utils.snowflake__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "snowflake__json_parse", "macro_sql": "{% macro snowflake__json_parse(string, string_path) %}\n\n parse_json( {{string}} ) {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.228551, "supported_languages": null}, "macro.fivetran_utils.spark__json_parse": {"unique_id": "macro.fivetran_utils.spark__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "spark__json_parse", "macro_sql": "{% macro spark__json_parse(string, string_path) %}\n\n {{string}} : {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.228808, "supported_languages": null}, "macro.fivetran_utils.max_bool": {"unique_id": "macro.fivetran_utils.max_bool", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "max_bool", "macro_sql": "{% macro max_bool(boolean_field) -%}\n\n{{ adapter.dispatch('max_bool', 'fivetran_utils') (boolean_field) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__max_bool"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2291782, "supported_languages": null}, "macro.fivetran_utils.default__max_bool": {"unique_id": "macro.fivetran_utils.default__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "default__max_bool", "macro_sql": "{% macro default__max_bool(boolean_field) %}\n\n bool_or( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.229277, "supported_languages": null}, "macro.fivetran_utils.snowflake__max_bool": {"unique_id": "macro.fivetran_utils.snowflake__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "snowflake__max_bool", "macro_sql": "{% macro snowflake__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.229446, "supported_languages": null}, "macro.fivetran_utils.bigquery__max_bool": {"unique_id": "macro.fivetran_utils.bigquery__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "bigquery__max_bool", "macro_sql": "{% macro bigquery__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.229544, "supported_languages": null}, "macro.fivetran_utils.calculated_fields": {"unique_id": "macro.fivetran_utils.calculated_fields", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/calculated_fields.sql", "original_file_path": "macros/calculated_fields.sql", "name": "calculated_fields", "macro_sql": "{% macro calculated_fields(variable) -%}\n\n{% if var(variable, none) %}\n {% for field in var(variable) %}\n , {{ field.transform_sql }} as {{ field.name }} \n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.22996, "supported_languages": null}, "macro.fivetran_utils.seed_data_helper": {"unique_id": "macro.fivetran_utils.seed_data_helper", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/seed_data_helper.sql", "original_file_path": "macros/seed_data_helper.sql", "name": "seed_data_helper", "macro_sql": "{% macro seed_data_helper(seed_name, warehouses) %}\n\n{% if target.type in warehouses %}\n {% for w in warehouses %}\n {% if target.type == w %}\n {{ return(ref(seed_name ~ \"_\" ~ w ~ \"\")) }}\n {% endif %}\n {% endfor %}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.230571, "supported_languages": null}, "macro.fivetran_utils.fill_pass_through_columns": {"unique_id": "macro.fivetran_utils.fill_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/fill_pass_through_columns.sql", "original_file_path": "macros/fill_pass_through_columns.sql", "name": "fill_pass_through_columns", "macro_sql": "{% macro fill_pass_through_columns(pass_through_variable) %}\n\n{% if var(pass_through_variable) %}\n {% for field in var(pass_through_variable) %}\n {% if field.transform_sql %}\n , {{ field.transform_sql }} as {{ field.alias if field.alias else field.name }}\n {% else %}\n , {{ field.alias if field.alias else field.name }}\n {% endif %}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.231214, "supported_languages": null}, "macro.fivetran_utils.string_agg": {"unique_id": "macro.fivetran_utils.string_agg", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "string_agg", "macro_sql": "{% macro string_agg(field_to_agg, delimiter) -%}\n\n{{ adapter.dispatch('string_agg', 'fivetran_utils') (field_to_agg, delimiter) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__string_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.231713, "supported_languages": null}, "macro.fivetran_utils.default__string_agg": {"unique_id": "macro.fivetran_utils.default__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "default__string_agg", "macro_sql": "{% macro default__string_agg(field_to_agg, delimiter) %}\n string_agg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.231839, "supported_languages": null}, "macro.fivetran_utils.snowflake__string_agg": {"unique_id": "macro.fivetran_utils.snowflake__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "snowflake__string_agg", "macro_sql": "{% macro snowflake__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2319639, "supported_languages": null}, "macro.fivetran_utils.redshift__string_agg": {"unique_id": "macro.fivetran_utils.redshift__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "redshift__string_agg", "macro_sql": "{% macro redshift__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2320871, "supported_languages": null}, "macro.fivetran_utils.spark__string_agg": {"unique_id": "macro.fivetran_utils.spark__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "spark__string_agg", "macro_sql": "{% macro spark__string_agg(field_to_agg, delimiter) %}\n -- collect set will remove duplicates\n replace(replace(replace(cast( collect_set({{ field_to_agg }}) as string), '[', ''), ']', ''), ', ', {{ delimiter }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.232213, "supported_languages": null}, "macro.fivetran_utils.timestamp_diff": {"unique_id": "macro.fivetran_utils.timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "timestamp_diff", "macro_sql": "{% macro timestamp_diff(first_date, second_date, datepart) %}\n {{ adapter.dispatch('timestamp_diff', 'fivetran_utils')(first_date, second_date, datepart) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__timestamp_diff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.23489, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_diff": {"unique_id": "macro.fivetran_utils.default__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "default__timestamp_diff", "macro_sql": "{% macro default__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2350478, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_diff": {"unique_id": "macro.fivetran_utils.redshift__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "redshift__timestamp_diff", "macro_sql": "{% macro redshift__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2352, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_diff": {"unique_id": "macro.fivetran_utils.bigquery__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "bigquery__timestamp_diff", "macro_sql": "{% macro bigquery__timestamp_diff(first_date, second_date, datepart) %}\n\n timestamp_diff(\n {{second_date}},\n {{first_date}},\n {{datepart}}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2353542, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_diff": {"unique_id": "macro.fivetran_utils.postgres__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "postgres__timestamp_diff", "macro_sql": "{% macro postgres__timestamp_diff(first_date, second_date, datepart) %}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ dbt.datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.23706, "supported_languages": null}, "macro.fivetran_utils.try_cast": {"unique_id": "macro.fivetran_utils.try_cast", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "try_cast", "macro_sql": "{% macro try_cast(field, type) %}\n {{ adapter.dispatch('try_cast', 'fivetran_utils') (field, type) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__try_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2379022, "supported_languages": null}, "macro.fivetran_utils.default__safe_cast": {"unique_id": "macro.fivetran_utils.default__safe_cast", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.238039, "supported_languages": null}, "macro.fivetran_utils.redshift__try_cast": {"unique_id": "macro.fivetran_utils.redshift__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "redshift__try_cast", "macro_sql": "{% macro redshift__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when trim({{field}}) ~ '^(0|[1-9][0-9]*)$' then trim({{field}})\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2383082, "supported_languages": null}, "macro.fivetran_utils.postgres__try_cast": {"unique_id": "macro.fivetran_utils.postgres__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "postgres__try_cast", "macro_sql": "{% macro postgres__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar)) ~ '^(0|[1-9][0-9]*)$' \n then replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar))\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.238584, "supported_languages": null}, "macro.fivetran_utils.snowflake__try_cast": {"unique_id": "macro.fivetran_utils.snowflake__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "snowflake__try_cast", "macro_sql": "{% macro snowflake__try_cast(field, type) %}\n try_cast(cast({{field}} as varchar) as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2387142, "supported_languages": null}, "macro.fivetran_utils.bigquery__try_cast": {"unique_id": "macro.fivetran_utils.bigquery__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "bigquery__try_cast", "macro_sql": "{% macro bigquery__try_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2388349, "supported_languages": null}, "macro.fivetran_utils.spark__try_cast": {"unique_id": "macro.fivetran_utils.spark__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "spark__try_cast", "macro_sql": "{% macro spark__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.238955, "supported_languages": null}, "macro.fivetran_utils.source_relation": {"unique_id": "macro.fivetran_utils.source_relation", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "name": "source_relation", "macro_sql": "{% macro source_relation(union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('source_relation', 'fivetran_utils') (union_schema_variable, union_database_variable) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2394729, "supported_languages": null}, "macro.fivetran_utils.default__source_relation": {"unique_id": "macro.fivetran_utils.default__source_relation", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "name": "default__source_relation", "macro_sql": "{% macro default__source_relation(union_schema_variable, union_database_variable) %}\n\n{% if var(union_schema_variable, none) %}\n, case\n {% for schema in var(union_schema_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%.{{ schema|lower }}.%' then '{{ schema|lower }}'\n {% endfor %}\n end as source_relation\n{% elif var(union_database_variable, none) %}\n, case\n {% for database in var(union_database_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%{{ database|lower }}.%' then '{{ database|lower }}'\n {% endfor %}\n end as source_relation\n{% else %}\n, cast('' as {{ dbt.type_string() }}) as source_relation\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2400389, "supported_languages": null}, "macro.fivetran_utils.first_value": {"unique_id": "macro.fivetran_utils.first_value", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "first_value", "macro_sql": "{% macro first_value(first_value_field, partition_field, order_by_field, order=\"asc\") -%}\n\n{{ adapter.dispatch('first_value', 'fivetran_utils') (first_value_field, partition_field, order_by_field, order) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__first_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.240567, "supported_languages": null}, "macro.fivetran_utils.default__first_value": {"unique_id": "macro.fivetran_utils.default__first_value", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "default__first_value", "macro_sql": "{% macro default__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.240761, "supported_languages": null}, "macro.fivetran_utils.redshift__first_value": {"unique_id": "macro.fivetran_utils.redshift__first_value", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "redshift__first_value", "macro_sql": "{% macro redshift__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} , {{ partition_field }} rows unbounded preceding )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.240972, "supported_languages": null}, "macro.fivetran_utils.add_dbt_source_relation": {"unique_id": "macro.fivetran_utils.add_dbt_source_relation", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/add_dbt_source_relation.sql", "original_file_path": "macros/add_dbt_source_relation.sql", "name": "add_dbt_source_relation", "macro_sql": "{% macro add_dbt_source_relation() %}\n\n{% if var('union_schemas', none) or var('union_databases', none) %}\n, _dbt_source_relation\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.241279, "supported_languages": null}, "macro.fivetran_utils.add_pass_through_columns": {"unique_id": "macro.fivetran_utils.add_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/add_pass_through_columns.sql", "original_file_path": "macros/add_pass_through_columns.sql", "name": "add_pass_through_columns", "macro_sql": "{% macro add_pass_through_columns(base_columns, pass_through_var) %}\n\n {% if pass_through_var %}\n\n {% for column in pass_through_var %}\n\n {% if column.alias %}\n\n {% do base_columns.append({ \"name\": column.name, \"alias\": column.alias, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column.name, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n \n {% endif %}\n\n {% endfor %}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.242126, "supported_languages": null}, "macro.fivetran_utils.union_relations": {"unique_id": "macro.fivetran_utils.union_relations", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "name": "union_relations", "macro_sql": "{%- macro union_relations(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n {%- set source_column_name = source_column_name if source_column_name is not none else '_dbt_source_relation' -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt_utils.string_literal(relation) }} as {{ dbt_utils.type_string() }}) as {{ source_column_name }},\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ aliases[loop.index0] if aliases else relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.245984, "supported_languages": null}, "macro.fivetran_utils.union_tables": {"unique_id": "macro.fivetran_utils.union_tables", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "name": "union_tables", "macro_sql": "{%- macro union_tables(tables, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_table') -%}\n\n {%- do exceptions.warn(\"Warning: the `union_tables` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use the `union_relations` macro instead\") -%}\n\n {{ return(dbt_utils.union_relations(tables, column_override, include, exclude, source_column_name)) }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.246339, "supported_languages": null}, "macro.fivetran_utils.snowflake_seed_data": {"unique_id": "macro.fivetran_utils.snowflake_seed_data", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/snowflake_seed_data.sql", "original_file_path": "macros/snowflake_seed_data.sql", "name": "snowflake_seed_data", "macro_sql": "{% macro snowflake_seed_data(seed_name) %}\n\n{% if target.type == 'snowflake' %}\n{{ return(ref(seed_name ~ '_snowflake')) }}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.246758, "supported_languages": null}, "macro.fivetran_utils.fill_staging_columns": {"unique_id": "macro.fivetran_utils.fill_staging_columns", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "name": "fill_staging_columns", "macro_sql": "{% macro fill_staging_columns(source_columns, staging_columns) -%}\n\n{%- set source_column_names = source_columns|map(attribute='name')|map('lower')|list -%}\n\n{%- for column in staging_columns %}\n {% if column.name|lower in source_column_names -%}\n {{ fivetran_utils.quote_column(column) }} as \n {%- if 'alias' in column %} {{ column.alias }} {% else %} {{ fivetran_utils.quote_column(column) }} {%- endif -%}\n {%- else -%}\n cast(null as {{ column.datatype }})\n {%- if 'alias' in column %} as {{ column.alias }} {% else %} as {{ fivetran_utils.quote_column(column) }} {% endif -%}\n {%- endif -%}\n {%- if not loop.last -%} , {% endif -%}\n{% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.quote_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.248277, "supported_languages": null}, "macro.fivetran_utils.quote_column": {"unique_id": "macro.fivetran_utils.quote_column", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "name": "quote_column", "macro_sql": "{% macro quote_column(column) %}\n {% if 'quote' in column %}\n {% if column.quote %}\n {% if target.type in ('bigquery', 'spark') %}\n `{{ column.name }}`\n {% elif target.type == 'snowflake' %}\n \"{{ column.name | upper }}\"\n {% else %}\n \"{{ column.name }}\"\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.248811, "supported_languages": null}, "macro.fivetran_utils.json_extract": {"unique_id": "macro.fivetran_utils.json_extract", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "json_extract", "macro_sql": "{% macro json_extract(string, string_path) -%}\n\n{{ adapter.dispatch('json_extract', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.249401, "supported_languages": null}, "macro.fivetran_utils.default__json_extract": {"unique_id": "macro.fivetran_utils.default__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "default__json_extract", "macro_sql": "{% macro default__json_extract(string, string_path) %}\n\n json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} )\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2495518, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_extract": {"unique_id": "macro.fivetran_utils.snowflake__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "snowflake__json_extract", "macro_sql": "{% macro snowflake__json_extract(string, string_path) %}\n\n json_extract_path_text(try_parse_json( {{string}} ), {{ \"'\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2497, "supported_languages": null}, "macro.fivetran_utils.redshift__json_extract": {"unique_id": "macro.fivetran_utils.redshift__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "redshift__json_extract", "macro_sql": "{% macro redshift__json_extract(string, string_path) %}\n\n case when is_valid_json( {{string}} ) then json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} ) else null end\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.249861, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_extract": {"unique_id": "macro.fivetran_utils.bigquery__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "bigquery__json_extract", "macro_sql": "{% macro bigquery__json_extract(string, string_path) %}\n\n json_extract_scalar({{string}}, {{ \"'$.\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.250009, "supported_languages": null}, "macro.fivetran_utils.postgres__json_extract": {"unique_id": "macro.fivetran_utils.postgres__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "postgres__json_extract", "macro_sql": "{% macro postgres__json_extract(string, string_path) %}\n\n {{string}}::json->>{{\"'\" ~ string_path ~ \"'\" }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.25015, "supported_languages": null}, "macro.fivetran_utils.collect_freshness": {"unique_id": "macro.fivetran_utils.collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "name": "collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness')(source, loaded_at_field, filter))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.25086, "supported_languages": null}, "macro.fivetran_utils.default__collect_freshness": {"unique_id": "macro.fivetran_utils.default__collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "name": "default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n\n {%- set enabled_array = [] -%}\n {% for node in graph.sources.values() %}\n {% if node.identifier == source.identifier %}\n {% if (node.meta['is_enabled'] | default(true)) %}\n {%- do enabled_array.append(1) -%}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% set is_enabled = (enabled_array != []) %}\n\n select\n {% if is_enabled %}\n max({{ loaded_at_field }})\n {% else %} \n {{ current_timestamp() }} {% endif %} as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n\n {% if is_enabled %}\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endif %}\n\n {% endcall %}\n {{ return(load_result('collect_freshness').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2518022, "supported_languages": null}, "macro.fivetran_utils.timestamp_add": {"unique_id": "macro.fivetran_utils.timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "timestamp_add", "macro_sql": "{% macro timestamp_add(datepart, interval, from_timestamp) -%}\n\n{{ adapter.dispatch('timestamp_add', 'fivetran_utils') (datepart, interval, from_timestamp) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__timestamp_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2524989, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_add": {"unique_id": "macro.fivetran_utils.default__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "default__timestamp_add", "macro_sql": "{% macro default__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestampadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2526588, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_add": {"unique_id": "macro.fivetran_utils.bigquery__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "bigquery__timestamp_add", "macro_sql": "{% macro bigquery__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestamp_add({{ from_timestamp }}, interval {{ interval }} {{ datepart }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.25281, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_add": {"unique_id": "macro.fivetran_utils.redshift__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "redshift__timestamp_add", "macro_sql": "{% macro redshift__timestamp_add(datepart, interval, from_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2529652, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_add": {"unique_id": "macro.fivetran_utils.postgres__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "postgres__timestamp_add", "macro_sql": "{% macro postgres__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ from_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2531211, "supported_languages": null}, "macro.fivetran_utils.spark__timestamp_add": {"unique_id": "macro.fivetran_utils.spark__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "spark__timestamp_add", "macro_sql": "{% macro spark__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ dbt.dateadd(datepart, interval, from_timestamp) }}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2532952, "supported_languages": null}, "macro.fivetran_utils.ceiling": {"unique_id": "macro.fivetran_utils.ceiling", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "ceiling", "macro_sql": "{% macro ceiling(num) -%}\n\n{{ adapter.dispatch('ceiling', 'fivetran_utils') (num) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__ceiling"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2535932, "supported_languages": null}, "macro.fivetran_utils.default__ceiling": {"unique_id": "macro.fivetran_utils.default__ceiling", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "default__ceiling", "macro_sql": "{% macro default__ceiling(num) %}\n ceiling({{ num }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2536929, "supported_languages": null}, "macro.fivetran_utils.snowflake__ceiling": {"unique_id": "macro.fivetran_utils.snowflake__ceiling", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "snowflake__ceiling", "macro_sql": "{% macro snowflake__ceiling(num) %}\n ceil({{ num }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2538571, "supported_languages": null}, "macro.fivetran_utils.remove_prefix_from_columns": {"unique_id": "macro.fivetran_utils.remove_prefix_from_columns", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/remove_prefix_from_columns.sql", "original_file_path": "macros/remove_prefix_from_columns.sql", "name": "remove_prefix_from_columns", "macro_sql": "{% macro remove_prefix_from_columns(columns, prefix='', exclude=[]) %}\n\n {%- for col in columns if col.name not in exclude -%}\n {%- if col.name[:prefix|length]|lower == prefix -%}\n {{ col.name }} as {{ col.name[prefix|length:] }}\n {%- else -%}\n {{ col.name }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {% endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2545202, "supported_languages": null}, "macro.fivetran_utils.union_data": {"unique_id": "macro.fivetran_utils.union_data", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "name": "union_data", "macro_sql": "{% macro union_data(table_identifier, database_variable, schema_variable, default_database, default_schema, default_variable, union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('union_data', 'fivetran_utils') (\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__union_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2558541, "supported_languages": null}, "macro.fivetran_utils.default__union_data": {"unique_id": "macro.fivetran_utils.default__union_data", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "name": "default__union_data", "macro_sql": "{% macro default__union_data(\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) %}\n\n{% if var(union_schema_variable, none) %}\n\n {% set relations = [] %}\n \n {% if var(union_schema_variable) is string %}\n {% set trimmed = var(union_schema_variable)|trim('[')|trim(']') %}\n {% set schemas = trimmed.split(',')|map('trim',\" \")|map('trim','\"')|map('trim',\"'\") %}\n {% else %}\n {% set schemas = var(union_schema_variable) %}\n {% endif %}\n\n {% for schema in var(union_schema_variable) %}\n {% set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else var(database_variable, default_database),\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else schema,\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n \n {% set relation_exists=relation is not none %}\n\n {% if relation_exists %}\n\n {% do relations.append(relation) %}\n \n {% endif %}\n\n {% endfor %}\n\n {{ dbt_utils.union_relations(relations) }}\n\n{% elif var(union_database_variable, none) %}\n\n {% set relations = [] %}\n\n {% for database in var(union_database_variable) %}\n\n {% set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else database,\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else var(schema_variable, default_schema),\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n\n {% set relation_exists=relation is not none %}\n\n {% if relation_exists %}\n\n {% do relations.append(relation) %}\n \n {% endif %}\n\n {% endfor %}\n\n {{ dbt_utils.union_relations(relations) }}\n\n{% else %}\n\n select * \n from {{ var(default_variable) }}\n\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.258189, "supported_languages": null}, "macro.fivetran_utils.dummy_coalesce_value": {"unique_id": "macro.fivetran_utils.dummy_coalesce_value", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/dummy_coalesce_value.sql", "original_file_path": "macros/dummy_coalesce_value.sql", "name": "dummy_coalesce_value", "macro_sql": "{% macro dummy_coalesce_value(column) %}\n\n{% set coalesce_value = {\n 'STRING': \"'DUMMY_STRING'\",\n 'BOOLEAN': 'null',\n 'INT': 999999999,\n 'FLOAT': 999999999.99,\n 'TIMESTAMP': 'cast(\"2099-12-31\" as timestamp)',\n 'DATE': 'cast(\"2099-12-31\" as date)',\n} %}\n\n{% if column.is_float() %}\n{{ return(coalesce_value['FLOAT']) }}\n\n{% elif column.is_numeric() %}\n{{ return(coalesce_value['INT']) }}\n\n{% elif column.is_string() %}\n{{ return(coalesce_value['STRING']) }}\n\n{% elif column.data_type|lower == 'boolean' %}\n{{ return(coalesce_value['BOOLEAN']) }}\n\n{% elif 'timestamp' in column.data_type|lower %}\n{{ return(coalesce_value['TIMESTAMP']) }}\n\n{% elif 'date' in column.data_type|lower %}\n{{ return(coalesce_value['DATE']) }}\n\n{% elif 'int' in column.data_type|lower %}\n{{ return(coalesce_value['INT']) }}\n\n{% endif %}\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.259596, "supported_languages": null}, "macro.fivetran_utils.array_agg": {"unique_id": "macro.fivetran_utils.array_agg", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "array_agg", "macro_sql": "{% macro array_agg(field_to_agg) -%}\n\n{{ adapter.dispatch('array_agg', 'fivetran_utils') (field_to_agg) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__array_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.259916, "supported_languages": null}, "macro.fivetran_utils.default__array_agg": {"unique_id": "macro.fivetran_utils.default__array_agg", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "default__array_agg", "macro_sql": "{% macro default__array_agg(field_to_agg) %}\n array_agg({{ field_to_agg }})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2600162, "supported_languages": null}, "macro.fivetran_utils.redshift__array_agg": {"unique_id": "macro.fivetran_utils.redshift__array_agg", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "redshift__array_agg", "macro_sql": "{% macro redshift__array_agg(field_to_agg) %}\n listagg({{ field_to_agg }}, ',')\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2601101, "supported_languages": null}, "macro.fivetran_utils.empty_variable_warning": {"unique_id": "macro.fivetran_utils.empty_variable_warning", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/empty_variable_warning.sql", "original_file_path": "macros/empty_variable_warning.sql", "name": "empty_variable_warning", "macro_sql": "{% macro empty_variable_warning(variable, downstream_model) %}\n\n{% if not var(variable) %}\n{{ log(\n \"\"\"\n Warning: You have passed an empty list to the \"\"\" ~ variable ~ \"\"\".\n As a result, you won't see the history of any columns in the \"\"\" ~ downstream_model ~ \"\"\" model.\n \"\"\",\n info=True\n) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.260548, "supported_languages": null}, "macro.fivetran_utils.enabled_vars_one_true": {"unique_id": "macro.fivetran_utils.enabled_vars_one_true", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/enabled_vars_one_true.sql", "original_file_path": "macros/enabled_vars_one_true.sql", "name": "enabled_vars_one_true", "macro_sql": "{% macro enabled_vars_one_true(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, False) == True %}\n {{ return(True) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(False) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.260982, "supported_languages": null}, "macro.github_source.get_issue_columns": {"unique_id": "macro.github_source.get_issue_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_columns.sql", "original_file_path": "macros/get_issue_columns.sql", "name": "get_issue_columns", "macro_sql": "{% macro get_issue_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"body\", \"datatype\": dbt.type_string()},\n {\"name\": \"closed_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"locked\", \"datatype\": \"boolean\"},\n {\"name\": \"milestone_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"number\", \"datatype\": dbt.type_int()},\n {\"name\": \"pull_request\", \"datatype\": \"boolean\"},\n {\"name\": \"repository_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"state\", \"datatype\": dbt.type_string()},\n {\"name\": \"title\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"user_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.262527, "supported_languages": null}, "macro.github_source.get_issue_comment_columns": {"unique_id": "macro.github_source.get_issue_comment_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_comment_columns.sql", "original_file_path": "macros/get_issue_comment_columns.sql", "name": "get_issue_comment_columns", "macro_sql": "{% macro get_issue_comment_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"body\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"user_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2634282, "supported_languages": null}, "macro.github_source.get_repository_columns": {"unique_id": "macro.github_source.get_repository_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_repository_columns.sql", "original_file_path": "macros/get_repository_columns.sql", "name": "get_repository_columns", "macro_sql": "{% macro get_repository_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"archived\", \"datatype\": \"boolean\"},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"default_branch\", \"datatype\": dbt.type_string()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"fork\", \"datatype\": \"boolean\"},\n {\"name\": \"full_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"homepage\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"language\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"owner_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"private\", \"datatype\": \"boolean\"}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2648478, "supported_languages": null}, "macro.github_source.get_issue_merged_columns": {"unique_id": "macro.github_source.get_issue_merged_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_merged_columns.sql", "original_file_path": "macros/get_issue_merged_columns.sql", "name": "get_issue_merged_columns", "macro_sql": "{% macro get_issue_merged_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"actor_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"commit_sha\", \"datatype\": dbt.type_string()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"merged_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2655602, "supported_languages": null}, "macro.github_source.get_pull_request_review_columns": {"unique_id": "macro.github_source.get_pull_request_review_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_pull_request_review_columns.sql", "original_file_path": "macros/get_pull_request_review_columns.sql", "name": "get_pull_request_review_columns", "macro_sql": "{% macro get_pull_request_review_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"body\", \"datatype\": dbt.type_string()},\n {\"name\": \"commit_sha\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"pull_request_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"state\", \"datatype\": dbt.type_string()},\n {\"name\": \"submitted_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"user_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.266547, "supported_languages": null}, "macro.github_source.get_team_columns": {"unique_id": "macro.github_source.get_team_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_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_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"org_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"parent_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"privacy\", \"datatype\": dbt.type_string()},\n {\"name\": \"slug\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.267533, "supported_languages": null}, "macro.github_source.get_issue_assignee_columns": {"unique_id": "macro.github_source.get_issue_assignee_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_assignee_columns.sql", "original_file_path": "macros/get_issue_assignee_columns.sql", "name": "get_issue_assignee_columns", "macro_sql": "{% macro get_issue_assignee_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"user_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.268065, "supported_languages": null}, "macro.github_source.get_user_columns": {"unique_id": "macro.github_source.get_user_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_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\": \"company\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"login\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.268678, "supported_languages": null}, "macro.github_source.get_label_columns": {"unique_id": "macro.github_source.get_label_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_label_columns.sql", "original_file_path": "macros/get_label_columns.sql", "name": "get_label_columns", "macro_sql": "{% macro get_label_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"color\", \"datatype\": dbt.type_string()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"is_default\", \"datatype\": \"boolean\"},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"url\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.269556, "supported_languages": null}, "macro.github_source.get_pull_request_columns": {"unique_id": "macro.github_source.get_pull_request_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_pull_request_columns.sql", "original_file_path": "macros/get_pull_request_columns.sql", "name": "get_pull_request_columns", "macro_sql": "{% macro get_pull_request_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"base_label\", \"datatype\": dbt.type_string()},\n {\"name\": \"base_ref\", \"datatype\": dbt.type_string()},\n {\"name\": \"base_repo_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"base_sha\", \"datatype\": dbt.type_string()},\n {\"name\": \"base_user_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"head_label\", \"datatype\": dbt.type_string()},\n {\"name\": \"head_ref\", \"datatype\": dbt.type_string()},\n {\"name\": \"head_repo_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"head_sha\", \"datatype\": dbt.type_string()},\n {\"name\": \"head_user_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"merge_commit_sha\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2711759, "supported_languages": null}, "macro.github_source.get_requested_reviewer_history_columns": {"unique_id": "macro.github_source.get_requested_reviewer_history_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_requested_reviewer_history_columns.sql", "original_file_path": "macros/get_requested_reviewer_history_columns.sql", "name": "get_requested_reviewer_history_columns", "macro_sql": "{% macro get_requested_reviewer_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"actor_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"pull_request_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"removed\", \"datatype\": \"boolean\"},\n {\"name\": \"requested_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.271967, "supported_languages": null}, "macro.github_source.get_issue_closed_history_columns": {"unique_id": "macro.github_source.get_issue_closed_history_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_closed_history_columns.sql", "original_file_path": "macros/get_issue_closed_history_columns.sql", "name": "get_issue_closed_history_columns", "macro_sql": "{% macro get_issue_closed_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"actor_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"closed\", \"datatype\": \"boolean\"},\n {\"name\": \"commit_sha\", \"datatype\": dbt.type_string()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2727501, "supported_languages": null}, "macro.github_source.get_repo_team_columns": {"unique_id": "macro.github_source.get_repo_team_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_repo_team_columns.sql", "original_file_path": "macros/get_repo_team_columns.sql", "name": "get_repo_team_columns", "macro_sql": "{% macro get_repo_team_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"permission\", \"datatype\": dbt.type_string()},\n {\"name\": \"repository_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"team_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.273362, "supported_languages": null}, "macro.github_source.get_issue_label_columns": {"unique_id": "macro.github_source.get_issue_label_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_label_columns.sql", "original_file_path": "macros/get_issue_label_columns.sql", "name": "get_issue_label_columns", "macro_sql": "{% macro get_issue_label_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"label_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2738838, "supported_languages": null}}, "docs": {"dbt.__overview__": {"unique_id": "dbt.__overview__", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "overview.md", "original_file_path": "docs/overview.md", "name": "__overview__", "block_contents": "### Welcome!\n\nWelcome to the auto-generated documentation for your dbt project!\n\n### Navigation\n\nYou can use the `Project` and `Database` navigation tabs on the left side of the window to explore the models\nin your project.\n\n#### Project Tab\nThe `Project` tab mirrors the directory structure of your dbt project. In this tab, you can see all of the\nmodels defined in your dbt project, as well as models imported from dbt packages.\n\n#### Database Tab\nThe `Database` tab also exposes your models, but in a format that looks more like a database explorer. This view\nshows relations (tables and views) grouped into database schemas. Note that ephemeral models are _not_ shown\nin this interface, as they do not exist in the database.\n\n### Graph Exploration\nYou can click the blue icon on the bottom-right corner of the page to view the lineage graph of your models.\n\nOn model pages, you'll see the immediate parents and children of the model you're exploring. By clicking the `Expand`\nbutton at the top-right of this lineage pane, you'll be able to see all of the models that are used to build,\nor are built from, the model you're exploring.\n\nOnce expanded, you'll be able to use the `--select` and `--exclude` model selection syntax to filter the\nmodels in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax).\n\nNote that you can also right-click on models to interactively filter and explore the graph.\n\n---\n\n### More information\n\n- [What is dbt](https://docs.getdbt.com/docs/introduction)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [dbt Community](https://www.getdbt.com/community/) for questions and discussion"}}, "exposures": {}, "metrics": {}, "selectors": {}, "disabled": {}, "parent_map": {"seed.github_integration_tests.github_pull_request_review_data": [], "seed.github_integration_tests.github_label_data": [], "seed.github_integration_tests.github_repository_data": [], "seed.github_integration_tests.github_issue_merged_data": [], "seed.github_integration_tests.github_issue_data": [], "seed.github_integration_tests.github_repo_team_data": [], "seed.github_integration_tests.github_requested_reviewer_history_data": [], "seed.github_integration_tests.github_issue_label_data": [], "seed.github_integration_tests.github_issue_comment_data": [], "seed.github_integration_tests.github_issue_assignee_data": [], "seed.github_integration_tests.github_issue_closed_history_data": [], "seed.github_integration_tests.github_pull_request_data": [], "seed.github_integration_tests.github_team_data": [], "seed.github_integration_tests.github_user_data": [], "model.github.github__weekly_metrics": ["model.github.github__daily_metrics"], "model.github.github__monthly_metrics": ["model.github.github__daily_metrics"], "model.github.github__quarterly_metrics": ["model.github.github__daily_metrics"], "model.github.github__pull_requests": ["model.github.int_github__issue_joined"], "model.github.github__daily_metrics": ["model.github.github__issues", "model.github.github__pull_requests"], "model.github.github__issues": ["model.github.int_github__issue_joined"], "model.github.int_github__pull_request_times": ["model.github_source.stg_github__issue", "model.github_source.stg_github__issue_merged", "model.github_source.stg_github__pull_request", "model.github_source.stg_github__pull_request_review", "model.github_source.stg_github__requested_reviewer_history"], "model.github.int_github__pull_request_reviewers": ["model.github_source.stg_github__pull_request_review", "model.github_source.stg_github__user"], "model.github.int_github__issue_label_joined": ["model.github_source.stg_github__issue_label", "model.github_source.stg_github__label"], "model.github.int_github__issue_joined": ["model.github.int_github__issue_assignees", "model.github.int_github__issue_comments", "model.github.int_github__issue_labels", "model.github.int_github__issue_open_length", "model.github.int_github__pull_request_reviewers", "model.github.int_github__pull_request_times", "model.github.int_github__repository_teams", "model.github_source.stg_github__issue", "model.github_source.stg_github__pull_request", "model.github_source.stg_github__user"], "model.github.int_github__issue_labels": ["model.github.int_github__issue_label_joined"], "model.github.int_github__issue_assignees": ["model.github_source.stg_github__issue_assignee", "model.github_source.stg_github__user"], "model.github.int_github__issue_comments": ["model.github_source.stg_github__issue_comment"], "model.github.int_github__issue_open_length": ["model.github_source.stg_github__issue", "model.github_source.stg_github__issue_closed_history"], "model.github.int_github__repository_teams": ["model.github_source.stg_github__repo_team", "model.github_source.stg_github__repository", "model.github_source.stg_github__team"], "model.github_source.stg_github__issue_comment": ["model.github_source.stg_github__issue_comment_tmp", "model.github_source.stg_github__issue_comment_tmp"], "model.github_source.stg_github__requested_reviewer_history": ["model.github_source.stg_github__requested_reviewer_history_tmp", "model.github_source.stg_github__requested_reviewer_history_tmp"], "model.github_source.stg_github__issue_label": ["model.github_source.stg_github__issue_label_tmp", "model.github_source.stg_github__issue_label_tmp"], "model.github_source.stg_github__issue_merged": ["model.github_source.stg_github__issue_merged_tmp", "model.github_source.stg_github__issue_merged_tmp"], "model.github_source.stg_github__issue_closed_history": ["model.github_source.stg_github__issue_closed_history_tmp", "model.github_source.stg_github__issue_closed_history_tmp"], "model.github_source.stg_github__issue_assignee": ["model.github_source.stg_github__issue_assignee_tmp", "model.github_source.stg_github__issue_assignee_tmp"], "model.github_source.stg_github__repository": ["model.github_source.stg_github__repository_tmp", "model.github_source.stg_github__repository_tmp"], "model.github_source.stg_github__user": ["model.github_source.stg_github__user_tmp", "model.github_source.stg_github__user_tmp"], "model.github_source.stg_github__pull_request_review": ["model.github_source.stg_github__pull_request_review_tmp", "model.github_source.stg_github__pull_request_review_tmp"], "model.github_source.stg_github__repo_team": ["model.github_source.stg_github__repo_team_tmp", "model.github_source.stg_github__repo_team_tmp"], "model.github_source.stg_github__label": ["model.github_source.stg_github__label_tmp", "model.github_source.stg_github__label_tmp"], "model.github_source.stg_github__issue": ["model.github_source.stg_github__issue_tmp", "model.github_source.stg_github__issue_tmp"], "model.github_source.stg_github__team": ["model.github_source.stg_github__team_tmp", "model.github_source.stg_github__team_tmp"], "model.github_source.stg_github__pull_request": ["model.github_source.stg_github__pull_request_tmp", "model.github_source.stg_github__pull_request_tmp"], "model.github_source.stg_github__repository_tmp": ["source.github_source.github.repository"], "model.github_source.stg_github__label_tmp": ["source.github_source.github.label"], "model.github_source.stg_github__requested_reviewer_history_tmp": ["source.github_source.github.requested_reviewer_history"], "model.github_source.stg_github__issue_comment_tmp": ["source.github_source.github.issue_comment"], "model.github_source.stg_github__pull_request_review_tmp": ["source.github_source.github.pull_request_review"], "model.github_source.stg_github__issue_label_tmp": ["source.github_source.github.issue_label"], "model.github_source.stg_github__team_tmp": ["source.github_source.github.team"], "model.github_source.stg_github__pull_request_tmp": ["source.github_source.github.pull_request"], "model.github_source.stg_github__issue_merged_tmp": ["source.github_source.github.issue_merged"], "model.github_source.stg_github__user_tmp": ["source.github_source.github.user"], "model.github_source.stg_github__issue_closed_history_tmp": ["source.github_source.github.issue_closed_history"], "model.github_source.stg_github__issue_assignee_tmp": ["source.github_source.github.issue_assignee"], "model.github_source.stg_github__issue_tmp": ["source.github_source.github.issue"], "model.github_source.stg_github__repo_team_tmp": ["source.github_source.github.repo_team"], "test.github.unique_github__issues_issue_id.6723b9b1db": ["model.github.github__issues"], "test.github.not_null_github__issues_issue_id.fed0631e25": ["model.github.github__issues"], "test.github.unique_github__pull_requests_issue_id.ce23997907": ["model.github.github__pull_requests"], "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f": ["model.github.github__pull_requests"], "test.github.unique_github__daily_metrics_day.f98cab9456": ["model.github.github__daily_metrics"], "test.github.not_null_github__daily_metrics_day.647e494434": ["model.github.github__daily_metrics"], "test.github.unique_github__weekly_metrics_week.6794858a8e": ["model.github.github__weekly_metrics"], "test.github.not_null_github__weekly_metrics_week.4b0b928243": ["model.github.github__weekly_metrics"], "test.github.unique_github__monthly_metrics_month.3076284fbb": ["model.github.github__monthly_metrics"], "test.github.not_null_github__monthly_metrics_month.9e4fba84df": ["model.github.github__monthly_metrics"], "test.github.unique_github__quarterly_metrics_quarter.9165a921c1": ["model.github.github__quarterly_metrics"], "test.github.not_null_github__quarterly_metrics_quarter.92394d46dc": ["model.github.github__quarterly_metrics"], "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4": ["model.github_source.stg_github__issue_assignee"], "test.github_source.not_null_stg_github__label_label_id.9f07379974": ["model.github_source.stg_github__label"], "test.github_source.unique_stg_github__label_label_id.74d3c21466": ["model.github_source.stg_github__label"], "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d": ["model.github_source.stg_github__issue_closed_history"], "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a": ["model.github_source.stg_github__issue_comment"], "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f": ["model.github_source.stg_github__issue_comment"], "test.github_source.unique_stg_github__issue_issue_id.84891aeece": ["model.github_source.stg_github__issue"], "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7": ["model.github_source.stg_github__issue"], "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508": ["model.github_source.stg_github__pull_request_review"], "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790": ["model.github_source.stg_github__pull_request_review"], "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa": ["model.github_source.stg_github__pull_request"], "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71": ["model.github_source.stg_github__pull_request"], "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503": ["model.github_source.stg_github__repo_team"], "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c": ["model.github_source.stg_github__repo_team"], "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d": ["model.github_source.stg_github__repository"], "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f": ["model.github_source.stg_github__repository"], "test.github_source.unique_stg_github__team_team_id.94e9716ab4": ["model.github_source.stg_github__team"], "test.github_source.not_null_stg_github__team_team_id.440aefe7a7": ["model.github_source.stg_github__team"], "test.github_source.unique_stg_github__user_user_id.5c1a00cd90": ["model.github_source.stg_github__user"], "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b": ["model.github_source.stg_github__user"], "source.github_source.github.issue_assignee": [], "source.github_source.github.label": [], "source.github_source.github.issue_closed_history": [], "source.github_source.github.issue_label": [], "source.github_source.github.issue_comment": [], "source.github_source.github.issue_merged": [], "source.github_source.github.issue": [], "source.github_source.github.pull_request_review": [], "source.github_source.github.pull_request": [], "source.github_source.github.repo_team": [], "source.github_source.github.repository": [], "source.github_source.github.requested_reviewer_history": [], "source.github_source.github.team": [], "source.github_source.github.user": []}, "child_map": {"seed.github_integration_tests.github_pull_request_review_data": [], "seed.github_integration_tests.github_label_data": [], "seed.github_integration_tests.github_repository_data": [], "seed.github_integration_tests.github_issue_merged_data": [], "seed.github_integration_tests.github_issue_data": [], "seed.github_integration_tests.github_repo_team_data": [], "seed.github_integration_tests.github_requested_reviewer_history_data": [], "seed.github_integration_tests.github_issue_label_data": [], "seed.github_integration_tests.github_issue_comment_data": [], "seed.github_integration_tests.github_issue_assignee_data": [], "seed.github_integration_tests.github_issue_closed_history_data": [], "seed.github_integration_tests.github_pull_request_data": [], "seed.github_integration_tests.github_team_data": [], "seed.github_integration_tests.github_user_data": [], "model.github.github__weekly_metrics": ["test.github.not_null_github__weekly_metrics_week.4b0b928243", "test.github.unique_github__weekly_metrics_week.6794858a8e"], "model.github.github__monthly_metrics": ["test.github.not_null_github__monthly_metrics_month.9e4fba84df", "test.github.unique_github__monthly_metrics_month.3076284fbb"], "model.github.github__quarterly_metrics": ["test.github.not_null_github__quarterly_metrics_quarter.92394d46dc", "test.github.unique_github__quarterly_metrics_quarter.9165a921c1"], "model.github.github__pull_requests": ["model.github.github__daily_metrics", "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f", "test.github.unique_github__pull_requests_issue_id.ce23997907"], "model.github.github__daily_metrics": ["model.github.github__monthly_metrics", "model.github.github__quarterly_metrics", "model.github.github__weekly_metrics", "test.github.not_null_github__daily_metrics_day.647e494434", "test.github.unique_github__daily_metrics_day.f98cab9456"], "model.github.github__issues": ["model.github.github__daily_metrics", "test.github.not_null_github__issues_issue_id.fed0631e25", "test.github.unique_github__issues_issue_id.6723b9b1db"], "model.github.int_github__pull_request_times": ["model.github.int_github__issue_joined"], "model.github.int_github__pull_request_reviewers": ["model.github.int_github__issue_joined"], "model.github.int_github__issue_label_joined": ["model.github.int_github__issue_labels"], "model.github.int_github__issue_joined": ["model.github.github__issues", "model.github.github__pull_requests"], "model.github.int_github__issue_labels": ["model.github.int_github__issue_joined"], "model.github.int_github__issue_assignees": ["model.github.int_github__issue_joined"], "model.github.int_github__issue_comments": ["model.github.int_github__issue_joined"], "model.github.int_github__issue_open_length": ["model.github.int_github__issue_joined"], "model.github.int_github__repository_teams": ["model.github.int_github__issue_joined"], "model.github_source.stg_github__issue_comment": ["model.github.int_github__issue_comments", "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f", "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a"], "model.github_source.stg_github__requested_reviewer_history": ["model.github.int_github__pull_request_times"], "model.github_source.stg_github__issue_label": ["model.github.int_github__issue_label_joined"], "model.github_source.stg_github__issue_merged": ["model.github.int_github__pull_request_times"], "model.github_source.stg_github__issue_closed_history": ["model.github.int_github__issue_open_length", "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d"], "model.github_source.stg_github__issue_assignee": ["model.github.int_github__issue_assignees", "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4"], "model.github_source.stg_github__repository": ["model.github.int_github__repository_teams", "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f", "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d"], "model.github_source.stg_github__user": ["model.github.int_github__issue_assignees", "model.github.int_github__issue_joined", "model.github.int_github__pull_request_reviewers", "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b", "test.github_source.unique_stg_github__user_user_id.5c1a00cd90"], "model.github_source.stg_github__pull_request_review": ["model.github.int_github__pull_request_reviewers", "model.github.int_github__pull_request_times", "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790", "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508"], "model.github_source.stg_github__repo_team": ["model.github.int_github__repository_teams", "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503", "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c"], "model.github_source.stg_github__label": ["model.github.int_github__issue_label_joined", "test.github_source.not_null_stg_github__label_label_id.9f07379974", "test.github_source.unique_stg_github__label_label_id.74d3c21466"], "model.github_source.stg_github__issue": ["model.github.int_github__issue_joined", "model.github.int_github__issue_open_length", "model.github.int_github__pull_request_times", "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7", "test.github_source.unique_stg_github__issue_issue_id.84891aeece"], "model.github_source.stg_github__team": ["model.github.int_github__repository_teams", "test.github_source.not_null_stg_github__team_team_id.440aefe7a7", "test.github_source.unique_stg_github__team_team_id.94e9716ab4"], "model.github_source.stg_github__pull_request": ["model.github.int_github__issue_joined", "model.github.int_github__pull_request_times", "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71", "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa"], "model.github_source.stg_github__repository_tmp": ["model.github_source.stg_github__repository", "model.github_source.stg_github__repository"], "model.github_source.stg_github__label_tmp": ["model.github_source.stg_github__label", "model.github_source.stg_github__label"], "model.github_source.stg_github__requested_reviewer_history_tmp": ["model.github_source.stg_github__requested_reviewer_history", "model.github_source.stg_github__requested_reviewer_history"], "model.github_source.stg_github__issue_comment_tmp": ["model.github_source.stg_github__issue_comment", "model.github_source.stg_github__issue_comment"], "model.github_source.stg_github__pull_request_review_tmp": ["model.github_source.stg_github__pull_request_review", "model.github_source.stg_github__pull_request_review"], "model.github_source.stg_github__issue_label_tmp": ["model.github_source.stg_github__issue_label", "model.github_source.stg_github__issue_label"], "model.github_source.stg_github__team_tmp": ["model.github_source.stg_github__team", "model.github_source.stg_github__team"], "model.github_source.stg_github__pull_request_tmp": ["model.github_source.stg_github__pull_request", "model.github_source.stg_github__pull_request"], "model.github_source.stg_github__issue_merged_tmp": ["model.github_source.stg_github__issue_merged", "model.github_source.stg_github__issue_merged"], "model.github_source.stg_github__user_tmp": ["model.github_source.stg_github__user", "model.github_source.stg_github__user"], "model.github_source.stg_github__issue_closed_history_tmp": ["model.github_source.stg_github__issue_closed_history", "model.github_source.stg_github__issue_closed_history"], "model.github_source.stg_github__issue_assignee_tmp": ["model.github_source.stg_github__issue_assignee", "model.github_source.stg_github__issue_assignee"], "model.github_source.stg_github__issue_tmp": ["model.github_source.stg_github__issue", "model.github_source.stg_github__issue"], "model.github_source.stg_github__repo_team_tmp": ["model.github_source.stg_github__repo_team", "model.github_source.stg_github__repo_team"], "test.github.unique_github__issues_issue_id.6723b9b1db": [], "test.github.not_null_github__issues_issue_id.fed0631e25": [], "test.github.unique_github__pull_requests_issue_id.ce23997907": [], "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f": [], "test.github.unique_github__daily_metrics_day.f98cab9456": [], "test.github.not_null_github__daily_metrics_day.647e494434": [], "test.github.unique_github__weekly_metrics_week.6794858a8e": [], "test.github.not_null_github__weekly_metrics_week.4b0b928243": [], "test.github.unique_github__monthly_metrics_month.3076284fbb": [], "test.github.not_null_github__monthly_metrics_month.9e4fba84df": [], "test.github.unique_github__quarterly_metrics_quarter.9165a921c1": [], "test.github.not_null_github__quarterly_metrics_quarter.92394d46dc": [], "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4": [], "test.github_source.not_null_stg_github__label_label_id.9f07379974": [], "test.github_source.unique_stg_github__label_label_id.74d3c21466": [], "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d": [], "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a": [], "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f": [], "test.github_source.unique_stg_github__issue_issue_id.84891aeece": [], "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7": [], "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508": [], "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790": [], "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa": [], "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71": [], "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503": [], "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c": [], "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d": [], "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f": [], "test.github_source.unique_stg_github__team_team_id.94e9716ab4": [], "test.github_source.not_null_stg_github__team_team_id.440aefe7a7": [], "test.github_source.unique_stg_github__user_user_id.5c1a00cd90": [], "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b": [], "source.github_source.github.issue_assignee": ["model.github_source.stg_github__issue_assignee_tmp"], "source.github_source.github.label": ["model.github_source.stg_github__label_tmp"], "source.github_source.github.issue_closed_history": ["model.github_source.stg_github__issue_closed_history_tmp"], "source.github_source.github.issue_label": ["model.github_source.stg_github__issue_label_tmp"], "source.github_source.github.issue_comment": ["model.github_source.stg_github__issue_comment_tmp"], "source.github_source.github.issue_merged": ["model.github_source.stg_github__issue_merged_tmp"], "source.github_source.github.issue": ["model.github_source.stg_github__issue_tmp"], "source.github_source.github.pull_request_review": ["model.github_source.stg_github__pull_request_review_tmp"], "source.github_source.github.pull_request": ["model.github_source.stg_github__pull_request_tmp"], "source.github_source.github.repo_team": ["model.github_source.stg_github__repo_team_tmp"], "source.github_source.github.repository": ["model.github_source.stg_github__repository_tmp"], "source.github_source.github.requested_reviewer_history": ["model.github_source.stg_github__requested_reviewer_history_tmp"], "source.github_source.github.team": ["model.github_source.stg_github__team_tmp"], "source.github_source.github.user": ["model.github_source.stg_github__user_tmp"]}} \ No newline at end of file diff --git a/docs/run_results.json b/docs/run_results.json index 411daed..e756900 100644 --- a/docs/run_results.json +++ b/docs/run_results.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v4.json", "dbt_version": "1.3.0", "generated_at": "2022-10-26T19:31:50.516072Z", "invocation_id": "56400515-88f7-4836-88ef-853ef5bcc0a5", "env": {}}, "results": [{"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.066418Z", "completed_at": "2022-10-26T19:31:45.069292Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.069476Z", "completed_at": "2022-10-26T19:31:45.069504Z"}], "thread_id": "Thread-1", "execution_time": 0.003910064697265625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_assignee_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.070549Z", "completed_at": "2022-10-26T19:31:45.072124Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.072273Z", "completed_at": "2022-10-26T19:31:45.072279Z"}], "thread_id": "Thread-1", "execution_time": 0.0024938583374023438, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_closed_history_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.073310Z", "completed_at": "2022-10-26T19:31:45.077886Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.078055Z", "completed_at": "2022-10-26T19:31:45.078063Z"}], "thread_id": "Thread-1", "execution_time": 0.005511760711669922, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_comment_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.079220Z", "completed_at": "2022-10-26T19:31:45.080693Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.080835Z", "completed_at": "2022-10-26T19:31:45.080841Z"}], "thread_id": "Thread-1", "execution_time": 0.002401113510131836, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.081720Z", "completed_at": "2022-10-26T19:31:45.082968Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.083101Z", "completed_at": "2022-10-26T19:31:45.083106Z"}], "thread_id": "Thread-1", "execution_time": 0.001962900161743164, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_label_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.084019Z", "completed_at": "2022-10-26T19:31:45.085165Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.085298Z", "completed_at": "2022-10-26T19:31:45.085302Z"}], "thread_id": "Thread-1", "execution_time": 0.0019409656524658203, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_merged_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.086109Z", "completed_at": "2022-10-26T19:31:45.087263Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.087381Z", "completed_at": "2022-10-26T19:31:45.087385Z"}], "thread_id": "Thread-1", "execution_time": 0.0018391609191894531, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_label_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.088119Z", "completed_at": "2022-10-26T19:31:45.089260Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.089381Z", "completed_at": "2022-10-26T19:31:45.089385Z"}], "thread_id": "Thread-1", "execution_time": 0.0017900466918945312, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_pull_request_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.090094Z", "completed_at": "2022-10-26T19:31:45.092300Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.092507Z", "completed_at": "2022-10-26T19:31:45.092512Z"}], "thread_id": "Thread-1", "execution_time": 0.002965211868286133, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_pull_request_review_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.093310Z", "completed_at": "2022-10-26T19:31:45.094460Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.094583Z", "completed_at": "2022-10-26T19:31:45.094587Z"}], "thread_id": "Thread-1", "execution_time": 0.0018031597137451172, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_repo_team_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.095312Z", "completed_at": "2022-10-26T19:31:45.096420Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.096530Z", "completed_at": "2022-10-26T19:31:45.096534Z"}], "thread_id": "Thread-1", "execution_time": 0.0017201900482177734, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_repository_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.097214Z", "completed_at": "2022-10-26T19:31:45.098235Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.098346Z", "completed_at": "2022-10-26T19:31:45.098349Z"}], "thread_id": "Thread-1", "execution_time": 0.0016078948974609375, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_requested_reviewer_history_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.099043Z", "completed_at": "2022-10-26T19:31:45.100095Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.100206Z", "completed_at": "2022-10-26T19:31:45.100209Z"}], "thread_id": "Thread-1", "execution_time": 0.0016582012176513672, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_team_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.100908Z", "completed_at": "2022-10-26T19:31:45.101952Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.102069Z", "completed_at": "2022-10-26T19:31:45.102072Z"}], "thread_id": "Thread-1", "execution_time": 0.0017001628875732422, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_user_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.102897Z", "completed_at": "2022-10-26T19:31:45.105657Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.105787Z", "completed_at": "2022-10-26T19:31:45.105792Z"}], "thread_id": "Thread-1", "execution_time": 0.0033669471740722656, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_assignee_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.106520Z", "completed_at": "2022-10-26T19:31:45.109287Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.109420Z", "completed_at": "2022-10-26T19:31:45.109424Z"}], "thread_id": "Thread-1", "execution_time": 0.0034461021423339844, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_closed_history_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.110103Z", "completed_at": "2022-10-26T19:31:45.111985Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.112104Z", "completed_at": "2022-10-26T19:31:45.112108Z"}], "thread_id": "Thread-1", "execution_time": 0.0024499893188476562, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_comment_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.112757Z", "completed_at": "2022-10-26T19:31:45.114648Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.114771Z", "completed_at": "2022-10-26T19:31:45.114774Z"}], "thread_id": "Thread-1", "execution_time": 0.0024569034576416016, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.115439Z", "completed_at": "2022-10-26T19:31:45.117529Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.117653Z", "completed_at": "2022-10-26T19:31:45.117658Z"}], "thread_id": "Thread-1", "execution_time": 0.0026788711547851562, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_label_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.118346Z", "completed_at": "2022-10-26T19:31:45.120259Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.120382Z", "completed_at": "2022-10-26T19:31:45.120385Z"}], "thread_id": "Thread-1", "execution_time": 0.0024831295013427734, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_merged_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.121047Z", "completed_at": "2022-10-26T19:31:45.122932Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.123050Z", "completed_at": "2022-10-26T19:31:45.123054Z"}], "thread_id": "Thread-1", "execution_time": 0.0024492740631103516, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__label_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.123697Z", "completed_at": "2022-10-26T19:31:45.126219Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.126338Z", "completed_at": "2022-10-26T19:31:45.126341Z"}], "thread_id": "Thread-1", "execution_time": 0.0030786991119384766, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__pull_request_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.127005Z", "completed_at": "2022-10-26T19:31:45.128941Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.129064Z", "completed_at": "2022-10-26T19:31:45.129068Z"}], "thread_id": "Thread-1", "execution_time": 0.00251007080078125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__pull_request_review_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.129736Z", "completed_at": "2022-10-26T19:31:45.131844Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.131966Z", "completed_at": "2022-10-26T19:31:45.131970Z"}], "thread_id": "Thread-1", "execution_time": 0.0026700496673583984, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__repo_team_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.132616Z", "completed_at": "2022-10-26T19:31:45.134522Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.134645Z", "completed_at": "2022-10-26T19:31:45.134649Z"}], "thread_id": "Thread-1", "execution_time": 0.002470254898071289, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__repository_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.135298Z", "completed_at": "2022-10-26T19:31:45.137180Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.137300Z", "completed_at": "2022-10-26T19:31:45.137303Z"}], "thread_id": "Thread-1", "execution_time": 0.002438068389892578, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__requested_reviewer_history_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.137943Z", "completed_at": "2022-10-26T19:31:45.139863Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.139981Z", "completed_at": "2022-10-26T19:31:45.139985Z"}], "thread_id": "Thread-1", "execution_time": 0.002476930618286133, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__team_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.140632Z", "completed_at": "2022-10-26T19:31:45.143171Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.143289Z", "completed_at": "2022-10-26T19:31:45.143293Z"}], "thread_id": "Thread-1", "execution_time": 0.003100156784057617, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__user_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.144022Z", "completed_at": "2022-10-26T19:31:45.517016Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.517301Z", "completed_at": "2022-10-26T19:31:45.517316Z"}], "thread_id": "Thread-1", "execution_time": 0.37406277656555176, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_assignee"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.518923Z", "completed_at": "2022-10-26T19:31:45.960547Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:45.960864Z", "completed_at": "2022-10-26T19:31:45.960882Z"}], "thread_id": "Thread-1", "execution_time": 0.4431490898132324, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_closed_history"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:45.962802Z", "completed_at": "2022-10-26T19:31:46.345425Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:46.345833Z", "completed_at": "2022-10-26T19:31:46.345852Z"}], "thread_id": "Thread-1", "execution_time": 0.3844490051269531, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_comment"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:46.347787Z", "completed_at": "2022-10-26T19:31:46.724916Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:46.725081Z", "completed_at": "2022-10-26T19:31:46.725089Z"}], "thread_id": "Thread-1", "execution_time": 0.3783400058746338, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:46.726150Z", "completed_at": "2022-10-26T19:31:47.099172Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:47.099497Z", "completed_at": "2022-10-26T19:31:47.099516Z"}], "thread_id": "Thread-1", "execution_time": 0.3743109703063965, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_label"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:47.101183Z", "completed_at": "2022-10-26T19:31:47.442838Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:47.443091Z", "completed_at": "2022-10-26T19:31:47.443106Z"}], "thread_id": "Thread-1", "execution_time": 0.3428840637207031, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_merged"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:47.444501Z", "completed_at": "2022-10-26T19:31:47.821629Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:47.821877Z", "completed_at": "2022-10-26T19:31:47.821893Z"}], "thread_id": "Thread-1", "execution_time": 0.3782830238342285, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__label"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:47.823433Z", "completed_at": "2022-10-26T19:31:48.111140Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:48.111470Z", "completed_at": "2022-10-26T19:31:48.111488Z"}], "thread_id": "Thread-1", "execution_time": 0.2890939712524414, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__pull_request"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:48.113218Z", "completed_at": "2022-10-26T19:31:48.476494Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:48.476723Z", "completed_at": "2022-10-26T19:31:48.476740Z"}], "thread_id": "Thread-1", "execution_time": 0.3645648956298828, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__pull_request_review"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:48.478068Z", "completed_at": "2022-10-26T19:31:48.865560Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:48.865935Z", "completed_at": "2022-10-26T19:31:48.865955Z"}], "thread_id": "Thread-1", "execution_time": 0.3889122009277344, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__repo_team"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:48.868175Z", "completed_at": "2022-10-26T19:31:49.227113Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:49.227287Z", "completed_at": "2022-10-26T19:31:49.227295Z"}], "thread_id": "Thread-1", "execution_time": 0.3603048324584961, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__repository"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:49.228369Z", "completed_at": "2022-10-26T19:31:49.551590Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:49.551947Z", "completed_at": "2022-10-26T19:31:49.551965Z"}], "thread_id": "Thread-1", "execution_time": 0.3246903419494629, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__requested_reviewer_history"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:49.554066Z", "completed_at": "2022-10-26T19:31:49.915948Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:49.916270Z", "completed_at": "2022-10-26T19:31:49.916287Z"}], "thread_id": "Thread-1", "execution_time": 0.36368680000305176, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__team"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:49.918249Z", "completed_at": "2022-10-26T19:31:50.274281Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.274546Z", "completed_at": "2022-10-26T19:31:50.274562Z"}], "thread_id": "Thread-1", "execution_time": 0.3573720455169678, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__user"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.276290Z", "completed_at": "2022-10-26T19:31:50.289385Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.289553Z", "completed_at": "2022-10-26T19:31:50.289559Z"}], "thread_id": "Thread-1", "execution_time": 0.014101028442382812, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.290413Z", "completed_at": "2022-10-26T19:31:50.336841Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.336978Z", "completed_at": "2022-10-26T19:31:50.336985Z"}], "thread_id": "Thread-1", "execution_time": 0.04710721969604492, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.340320Z", "completed_at": "2022-10-26T19:31:50.344918Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.345044Z", "completed_at": "2022-10-26T19:31:50.345048Z"}], "thread_id": "Thread-1", "execution_time": 0.005175113677978516, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.345698Z", "completed_at": "2022-10-26T19:31:50.349073Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.349200Z", "completed_at": "2022-10-26T19:31:50.349203Z"}], "thread_id": "Thread-1", "execution_time": 0.003951072692871094, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.356117Z", "completed_at": "2022-10-26T19:31:50.359075Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.359234Z", "completed_at": "2022-10-26T19:31:50.359237Z"}], "thread_id": "Thread-1", "execution_time": 0.0035669803619384766, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.359908Z", "completed_at": "2022-10-26T19:31:50.362409Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.362538Z", "completed_at": "2022-10-26T19:31:50.362542Z"}], "thread_id": "Thread-1", "execution_time": 0.0030930042266845703, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__issue_issue_id.84891aeece"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.366318Z", "completed_at": "2022-10-26T19:31:50.368643Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.368763Z", "completed_at": "2022-10-26T19:31:50.368767Z"}], "thread_id": "Thread-1", "execution_time": 0.002894163131713867, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__label_label_id.9f07379974"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.369407Z", "completed_at": "2022-10-26T19:31:50.371720Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.371841Z", "completed_at": "2022-10-26T19:31:50.371845Z"}], "thread_id": "Thread-1", "execution_time": 0.0028769969940185547, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__label_label_id.74d3c21466"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.372530Z", "completed_at": "2022-10-26T19:31:50.374909Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.375037Z", "completed_at": "2022-10-26T19:31:50.375040Z"}], "thread_id": "Thread-1", "execution_time": 0.0029938220977783203, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.375688Z", "completed_at": "2022-10-26T19:31:50.378696Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.378831Z", "completed_at": "2022-10-26T19:31:50.378834Z"}], "thread_id": "Thread-1", "execution_time": 0.0035920143127441406, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.379474Z", "completed_at": "2022-10-26T19:31:50.381873Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.381998Z", "completed_at": "2022-10-26T19:31:50.382001Z"}], "thread_id": "Thread-1", "execution_time": 0.0029680728912353516, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.382638Z", "completed_at": "2022-10-26T19:31:50.384884Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.385012Z", "completed_at": "2022-10-26T19:31:50.385015Z"}], "thread_id": "Thread-1", "execution_time": 0.002820253372192383, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.385637Z", "completed_at": "2022-10-26T19:31:50.387933Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.388056Z", "completed_at": "2022-10-26T19:31:50.388059Z"}], "thread_id": "Thread-1", "execution_time": 0.002858877182006836, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.388688Z", "completed_at": "2022-10-26T19:31:50.390962Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.391078Z", "completed_at": "2022-10-26T19:31:50.391082Z"}], "thread_id": "Thread-1", "execution_time": 0.002830028533935547, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.391768Z", "completed_at": "2022-10-26T19:31:50.394131Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.394251Z", "completed_at": "2022-10-26T19:31:50.394255Z"}], "thread_id": "Thread-1", "execution_time": 0.002959728240966797, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.394891Z", "completed_at": "2022-10-26T19:31:50.397859Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.397978Z", "completed_at": "2022-10-26T19:31:50.397982Z"}], "thread_id": "Thread-1", "execution_time": 0.0035300254821777344, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.409647Z", "completed_at": "2022-10-26T19:31:50.411959Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.412082Z", "completed_at": "2022-10-26T19:31:50.412086Z"}], "thread_id": "Thread-1", "execution_time": 0.0028810501098632812, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__team_team_id.440aefe7a7"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.412716Z", "completed_at": "2022-10-26T19:31:50.414975Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.415096Z", "completed_at": "2022-10-26T19:31:50.415100Z"}], "thread_id": "Thread-1", "execution_time": 0.0028247833251953125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__team_team_id.94e9716ab4"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.423079Z", "completed_at": "2022-10-26T19:31:50.425394Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.425512Z", "completed_at": "2022-10-26T19:31:50.425516Z"}], "thread_id": "Thread-1", "execution_time": 0.0028798580169677734, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.426146Z", "completed_at": "2022-10-26T19:31:50.428396Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.428517Z", "completed_at": "2022-10-26T19:31:50.428520Z"}], "thread_id": "Thread-1", "execution_time": 0.002816915512084961, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__user_user_id.5c1a00cd90"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.452959Z", "completed_at": "2022-10-26T19:31:50.459032Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.459161Z", "completed_at": "2022-10-26T19:31:50.459166Z"}], "thread_id": "Thread-1", "execution_time": 0.006687164306640625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__issues"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.459915Z", "completed_at": "2022-10-26T19:31:50.463305Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.463447Z", "completed_at": "2022-10-26T19:31:50.463451Z"}], "thread_id": "Thread-1", "execution_time": 0.004002809524536133, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__pull_requests"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.464194Z", "completed_at": "2022-10-26T19:31:50.466627Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.466752Z", "completed_at": "2022-10-26T19:31:50.466756Z"}], "thread_id": "Thread-1", "execution_time": 0.0030107498168945312, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__issues_issue_id.fed0631e25"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.467402Z", "completed_at": "2022-10-26T19:31:50.469648Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.469771Z", "completed_at": "2022-10-26T19:31:50.469775Z"}], "thread_id": "Thread-1", "execution_time": 0.002838134765625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__issues_issue_id.6723b9b1db"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.470404Z", "completed_at": "2022-10-26T19:31:50.474713Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.474850Z", "completed_at": "2022-10-26T19:31:50.474854Z"}], "thread_id": "Thread-1", "execution_time": 0.004888057708740234, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__daily_metrics"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.475557Z", "completed_at": "2022-10-26T19:31:50.478532Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.478653Z", "completed_at": "2022-10-26T19:31:50.478657Z"}], "thread_id": "Thread-1", "execution_time": 0.0035419464111328125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.479288Z", "completed_at": "2022-10-26T19:31:50.481519Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.481638Z", "completed_at": "2022-10-26T19:31:50.481642Z"}], "thread_id": "Thread-1", "execution_time": 0.0027861595153808594, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__pull_requests_issue_id.ce23997907"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.482254Z", "completed_at": "2022-10-26T19:31:50.484260Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.484398Z", "completed_at": "2022-10-26T19:31:50.484401Z"}], "thread_id": "Thread-1", "execution_time": 0.0025832653045654297, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__monthly_metrics"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.485070Z", "completed_at": "2022-10-26T19:31:50.487034Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.487153Z", "completed_at": "2022-10-26T19:31:50.487156Z"}], "thread_id": "Thread-1", "execution_time": 0.002526998519897461, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__quarterly_metrics"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.487843Z", "completed_at": "2022-10-26T19:31:50.489836Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.489956Z", "completed_at": "2022-10-26T19:31:50.489959Z"}], "thread_id": "Thread-1", "execution_time": 0.002591848373413086, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__weekly_metrics"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.490653Z", "completed_at": "2022-10-26T19:31:50.492959Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.493078Z", "completed_at": "2022-10-26T19:31:50.493081Z"}], "thread_id": "Thread-1", "execution_time": 0.0028679370880126953, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__daily_metrics_day.647e494434"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.493700Z", "completed_at": "2022-10-26T19:31:50.496611Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.496732Z", "completed_at": "2022-10-26T19:31:50.496735Z"}], "thread_id": "Thread-1", "execution_time": 0.0034720897674560547, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__daily_metrics_day.f98cab9456"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.497360Z", "completed_at": "2022-10-26T19:31:50.499658Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.499788Z", "completed_at": "2022-10-26T19:31:50.499792Z"}], "thread_id": "Thread-1", "execution_time": 0.002870798110961914, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__monthly_metrics_month.9e4fba84df"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.500409Z", "completed_at": "2022-10-26T19:31:50.502642Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.502762Z", "completed_at": "2022-10-26T19:31:50.502766Z"}], "thread_id": "Thread-1", "execution_time": 0.0027921199798583984, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__monthly_metrics_month.3076284fbb"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.503385Z", "completed_at": "2022-10-26T19:31:50.505652Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.505770Z", "completed_at": "2022-10-26T19:31:50.505774Z"}], "thread_id": "Thread-1", "execution_time": 0.0028269290924072266, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__quarterly_metrics_quarter.92394d46dc"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.506386Z", "completed_at": "2022-10-26T19:31:50.508612Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.508741Z", "completed_at": "2022-10-26T19:31:50.508745Z"}], "thread_id": "Thread-1", "execution_time": 0.002791881561279297, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__quarterly_metrics_quarter.9165a921c1"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.509357Z", "completed_at": "2022-10-26T19:31:50.511635Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.511754Z", "completed_at": "2022-10-26T19:31:50.511758Z"}], "thread_id": "Thread-1", "execution_time": 0.002836942672729492, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__weekly_metrics_week.4b0b928243"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-10-26T19:31:50.512388Z", "completed_at": "2022-10-26T19:31:50.515250Z"}, {"name": "execute", "started_at": "2022-10-26T19:31:50.515372Z", "completed_at": "2022-10-26T19:31:50.515375Z"}], "thread_id": "Thread-1", "execution_time": 0.0034258365631103516, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__weekly_metrics_week.6794858a8e"}], "elapsed_time": 7.2774131298065186, "args": {"write_json": true, "use_colors": true, "printer_width": 80, "version_check": true, "partial_parse": true, "static_parser": true, "profiles_dir": "/Users/catherinefritz/.dbt", "send_anonymous_usage_stats": true, "event_buffer_size": 100000, "quiet": false, "no_print": false, "compile": true, "which": "generate", "rpc_method": "docs.generate", "indirect_selection": "eager"}} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v4.json", "dbt_version": "1.3.0", "generated_at": "2022-11-01T00:40:18.609937Z", "invocation_id": "581c3815-414c-47e3-91e9-f6b3f49621e9", "env": {}}, "results": [{"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.571082Z", "completed_at": "2022-11-01T00:40:13.578373Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.578690Z", "completed_at": "2022-11-01T00:40:13.578715Z"}], "thread_id": "Thread-1", "execution_time": 0.008991003036499023, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_assignee_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.580365Z", "completed_at": "2022-11-01T00:40:13.583873Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.584014Z", "completed_at": "2022-11-01T00:40:13.584020Z"}], "thread_id": "Thread-1", "execution_time": 0.00457000732421875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_closed_history_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.584924Z", "completed_at": "2022-11-01T00:40:13.591818Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.592040Z", "completed_at": "2022-11-01T00:40:13.592048Z"}], "thread_id": "Thread-1", "execution_time": 0.0077667236328125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_comment_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.593272Z", "completed_at": "2022-11-01T00:40:13.596521Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.596704Z", "completed_at": "2022-11-01T00:40:13.596716Z"}], "thread_id": "Thread-1", "execution_time": 0.0042760372161865234, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_label_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.597768Z", "completed_at": "2022-11-01T00:40:13.600909Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.601092Z", "completed_at": "2022-11-01T00:40:13.601097Z"}], "thread_id": "Thread-1", "execution_time": 0.004021167755126953, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_merged_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.602072Z", "completed_at": "2022-11-01T00:40:13.604759Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.604938Z", "completed_at": "2022-11-01T00:40:13.604943Z"}], "thread_id": "Thread-1", "execution_time": 0.0034749507904052734, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.605822Z", "completed_at": "2022-11-01T00:40:13.608400Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.608558Z", "completed_at": "2022-11-01T00:40:13.608562Z"}], "thread_id": "Thread-1", "execution_time": 0.0032999515533447266, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__label_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.609405Z", "completed_at": "2022-11-01T00:40:13.612007Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.612153Z", "completed_at": "2022-11-01T00:40:13.612157Z"}], "thread_id": "Thread-1", "execution_time": 0.003298044204711914, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__pull_request_review_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.612923Z", "completed_at": "2022-11-01T00:40:13.615990Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.616136Z", "completed_at": "2022-11-01T00:40:13.616140Z"}], "thread_id": "Thread-1", "execution_time": 0.003735780715942383, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__pull_request_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.616925Z", "completed_at": "2022-11-01T00:40:13.619516Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.619660Z", "completed_at": "2022-11-01T00:40:13.619664Z"}], "thread_id": "Thread-1", "execution_time": 0.003245830535888672, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__repo_team_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.620428Z", "completed_at": "2022-11-01T00:40:13.622747Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.622894Z", "completed_at": "2022-11-01T00:40:13.622898Z"}], "thread_id": "Thread-1", "execution_time": 0.002978086471557617, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__repository_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.623658Z", "completed_at": "2022-11-01T00:40:13.625786Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.625917Z", "completed_at": "2022-11-01T00:40:13.625921Z"}], "thread_id": "Thread-1", "execution_time": 0.0027489662170410156, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__requested_reviewer_history_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.626608Z", "completed_at": "2022-11-01T00:40:13.628740Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.628871Z", "completed_at": "2022-11-01T00:40:13.628874Z"}], "thread_id": "Thread-1", "execution_time": 0.0027260780334472656, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__team_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.629572Z", "completed_at": "2022-11-01T00:40:13.631678Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.631804Z", "completed_at": "2022-11-01T00:40:13.631810Z"}], "thread_id": "Thread-1", "execution_time": 0.0027060508728027344, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__user_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.632507Z", "completed_at": "2022-11-01T00:40:13.634246Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.634367Z", "completed_at": "2022-11-01T00:40:13.634371Z"}], "thread_id": "Thread-1", "execution_time": 0.0023381710052490234, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_assignee_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.635060Z", "completed_at": "2022-11-01T00:40:13.636080Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.636194Z", "completed_at": "2022-11-01T00:40:13.636198Z"}], "thread_id": "Thread-1", "execution_time": 0.0016369819641113281, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_closed_history_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.636880Z", "completed_at": "2022-11-01T00:40:13.637859Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.637967Z", "completed_at": "2022-11-01T00:40:13.637971Z"}], "thread_id": "Thread-1", "execution_time": 0.0015239715576171875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_comment_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.638606Z", "completed_at": "2022-11-01T00:40:13.639628Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.639734Z", "completed_at": "2022-11-01T00:40:13.639737Z"}], "thread_id": "Thread-1", "execution_time": 0.0015606880187988281, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.640360Z", "completed_at": "2022-11-01T00:40:13.641322Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.641438Z", "completed_at": "2022-11-01T00:40:13.641441Z"}], "thread_id": "Thread-1", "execution_time": 0.0015130043029785156, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_label_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.642061Z", "completed_at": "2022-11-01T00:40:13.643068Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.643175Z", "completed_at": "2022-11-01T00:40:13.643178Z"}], "thread_id": "Thread-1", "execution_time": 0.00154876708984375, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_merged_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.643780Z", "completed_at": "2022-11-01T00:40:13.644763Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.644870Z", "completed_at": "2022-11-01T00:40:13.644872Z"}], "thread_id": "Thread-1", "execution_time": 0.0015082359313964844, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_label_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.645483Z", "completed_at": "2022-11-01T00:40:13.647068Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.647177Z", "completed_at": "2022-11-01T00:40:13.647180Z"}], "thread_id": "Thread-1", "execution_time": 0.0021271705627441406, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_pull_request_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.647747Z", "completed_at": "2022-11-01T00:40:13.648667Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.648776Z", "completed_at": "2022-11-01T00:40:13.648778Z"}], "thread_id": "Thread-1", "execution_time": 0.001438140869140625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_pull_request_review_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.649334Z", "completed_at": "2022-11-01T00:40:13.650279Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.650387Z", "completed_at": "2022-11-01T00:40:13.650389Z"}], "thread_id": "Thread-1", "execution_time": 0.00152587890625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_repo_team_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.651023Z", "completed_at": "2022-11-01T00:40:13.652005Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.652116Z", "completed_at": "2022-11-01T00:40:13.652119Z"}], "thread_id": "Thread-1", "execution_time": 0.0015091896057128906, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_repository_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.652681Z", "completed_at": "2022-11-01T00:40:13.653637Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.653746Z", "completed_at": "2022-11-01T00:40:13.653749Z"}], "thread_id": "Thread-1", "execution_time": 0.0014758110046386719, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_requested_reviewer_history_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.654305Z", "completed_at": "2022-11-01T00:40:13.655262Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.655380Z", "completed_at": "2022-11-01T00:40:13.655383Z"}], "thread_id": "Thread-1", "execution_time": 0.001486063003540039, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_team_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.655943Z", "completed_at": "2022-11-01T00:40:13.657464Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.657574Z", "completed_at": "2022-11-01T00:40:13.657576Z"}], "thread_id": "Thread-1", "execution_time": 0.0020427703857421875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_user_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.658138Z", "completed_at": "2022-11-01T00:40:13.951350Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.951678Z", "completed_at": "2022-11-01T00:40:13.951691Z"}], "thread_id": "Thread-1", "execution_time": 0.2942469120025635, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_assignee"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.953443Z", "completed_at": "2022-11-01T00:40:14.197304Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:14.197606Z", "completed_at": "2022-11-01T00:40:14.197626Z"}], "thread_id": "Thread-1", "execution_time": 0.24542617797851562, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_closed_history"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:14.199441Z", "completed_at": "2022-11-01T00:40:14.616456Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:14.616689Z", "completed_at": "2022-11-01T00:40:14.616700Z"}], "thread_id": "Thread-1", "execution_time": 0.41841793060302734, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_comment"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:14.618206Z", "completed_at": "2022-11-01T00:40:14.967416Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:14.967790Z", "completed_at": "2022-11-01T00:40:14.967809Z"}], "thread_id": "Thread-1", "execution_time": 0.3507547378540039, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_label"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:14.969855Z", "completed_at": "2022-11-01T00:40:15.324537Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:15.324729Z", "completed_at": "2022-11-01T00:40:15.324744Z"}], "thread_id": "Thread-1", "execution_time": 0.35609006881713867, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_merged"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:15.325792Z", "completed_at": "2022-11-01T00:40:15.732804Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:15.733083Z", "completed_at": "2022-11-01T00:40:15.733099Z"}], "thread_id": "Thread-1", "execution_time": 0.40821099281311035, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:15.734927Z", "completed_at": "2022-11-01T00:40:15.994527Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:15.994739Z", "completed_at": "2022-11-01T00:40:15.994752Z"}], "thread_id": "Thread-1", "execution_time": 0.26086997985839844, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__label"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:15.995805Z", "completed_at": "2022-11-01T00:40:16.366730Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:16.367017Z", "completed_at": "2022-11-01T00:40:16.367033Z"}], "thread_id": "Thread-1", "execution_time": 0.37206196784973145, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__pull_request_review"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:16.368722Z", "completed_at": "2022-11-01T00:40:16.698972Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:16.699269Z", "completed_at": "2022-11-01T00:40:16.699286Z"}], "thread_id": "Thread-1", "execution_time": 0.3317391872406006, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__pull_request"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:16.701094Z", "completed_at": "2022-11-01T00:40:17.084362Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:17.084744Z", "completed_at": "2022-11-01T00:40:17.084763Z"}], "thread_id": "Thread-1", "execution_time": 0.3849673271179199, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__repo_team"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:17.087013Z", "completed_at": "2022-11-01T00:40:17.405737Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:17.406007Z", "completed_at": "2022-11-01T00:40:17.406027Z"}], "thread_id": "Thread-1", "execution_time": 0.32043027877807617, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__repository"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:17.407659Z", "completed_at": "2022-11-01T00:40:17.705030Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:17.705429Z", "completed_at": "2022-11-01T00:40:17.705445Z"}], "thread_id": "Thread-1", "execution_time": 0.29900479316711426, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__requested_reviewer_history"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:17.707456Z", "completed_at": "2022-11-01T00:40:18.130219Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.130541Z", "completed_at": "2022-11-01T00:40:18.130562Z"}], "thread_id": "Thread-1", "execution_time": 0.42454099655151367, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__team"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.132548Z", "completed_at": "2022-11-01T00:40:18.357974Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.358287Z", "completed_at": "2022-11-01T00:40:18.358301Z"}], "thread_id": "Thread-1", "execution_time": 0.22687911987304688, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__user"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.360072Z", "completed_at": "2022-11-01T00:40:18.374253Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.374460Z", "completed_at": "2022-11-01T00:40:18.374467Z"}], "thread_id": "Thread-1", "execution_time": 0.015462160110473633, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.375572Z", "completed_at": "2022-11-01T00:40:18.385335Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.385503Z", "completed_at": "2022-11-01T00:40:18.385508Z"}], "thread_id": "Thread-1", "execution_time": 0.010631799697875977, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.389783Z", "completed_at": "2022-11-01T00:40:18.395664Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.395822Z", "completed_at": "2022-11-01T00:40:18.395827Z"}], "thread_id": "Thread-1", "execution_time": 0.00658416748046875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.396599Z", "completed_at": "2022-11-01T00:40:18.400741Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.400888Z", "completed_at": "2022-11-01T00:40:18.400892Z"}], "thread_id": "Thread-1", "execution_time": 0.00482487678527832, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.409030Z", "completed_at": "2022-11-01T00:40:18.412371Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.412506Z", "completed_at": "2022-11-01T00:40:18.412510Z"}], "thread_id": "Thread-1", "execution_time": 0.003959178924560547, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.413187Z", "completed_at": "2022-11-01T00:40:18.454000Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.454137Z", "completed_at": "2022-11-01T00:40:18.454142Z"}], "thread_id": "Thread-1", "execution_time": 0.04142189025878906, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__issue_issue_id.84891aeece"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.458004Z", "completed_at": "2022-11-01T00:40:18.460441Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.460564Z", "completed_at": "2022-11-01T00:40:18.460569Z"}], "thread_id": "Thread-1", "execution_time": 0.0030269622802734375, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__label_label_id.9f07379974"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.461214Z", "completed_at": "2022-11-01T00:40:18.463475Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.463598Z", "completed_at": "2022-11-01T00:40:18.463601Z"}], "thread_id": "Thread-1", "execution_time": 0.002821683883666992, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__label_label_id.74d3c21466"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.464231Z", "completed_at": "2022-11-01T00:40:18.466552Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.466672Z", "completed_at": "2022-11-01T00:40:18.466676Z"}], "thread_id": "Thread-1", "execution_time": 0.002875804901123047, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.467296Z", "completed_at": "2022-11-01T00:40:18.469546Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.469661Z", "completed_at": "2022-11-01T00:40:18.469664Z"}], "thread_id": "Thread-1", "execution_time": 0.0028018951416015625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.470324Z", "completed_at": "2022-11-01T00:40:18.473398Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.473523Z", "completed_at": "2022-11-01T00:40:18.473526Z"}], "thread_id": "Thread-1", "execution_time": 0.0036652088165283203, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.474168Z", "completed_at": "2022-11-01T00:40:18.476615Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.476742Z", "completed_at": "2022-11-01T00:40:18.476746Z"}], "thread_id": "Thread-1", "execution_time": 0.003025054931640625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.477439Z", "completed_at": "2022-11-01T00:40:18.480005Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.480156Z", "completed_at": "2022-11-01T00:40:18.480160Z"}], "thread_id": "Thread-1", "execution_time": 0.0032019615173339844, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.480838Z", "completed_at": "2022-11-01T00:40:18.483176Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.483298Z", "completed_at": "2022-11-01T00:40:18.483302Z"}], "thread_id": "Thread-1", "execution_time": 0.002920866012573242, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.483923Z", "completed_at": "2022-11-01T00:40:18.486273Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.486405Z", "completed_at": "2022-11-01T00:40:18.486408Z"}], "thread_id": "Thread-1", "execution_time": 0.0029230117797851562, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.487038Z", "completed_at": "2022-11-01T00:40:18.489284Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.489404Z", "completed_at": "2022-11-01T00:40:18.489407Z"}], "thread_id": "Thread-1", "execution_time": 0.0027990341186523438, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.502409Z", "completed_at": "2022-11-01T00:40:18.504739Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.504861Z", "completed_at": "2022-11-01T00:40:18.504865Z"}], "thread_id": "Thread-1", "execution_time": 0.002892017364501953, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__team_team_id.440aefe7a7"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.505484Z", "completed_at": "2022-11-01T00:40:18.507762Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.507897Z", "completed_at": "2022-11-01T00:40:18.507900Z"}], "thread_id": "Thread-1", "execution_time": 0.002856016159057617, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__team_team_id.94e9716ab4"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.515762Z", "completed_at": "2022-11-01T00:40:18.518809Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.518931Z", "completed_at": "2022-11-01T00:40:18.518934Z"}], "thread_id": "Thread-1", "execution_time": 0.003622293472290039, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.519589Z", "completed_at": "2022-11-01T00:40:18.521882Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.522018Z", "completed_at": "2022-11-01T00:40:18.522022Z"}], "thread_id": "Thread-1", "execution_time": 0.002873659133911133, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__user_user_id.5c1a00cd90"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.546657Z", "completed_at": "2022-11-01T00:40:18.552787Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.552915Z", "completed_at": "2022-11-01T00:40:18.552919Z"}], "thread_id": "Thread-1", "execution_time": 0.006721019744873047, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__issues"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.553674Z", "completed_at": "2022-11-01T00:40:18.557005Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.557147Z", "completed_at": "2022-11-01T00:40:18.557151Z"}], "thread_id": "Thread-1", "execution_time": 0.003959178924560547, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__pull_requests"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.557918Z", "completed_at": "2022-11-01T00:40:18.560357Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.560481Z", "completed_at": "2022-11-01T00:40:18.560485Z"}], "thread_id": "Thread-1", "execution_time": 0.0030171871185302734, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__issues_issue_id.fed0631e25"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.561126Z", "completed_at": "2022-11-01T00:40:18.563368Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.563491Z", "completed_at": "2022-11-01T00:40:18.563494Z"}], "thread_id": "Thread-1", "execution_time": 0.002804994583129883, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__issues_issue_id.6723b9b1db"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.564112Z", "completed_at": "2022-11-01T00:40:18.568488Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.568616Z", "completed_at": "2022-11-01T00:40:18.568619Z"}], "thread_id": "Thread-1", "execution_time": 0.004947185516357422, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__daily_metrics"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.569356Z", "completed_at": "2022-11-01T00:40:18.572407Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.572551Z", "completed_at": "2022-11-01T00:40:18.572555Z"}], "thread_id": "Thread-1", "execution_time": 0.0036606788635253906, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.573191Z", "completed_at": "2022-11-01T00:40:18.575461Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.575582Z", "completed_at": "2022-11-01T00:40:18.575585Z"}], "thread_id": "Thread-1", "execution_time": 0.002830028533935547, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__pull_requests_issue_id.ce23997907"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.576197Z", "completed_at": "2022-11-01T00:40:18.578404Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.578522Z", "completed_at": "2022-11-01T00:40:18.578526Z"}], "thread_id": "Thread-1", "execution_time": 0.0027611255645751953, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__monthly_metrics"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.579220Z", "completed_at": "2022-11-01T00:40:18.581158Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.581276Z", "completed_at": "2022-11-01T00:40:18.581280Z"}], "thread_id": "Thread-1", "execution_time": 0.002516031265258789, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__quarterly_metrics"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.581948Z", "completed_at": "2022-11-01T00:40:18.583850Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.583965Z", "completed_at": "2022-11-01T00:40:18.583969Z"}], "thread_id": "Thread-1", "execution_time": 0.0024518966674804688, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__weekly_metrics"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.584621Z", "completed_at": "2022-11-01T00:40:18.586912Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.587032Z", "completed_at": "2022-11-01T00:40:18.587035Z"}], "thread_id": "Thread-1", "execution_time": 0.002852201461791992, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__daily_metrics_day.647e494434"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.587656Z", "completed_at": "2022-11-01T00:40:18.590537Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.590659Z", "completed_at": "2022-11-01T00:40:18.590662Z"}], "thread_id": "Thread-1", "execution_time": 0.0034427642822265625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__daily_metrics_day.f98cab9456"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.591271Z", "completed_at": "2022-11-01T00:40:18.593578Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.593699Z", "completed_at": "2022-11-01T00:40:18.593702Z"}], "thread_id": "Thread-1", "execution_time": 0.0028600692749023438, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__monthly_metrics_month.9e4fba84df"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.594305Z", "completed_at": "2022-11-01T00:40:18.596497Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.596614Z", "completed_at": "2022-11-01T00:40:18.596618Z"}], "thread_id": "Thread-1", "execution_time": 0.0027420520782470703, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__monthly_metrics_month.3076284fbb"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.597225Z", "completed_at": "2022-11-01T00:40:18.599497Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.599615Z", "completed_at": "2022-11-01T00:40:18.599619Z"}], "thread_id": "Thread-1", "execution_time": 0.0028247833251953125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__quarterly_metrics_quarter.92394d46dc"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.600221Z", "completed_at": "2022-11-01T00:40:18.602426Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.602545Z", "completed_at": "2022-11-01T00:40:18.602549Z"}], "thread_id": "Thread-1", "execution_time": 0.002756834030151367, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__quarterly_metrics_quarter.9165a921c1"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.603161Z", "completed_at": "2022-11-01T00:40:18.605433Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.605552Z", "completed_at": "2022-11-01T00:40:18.605556Z"}], "thread_id": "Thread-1", "execution_time": 0.002824068069458008, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__weekly_metrics_week.4b0b928243"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.606241Z", "completed_at": "2022-11-01T00:40:18.609115Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.609236Z", "completed_at": "2022-11-01T00:40:18.609241Z"}], "thread_id": "Thread-1", "execution_time": 0.0035119056701660156, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__weekly_metrics_week.6794858a8e"}], "elapsed_time": 6.8091840744018555, "args": {"write_json": true, "use_colors": true, "printer_width": 80, "version_check": true, "partial_parse": true, "static_parser": true, "profiles_dir": "/Users/catherinefritz/.dbt", "send_anonymous_usage_stats": true, "event_buffer_size": 100000, "quiet": false, "no_print": false, "compile": true, "which": "generate", "rpc_method": "docs.generate", "indirect_selection": "eager"}} \ No newline at end of file diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index d4c08f8..d11d6bd 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -4,21 +4,21 @@ config-version: 2 profile: 'integration_tests' vars: github_source: - issue_assignee: "{{ ref('github_issue_assignee_data') }}" - issue_closed_history: "{{ ref('github_issue_closed_history_data') }}" - issue_comment: "{{ ref('github_issue_comment_data') }}" - issue_label: "{{ ref('github_issue_label_data') }}" - label: "{{ ref('github_label_data') }}" - issue_merged: "{{ ref('github_issue_merged_data') }}" - issue: "{{ ref('github_issue_data') }}" - pull_request_review: "{{ ref('github_pull_request_review_data') }}" - pull_request: "{{ ref('github_pull_request_data') }}" - repository: "{{ ref('github_repository_data') }}" - repo_team: "{{ ref('github_repo_team_data') }}" - requested_reviewer_history: "{{ ref('github_requested_reviewer_history_data') }}" - team: "{{ ref('github_team_data') }}" - user: "{{ ref('github_user_data') }}" github_schema: github_integration_tests + github_issue_assignee_identifier: "github_issue_assignee_data" + github_issue_closed_history_identifier: "github_issue_closed_history_data" + github_issue_comment_identifier: "github_issue_comment_data" + github_issue_label_identifier: "github_issue_label_data" + github_label_identifier: "github_label_data" + github_issue_merged_identifier: "github_issue_merged_data" + github_issue_identifier: "github_issue_data" + github_pull_request_review_identifier: "github_pull_request_review_data" + github_pull_request_identifier: "github_pull_request_data" + github_repository_identifier: "github_repository_data" + github_repo_team_identifier: "github_repo_team_data" + github_requested_reviewer_history_identifier: "github_requested_reviewer_history_data" + github_team_identifier: "github_team_data" + github_user_identifier: "github_user_data" seeds: github_integration_tests: +quote_columns: "{{ true if target.type == 'redshift' else false }}" From 1f2496b531f7a0fa387850665bcb175d8663757c Mon Sep 17 00:00:00 2001 From: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com> Date: Tue, 1 Nov 2022 17:05:33 -0500 Subject: [PATCH 24/30] update changelog --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6546cec..39b99d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # dbt_github v0.6.0 -## 🚨 Breaking Changes 🚨: [PR #35](https://github.com/fivetran/dbt_github/pull/35) includes the following breaking changes: +## 🚨 Breaking Changes 🚨: - Dispatch update for dbt-utils to dbt-core cross-db macros migration. Specifically `{{ dbt_utils. }}` have been updated to `{{ dbt. }}` for the below macros: - `any_value` - `bool_or` @@ -35,6 +35,9 @@ - `dbt.current_timestamp_backcompat` - `dbt.current_timestamp_in_utc_backcompat` - Dependencies on `fivetran/fivetran_utils` have been upgraded, previously `[">=0.3.0", "<0.4.0"]` now `[">=0.4.0", "<0.5.0"]`. +## 🎉 Documentation and Feature Updates 🎉: +- Updated README documentation for easier navigation and dbt package setup. + # dbt_github v0.5.1 ## Fixes - The `url_link` logic within `int_github__issue_joined` was focused on only providing the correct url for pull requests. This update includes a `case when` statement to provide the accurate url logic for both Issues and Pull Requests. ([#31](https://github.com/fivetran/dbt_github/pull/31)) From aabf74aa933bf0bdbb9422ba9cb411f3a38e8d0c Mon Sep 17 00:00:00 2001 From: fivetran-sheringuyen <94874400+fivetran-sheringuyen@users.noreply.github.com> Date: Mon, 7 Nov 2022 10:10:27 -0900 Subject: [PATCH 25/30] adding db compat --- .buildkite/pipeline.yml | 14 ++++++++++++++ .buildkite/scripts/run_models.sh | 2 ++ .github/pull_request_template.md | 4 ++-- integration_tests/ci/sample.profiles.yml | 2 +- integration_tests/dbt_project.yml | 4 ++++ packages.yml | 2 +- 6 files changed, 24 insertions(+), 4 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 46cea39..93648ba 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -42,3 +42,17 @@ steps: - "CI_REDSHIFT_DBT_USER" commands: | bash .buildkite/scripts/run_models.sh redshift + + - label: ":bricks: Run Tests - Databricks" + key: "run_dbt_databricks" + plugins: + - docker#v3.13.0: + image: "python:3.8" + shell: [ "/bin/bash", "-e", "-c" ] + environment: + - "BASH_ENV=/tmp/.bashrc" + - "CI_DATABRICKS_DBT_HOST" + - "CI_DATABRICKS_DBT_HTTP_PATH" + - "CI_DATABRICKS_DBT_TOKEN" + commands: | + bash .buildkite/scripts/run_models.sh databricks \ No newline at end of file diff --git a/.buildkite/scripts/run_models.sh b/.buildkite/scripts/run_models.sh index 4e564f2..197b28b 100644 --- a/.buildkite/scripts/run_models.sh +++ b/.buildkite/scripts/run_models.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -euo pipefail + apt-get update apt-get install libsasl2-dev diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 35f658d..1b75bc7 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -29,9 +29,9 @@ Pull Request **How did you test the PR changes?** - + -- [ ] CircleCi +- [ ] Buildkite - [ ] Local (please provide additional testing details below) **Select which warehouse(s) were used to test the PR** diff --git a/integration_tests/ci/sample.profiles.yml b/integration_tests/ci/sample.profiles.yml index b39d59e..59cf8f0 100644 --- a/integration_tests/ci/sample.profiles.yml +++ b/integration_tests/ci/sample.profiles.yml @@ -1,5 +1,5 @@ -# HEY! This file is used in the dbt package integrations tests with CircleCI. +# HEY! This file is used in the dbt package integrations tests with Buildkite. # You should __NEVER__ check credentials into version control. Thanks for reading :) config: diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index d11d6bd..37bd783 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -55,3 +55,7 @@ seeds: github_requested_reviewer_history_data: +column_types: created_at: timestamp + +dispatch: + - macro_namespace: dbt_utils + search_order: ['spark_utils', 'dbt_utils'] \ No newline at end of file diff --git a/packages.yml b/packages.yml index e4157ef..dae2587 100644 --- a/packages.yml +++ b/packages.yml @@ -4,4 +4,4 @@ packages: # Update before merge - git: https://github.com/fivetran/dbt_github_source.git - revision: MagicBot/dbt-utils-cross-db-migration \ No newline at end of file + revision: feature/databricks-compat \ No newline at end of file From 0c7b562dc5c92be67aa8a884bd5107c880af76d3 Mon Sep 17 00:00:00 2001 From: fivetran-sheringuyen <94874400+fivetran-sheringuyen@users.noreply.github.com> Date: Mon, 7 Nov 2022 11:00:39 -0900 Subject: [PATCH 26/30] updating docs --- CHANGELOG.md | 3 ++- docs/catalog.json | 2 +- docs/manifest.json | 2 +- docs/run_results.json | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 39b99d7..e16c4b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,7 +36,8 @@ - `dbt.current_timestamp_in_utc_backcompat` - Dependencies on `fivetran/fivetran_utils` have been upgraded, previously `[">=0.3.0", "<0.4.0"]` now `[">=0.4.0", "<0.5.0"]`. ## 🎉 Documentation and Feature Updates 🎉: -- Updated README documentation for easier navigation and dbt package setup. +- Updated README documentation for easier navigation and dbt package setup. [#35](https://github.com/fivetran/dbt_github/pull/35) +- Added Databricks compatibility. [#38](https://github.com/fivetran/dbt_github/pull/38) # dbt_github v0.5.1 ## Fixes diff --git a/docs/catalog.json b/docs/catalog.json index d50ae98..1d0fc34 100644 --- a/docs/catalog.json +++ b/docs/catalog.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "1.3.0", "generated_at": "2022-11-01T00:40:25.646866Z", "invocation_id": "581c3815-414c-47e3-91e9-f6b3f49621e9", "env": {}}, "nodes": {"model.github.github__quarterly_metrics": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "github__quarterly_metrics", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"quarter": {"type": "TIMESTAMP", "index": 1, "name": "quarter", "comment": null}, "number_issues_opened": {"type": "INT64", "index": 2, "name": "number_issues_opened", "comment": null}, "number_issues_closed": {"type": "INT64", "index": 3, "name": "number_issues_closed", "comment": null}, "avg_days_issue_open": {"type": "FLOAT64", "index": 4, "name": "avg_days_issue_open", "comment": null}, "longest_days_issue_open": {"type": "FLOAT64", "index": 5, "name": "longest_days_issue_open", "comment": null}, "number_prs_opened": {"type": "INT64", "index": 6, "name": "number_prs_opened", "comment": null}, "number_prs_merged": {"type": "INT64", "index": 7, "name": "number_prs_merged", "comment": null}, "number_prs_closed_without_merge": {"type": "INT64", "index": 8, "name": "number_prs_closed_without_merge", "comment": null}, "avg_days_pr_open": {"type": "FLOAT64", "index": 9, "name": "avg_days_pr_open", "comment": null}, "longest_days_pr_open": {"type": "FLOAT64", "index": 10, "name": "longest_days_pr_open", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 720.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 9.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__quarterly_metrics"}, "seed.github_integration_tests.github_requested_reviewer_history_data": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "github_requested_reviewer_history_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"created_at": {"type": "TIMESTAMP", "index": 1, "name": "created_at", "comment": null}, "pull_request_id": {"type": "INT64", "index": 2, "name": "pull_request_id", "comment": null}, "requested_id": {"type": "INT64", "index": 3, "name": "requested_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 5, "name": "actor_id", "comment": null}, "removed": {"type": "BOOL", "index": 6, "name": "removed", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1681.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 41.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_requested_reviewer_history_data"}, "model.github_source.stg_github__repository": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "stg_github__repository", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"repository_id": {"type": "INT64", "index": 1, "name": "repository_id", "comment": null}, "full_name": {"type": "STRING", "index": 2, "name": "full_name", "comment": null}, "is_private": {"type": "BOOL", "index": 3, "name": "is_private", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1800.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 24.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__repository"}, "seed.github_integration_tests.github_pull_request_data": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "github_pull_request_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "base_label": {"type": "STRING", "index": 3, "name": "base_label", "comment": null}, "base_ref": {"type": "STRING", "index": 4, "name": "base_ref", "comment": null}, "base_repo_id": {"type": "INT64", "index": 5, "name": "base_repo_id", "comment": null}, "base_sha": {"type": "STRING", "index": 6, "name": "base_sha", "comment": null}, "base_user_id": {"type": "INT64", "index": 7, "name": "base_user_id", "comment": null}, "head_label": {"type": "STRING", "index": 8, "name": "head_label", "comment": null}, "head_ref": {"type": "STRING", "index": 9, "name": "head_ref", "comment": null}, "head_repo_id": {"type": "INT64", "index": 10, "name": "head_repo_id", "comment": null}, "head_sha": {"type": "STRING", "index": 11, "name": "head_sha", "comment": null}, "head_user_id": {"type": "INT64", "index": 12, "name": "head_user_id", "comment": null}, "issue_id": {"type": "INT64", "index": 13, "name": "issue_id", "comment": null}, "merge_commit_sha": {"type": "STRING", "index": 14, "name": "merge_commit_sha", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 56627.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 167.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_pull_request_data"}, "model.github_source.stg_github__issue_comment_tmp": {"metadata": {"type": "view", "schema": "github_source_integration_tests", "name": "stg_github__issue_comment_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "created_at": {"type": "DATETIME", "index": 4, "name": "created_at", "comment": null}, "issue_id": {"type": "INT64", "index": 5, "name": "issue_id", "comment": null}, "updated_at": {"type": "DATETIME", "index": 6, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 7, "name": "user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_comment_tmp"}, "model.github_source.stg_github__issue_assignee": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "stg_github__issue_assignee", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "user_id": {"type": "INT64", "index": 2, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 3200.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 200.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_assignee"}, "model.github_source.stg_github__repo_team": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "stg_github__repo_team", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"repository_id": {"type": "INT64", "index": 1, "name": "repository_id", "comment": null}, "team_id": {"type": "INT64", "index": 2, "name": "team_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 128.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 8.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__repo_team"}, "seed.github_integration_tests.github_issue_merged_data": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "github_issue_merged_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"commit_sha": {"type": "STRING", "index": 1, "name": "commit_sha", "comment": null}, "issue_id": {"type": "INT64", "index": 2, "name": "issue_id", "comment": null}, "merged_at": {"type": "TIMESTAMP", "index": 3, "name": "merged_at", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 5, "name": "actor_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 8140.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 110.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_merged_data"}, "seed.github_integration_tests.github_repository_data": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "github_repository_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "archived": {"type": "BOOL", "index": 3, "name": "archived", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "default_branch": {"type": "STRING", "index": 5, "name": "default_branch", "comment": null}, "description": {"type": "STRING", "index": 6, "name": "description", "comment": null}, "fork": {"type": "BOOL", "index": 7, "name": "fork", "comment": null}, "full_name": {"type": "STRING", "index": 8, "name": "full_name", "comment": null}, "homepage": {"type": "INT64", "index": 9, "name": "homepage", "comment": null}, "language": {"type": "STRING", "index": 10, "name": "language", "comment": null}, "name": {"type": "STRING", "index": 11, "name": "name", "comment": null}, "owner_id": {"type": "INT64", "index": 12, "name": "owner_id", "comment": null}, "private": {"type": "BOOL", "index": 13, "name": "private", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 5793.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 24.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_repository_data"}, "seed.github_integration_tests.github_pull_request_review_data": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "github_pull_request_review_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "commit_sha": {"type": "STRING", "index": 4, "name": "commit_sha", "comment": null}, "pull_request_id": {"type": "INT64", "index": 5, "name": "pull_request_id", "comment": null}, "state": {"type": "STRING", "index": 6, "name": "state", "comment": null}, "submitted_at": {"type": "TIMESTAMP", "index": 7, "name": "submitted_at", "comment": null}, "user_id": {"type": "INT64", "index": 8, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 18059.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 114.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_pull_request_review_data"}, "model.github_source.stg_github__pull_request": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "stg_github__pull_request", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"pull_request_id": {"type": "INT64", "index": 1, "name": "pull_request_id", "comment": null}, "issue_id": {"type": "INT64", "index": 2, "name": "issue_id", "comment": null}, "head_repo_id": {"type": "INT64", "index": 3, "name": "head_repo_id", "comment": null}, "head_user_id": {"type": "INT64", "index": 4, "name": "head_user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 5320.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 167.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__pull_request"}, "model.github_source.stg_github__issue_merged": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "stg_github__issue_merged", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "merged_at": {"type": "TIMESTAMP", "index": 2, "name": "merged_at", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1760.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 110.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_merged"}, "model.github_source.stg_github__issue": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "stg_github__issue", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "body": {"type": "STRING", "index": 2, "name": "body", "comment": null}, "closed_at": {"type": "TIMESTAMP", "index": 3, "name": "closed_at", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "is_locked": {"type": "BOOL", "index": 5, "name": "is_locked", "comment": null}, "milestone_id": {"type": "INT64", "index": 6, "name": "milestone_id", "comment": null}, "issue_number": {"type": "INT64", "index": 7, "name": "issue_number", "comment": null}, "is_pull_request": {"type": "BOOL", "index": 8, "name": "is_pull_request", "comment": null}, "repository_id": {"type": "INT64", "index": 9, "name": "repository_id", "comment": null}, "state": {"type": "STRING", "index": 10, "name": "state", "comment": null}, "title": {"type": "STRING", "index": 11, "name": "title", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 12, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 13, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 38954.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 197.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue"}, "model.github_source.stg_github__label": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "stg_github__label", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"label_id": {"type": "INT64", "index": 1, "name": "label_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "color": {"type": "STRING", "index": 3, "name": "color", "comment": null}, "description": {"type": "STRING", "index": 4, "name": "description", "comment": null}, "is_default": {"type": "BOOL", "index": 5, "name": "is_default", "comment": null}, "label": {"type": "STRING", "index": 6, "name": "label", "comment": null}, "url": {"type": "STRING", "index": 7, "name": "url", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2016.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 15.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__label"}, "model.github_source.stg_github__repo_team_tmp": {"metadata": {"type": "view", "schema": "github_source_integration_tests", "name": "stg_github__repo_team_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"repository_id": {"type": "INT64", "index": 1, "name": "repository_id", "comment": null}, "team_id": {"type": "INT64", "index": 2, "name": "team_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "permission": {"type": "STRING", "index": 4, "name": "permission", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__repo_team_tmp"}, "model.github.github__issues": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "github__issues", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "body": {"type": "STRING", "index": 2, "name": "body", "comment": null}, "closed_at": {"type": "TIMESTAMP", "index": 3, "name": "closed_at", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "is_locked": {"type": "BOOL", "index": 5, "name": "is_locked", "comment": null}, "milestone_id": {"type": "INT64", "index": 6, "name": "milestone_id", "comment": null}, "issue_number": {"type": "INT64", "index": 7, "name": "issue_number", "comment": null}, "is_pull_request": {"type": "BOOL", "index": 8, "name": "is_pull_request", "comment": null}, "repository_id": {"type": "INT64", "index": 9, "name": "repository_id", "comment": null}, "state": {"type": "STRING", "index": 10, "name": "state", "comment": null}, "title": {"type": "STRING", "index": 11, "name": "title", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 12, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 13, "name": "user_id", "comment": null}, "url_link": {"type": "STRING", "index": 14, "name": "url_link", "comment": null}, "days_issue_open": {"type": "FLOAT64", "index": 15, "name": "days_issue_open", "comment": null}, "number_of_times_reopened": {"type": "INT64", "index": 16, "name": "number_of_times_reopened", "comment": null}, "labels": {"type": "STRING", "index": 17, "name": "labels", "comment": null}, "number_of_comments": {"type": "INT64", "index": 18, "name": "number_of_comments", "comment": null}, "repository": {"type": "STRING", "index": 19, "name": "repository", "comment": null}, "repository_team_names": {"type": "STRING", "index": 20, "name": "repository_team_names", "comment": null}, "assignees": {"type": "STRING", "index": 21, "name": "assignees", "comment": null}, "creator_login_name": {"type": "STRING", "index": 22, "name": "creator_login_name", "comment": null}, "creator_name": {"type": "STRING", "index": 23, "name": "creator_name", "comment": null}, "creator_company": {"type": "STRING", "index": 24, "name": "creator_company", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 16053.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 30.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__issues"}, "model.github_source.stg_github__label_tmp": {"metadata": {"type": "view", "schema": "github_source_integration_tests", "name": "stg_github__label_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "color": {"type": "STRING", "index": 3, "name": "color", "comment": null}, "description": {"type": "STRING", "index": 4, "name": "description", "comment": null}, "is_default": {"type": "BOOL", "index": 5, "name": "is_default", "comment": null}, "name": {"type": "STRING", "index": 6, "name": "name", "comment": null}, "url": {"type": "STRING", "index": 7, "name": "url", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__label_tmp"}, "model.github.github__monthly_metrics": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "github__monthly_metrics", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"month": {"type": "TIMESTAMP", "index": 1, "name": "month", "comment": null}, "number_issues_opened": {"type": "INT64", "index": 2, "name": "number_issues_opened", "comment": null}, "number_issues_closed": {"type": "INT64", "index": 3, "name": "number_issues_closed", "comment": null}, "avg_days_issue_open": {"type": "FLOAT64", "index": 4, "name": "avg_days_issue_open", "comment": null}, "longest_days_issue_open": {"type": "FLOAT64", "index": 5, "name": "longest_days_issue_open", "comment": null}, "number_prs_opened": {"type": "INT64", "index": 6, "name": "number_prs_opened", "comment": null}, "number_prs_merged": {"type": "INT64", "index": 7, "name": "number_prs_merged", "comment": null}, "number_prs_closed_without_merge": {"type": "INT64", "index": 8, "name": "number_prs_closed_without_merge", "comment": null}, "avg_days_pr_open": {"type": "FLOAT64", "index": 9, "name": "avg_days_pr_open", "comment": null}, "longest_days_pr_open": {"type": "FLOAT64", "index": 10, "name": "longest_days_pr_open", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1888.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 25.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__monthly_metrics"}, "model.github_source.stg_github__repository_tmp": {"metadata": {"type": "view", "schema": "github_source_integration_tests", "name": "stg_github__repository_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "archived": {"type": "BOOL", "index": 3, "name": "archived", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "default_branch": {"type": "STRING", "index": 5, "name": "default_branch", "comment": null}, "description": {"type": "STRING", "index": 6, "name": "description", "comment": null}, "fork": {"type": "BOOL", "index": 7, "name": "fork", "comment": null}, "full_name": {"type": "STRING", "index": 8, "name": "full_name", "comment": null}, "homepage": {"type": "INT64", "index": 9, "name": "homepage", "comment": null}, "language": {"type": "STRING", "index": 10, "name": "language", "comment": null}, "name": {"type": "STRING", "index": 11, "name": "name", "comment": null}, "owner_id": {"type": "INT64", "index": 12, "name": "owner_id", "comment": null}, "private": {"type": "BOOL", "index": 13, "name": "private", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__repository_tmp"}, "model.github_source.stg_github__issue_label_tmp": {"metadata": {"type": "view", "schema": "github_source_integration_tests", "name": "stg_github__issue_label_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "label_id": {"type": "INT64", "index": 2, "name": "label_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_label_tmp"}, "model.github_source.stg_github__requested_reviewer_history": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "stg_github__requested_reviewer_history", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"pull_request_id": {"type": "INT64", "index": 1, "name": "pull_request_id", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 2, "name": "created_at", "comment": null}, "requested_id": {"type": "INT64", "index": 3, "name": "requested_id", "comment": null}, "removed": {"type": "BOOL", "index": 4, "name": "removed", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1025.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 41.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__requested_reviewer_history"}, "seed.github_integration_tests.github_label_data": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "github_label_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "color": {"type": "STRING", "index": 3, "name": "color", "comment": null}, "description": {"type": "STRING", "index": 4, "name": "description", "comment": null}, "is_default": {"type": "BOOL", "index": 5, "name": "is_default", "comment": null}, "name": {"type": "STRING", "index": 6, "name": "name", "comment": null}, "url": {"type": "STRING", "index": 7, "name": "url", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2016.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 15.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_label_data"}, "seed.github_integration_tests.github_issue_closed_history_data": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "github_issue_closed_history_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 2, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 4, "name": "actor_id", "comment": null}, "closed": {"type": "BOOL", "index": 5, "name": "closed", "comment": null}, "commit_sha": {"type": "INT64", "index": 6, "name": "commit_sha", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 5643.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 171.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_closed_history_data"}, "model.github_source.stg_github__team_tmp": {"metadata": {"type": "view", "schema": "github_source_integration_tests", "name": "stg_github__team_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "description": {"type": "STRING", "index": 3, "name": "description", "comment": null}, "name": {"type": "STRING", "index": 4, "name": "name", "comment": null}, "org_id": {"type": "INT64", "index": 5, "name": "org_id", "comment": null}, "parent_id": {"type": "INT64", "index": 6, "name": "parent_id", "comment": null}, "privacy": {"type": "STRING", "index": 7, "name": "privacy", "comment": null}, "slug": {"type": "STRING", "index": 8, "name": "slug", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__team_tmp"}, "model.github.github__daily_metrics": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "github__daily_metrics", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"day": {"type": "TIMESTAMP", "index": 1, "name": "day", "comment": null}, "number_issues_opened": {"type": "INT64", "index": 2, "name": "number_issues_opened", "comment": null}, "number_issues_closed": {"type": "INT64", "index": 3, "name": "number_issues_closed", "comment": null}, "sum_days_issue_open": {"type": "FLOAT64", "index": 4, "name": "sum_days_issue_open", "comment": null}, "longest_days_issue_open": {"type": "FLOAT64", "index": 5, "name": "longest_days_issue_open", "comment": null}, "number_prs_opened": {"type": "INT64", "index": 6, "name": "number_prs_opened", "comment": null}, "number_prs_merged": {"type": "INT64", "index": 7, "name": "number_prs_merged", "comment": null}, "number_prs_closed_without_merge": {"type": "INT64", "index": 8, "name": "number_prs_closed_without_merge", "comment": null}, "sum_days_pr_open": {"type": "FLOAT64", "index": 9, "name": "sum_days_pr_open", "comment": null}, "longest_days_pr_open": {"type": "FLOAT64", "index": 10, "name": "longest_days_pr_open", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 17552.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 305.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__daily_metrics"}, "model.github_source.stg_github__pull_request_review_tmp": {"metadata": {"type": "view", "schema": "github_source_integration_tests", "name": "stg_github__pull_request_review_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "commit_sha": {"type": "STRING", "index": 4, "name": "commit_sha", "comment": null}, "pull_request_id": {"type": "INT64", "index": 5, "name": "pull_request_id", "comment": null}, "state": {"type": "STRING", "index": 6, "name": "state", "comment": null}, "submitted_at": {"type": "TIMESTAMP", "index": 7, "name": "submitted_at", "comment": null}, "user_id": {"type": "INT64", "index": 8, "name": "user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__pull_request_review_tmp"}, "seed.github_integration_tests.github_issue_label_data": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "github_issue_label_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "label_id": {"type": "INT64", "index": 2, "name": "label_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1104.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 46.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_label_data"}, "model.github_source.stg_github__pull_request_tmp": {"metadata": {"type": "view", "schema": "github_source_integration_tests", "name": "stg_github__pull_request_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "base_label": {"type": "STRING", "index": 3, "name": "base_label", "comment": null}, "base_ref": {"type": "STRING", "index": 4, "name": "base_ref", "comment": null}, "base_repo_id": {"type": "INT64", "index": 5, "name": "base_repo_id", "comment": null}, "base_sha": {"type": "STRING", "index": 6, "name": "base_sha", "comment": null}, "base_user_id": {"type": "INT64", "index": 7, "name": "base_user_id", "comment": null}, "head_label": {"type": "STRING", "index": 8, "name": "head_label", "comment": null}, "head_ref": {"type": "STRING", "index": 9, "name": "head_ref", "comment": null}, "head_repo_id": {"type": "INT64", "index": 10, "name": "head_repo_id", "comment": null}, "head_sha": {"type": "STRING", "index": 11, "name": "head_sha", "comment": null}, "head_user_id": {"type": "INT64", "index": 12, "name": "head_user_id", "comment": null}, "issue_id": {"type": "INT64", "index": 13, "name": "issue_id", "comment": null}, "merge_commit_sha": {"type": "STRING", "index": 14, "name": "merge_commit_sha", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__pull_request_tmp"}, "model.github.github__pull_requests": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "github__pull_requests", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "body": {"type": "STRING", "index": 2, "name": "body", "comment": null}, "closed_at": {"type": "TIMESTAMP", "index": 3, "name": "closed_at", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "is_locked": {"type": "BOOL", "index": 5, "name": "is_locked", "comment": null}, "milestone_id": {"type": "INT64", "index": 6, "name": "milestone_id", "comment": null}, "issue_number": {"type": "INT64", "index": 7, "name": "issue_number", "comment": null}, "is_pull_request": {"type": "BOOL", "index": 8, "name": "is_pull_request", "comment": null}, "repository_id": {"type": "INT64", "index": 9, "name": "repository_id", "comment": null}, "state": {"type": "STRING", "index": 10, "name": "state", "comment": null}, "title": {"type": "STRING", "index": 11, "name": "title", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 12, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 13, "name": "user_id", "comment": null}, "url_link": {"type": "STRING", "index": 14, "name": "url_link", "comment": null}, "days_issue_open": {"type": "FLOAT64", "index": 15, "name": "days_issue_open", "comment": null}, "number_of_times_reopened": {"type": "INT64", "index": 16, "name": "number_of_times_reopened", "comment": null}, "labels": {"type": "STRING", "index": 17, "name": "labels", "comment": null}, "number_of_comments": {"type": "INT64", "index": 18, "name": "number_of_comments", "comment": null}, "repository": {"type": "STRING", "index": 19, "name": "repository", "comment": null}, "repository_team_names": {"type": "STRING", "index": 20, "name": "repository_team_names", "comment": null}, "assignees": {"type": "STRING", "index": 21, "name": "assignees", "comment": null}, "creator_login_name": {"type": "STRING", "index": 22, "name": "creator_login_name", "comment": null}, "creator_name": {"type": "STRING", "index": 23, "name": "creator_name", "comment": null}, "creator_company": {"type": "STRING", "index": 24, "name": "creator_company", "comment": null}, "hours_request_review_to_first_review": {"type": "FLOAT64", "index": 25, "name": "hours_request_review_to_first_review", "comment": null}, "hours_request_review_to_first_action": {"type": "FLOAT64", "index": 26, "name": "hours_request_review_to_first_action", "comment": null}, "hours_request_review_to_merge": {"type": "FLOAT64", "index": 27, "name": "hours_request_review_to_merge", "comment": null}, "merged_at": {"type": "TIMESTAMP", "index": 28, "name": "merged_at", "comment": null}, "reviewers": {"type": "STRING", "index": 29, "name": "reviewers", "comment": null}, "number_of_reviews": {"type": "INT64", "index": 30, "name": "number_of_reviews", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 106809.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 167.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__pull_requests"}, "model.github_source.stg_github__issue_label": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "stg_github__issue_label", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "label_id": {"type": "INT64", "index": 2, "name": "label_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 736.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 46.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_label"}, "seed.github_integration_tests.github_issue_comment_data": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "github_issue_comment_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "created_at": {"type": "DATETIME", "index": 4, "name": "created_at", "comment": null}, "issue_id": {"type": "INT64", "index": 5, "name": "issue_id", "comment": null}, "updated_at": {"type": "DATETIME", "index": 6, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 7, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 4902.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 43.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_comment_data"}, "model.github_source.stg_github__issue_merged_tmp": {"metadata": {"type": "view", "schema": "github_source_integration_tests", "name": "stg_github__issue_merged_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"commit_sha": {"type": "STRING", "index": 1, "name": "commit_sha", "comment": null}, "issue_id": {"type": "INT64", "index": 2, "name": "issue_id", "comment": null}, "merged_at": {"type": "TIMESTAMP", "index": 3, "name": "merged_at", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 5, "name": "actor_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_merged_tmp"}, "seed.github_integration_tests.github_issue_assignee_data": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "github_issue_assignee_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "user_id": {"type": "INT64", "index": 2, "name": "user_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 4800.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 200.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_assignee_data"}, "seed.github_integration_tests.github_issue_data": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "github_issue_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "closed_at": {"type": "TIMESTAMP", "index": 4, "name": "closed_at", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 5, "name": "created_at", "comment": null}, "locked": {"type": "BOOL", "index": 6, "name": "locked", "comment": null}, "milestone_id": {"type": "INT64", "index": 7, "name": "milestone_id", "comment": null}, "number": {"type": "INT64", "index": 8, "name": "number", "comment": null}, "pull_request": {"type": "BOOL", "index": 9, "name": "pull_request", "comment": null}, "repository_id": {"type": "INT64", "index": 10, "name": "repository_id", "comment": null}, "state": {"type": "STRING", "index": 11, "name": "state", "comment": null}, "title": {"type": "STRING", "index": 12, "name": "title", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 13, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 14, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 40530.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 197.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_data"}, "model.github.github__weekly_metrics": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "github__weekly_metrics", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"week": {"type": "TIMESTAMP", "index": 1, "name": "week", "comment": null}, "number_issues_opened": {"type": "INT64", "index": 2, "name": "number_issues_opened", "comment": null}, "number_issues_closed": {"type": "INT64", "index": 3, "name": "number_issues_closed", "comment": null}, "avg_days_issue_open": {"type": "FLOAT64", "index": 4, "name": "avg_days_issue_open", "comment": null}, "longest_days_issue_open": {"type": "FLOAT64", "index": 5, "name": "longest_days_issue_open", "comment": null}, "number_prs_opened": {"type": "INT64", "index": 6, "name": "number_prs_opened", "comment": null}, "number_prs_merged": {"type": "INT64", "index": 7, "name": "number_prs_merged", "comment": null}, "number_prs_closed_without_merge": {"type": "INT64", "index": 8, "name": "number_prs_closed_without_merge", "comment": null}, "avg_days_pr_open": {"type": "FLOAT64", "index": 9, "name": "avg_days_pr_open", "comment": null}, "longest_days_pr_open": {"type": "FLOAT64", "index": 10, "name": "longest_days_pr_open", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 6672.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 102.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__weekly_metrics"}, "model.github_source.stg_github__issue_closed_history_tmp": {"metadata": {"type": "view", "schema": "github_source_integration_tests", "name": "stg_github__issue_closed_history_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 2, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 4, "name": "actor_id", "comment": null}, "closed": {"type": "BOOL", "index": 5, "name": "closed", "comment": null}, "commit_sha": {"type": "INT64", "index": 6, "name": "commit_sha", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_closed_history_tmp"}, "seed.github_integration_tests.github_user_data": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "github_user_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "bio": {"type": "STRING", "index": 3, "name": "bio", "comment": null}, "blog": {"type": "STRING", "index": 4, "name": "blog", "comment": null}, "company": {"type": "STRING", "index": 5, "name": "company", "comment": null}, "created_at": {"type": "DATETIME", "index": 6, "name": "created_at", "comment": null}, "hireable": {"type": "BOOL", "index": 7, "name": "hireable", "comment": null}, "location": {"type": "STRING", "index": 8, "name": "location", "comment": null}, "login": {"type": "STRING", "index": 9, "name": "login", "comment": null}, "name": {"type": "STRING", "index": 10, "name": "name", "comment": null}, "site_admin": {"type": "BOOL", "index": 11, "name": "site_admin", "comment": null}, "type": {"type": "STRING", "index": 12, "name": "type", "comment": null}, "updated_at": {"type": "DATETIME", "index": 13, "name": "updated_at", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 7405.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 17.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_user_data"}, "model.github_source.stg_github__pull_request_review": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "stg_github__pull_request_review", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"pull_request_review_id": {"type": "INT64", "index": 1, "name": "pull_request_review_id", "comment": null}, "pull_request_id": {"type": "INT64", "index": 2, "name": "pull_request_id", "comment": null}, "submitted_at": {"type": "TIMESTAMP", "index": 3, "name": "submitted_at", "comment": null}, "state": {"type": "STRING", "index": 4, "name": "state", "comment": null}, "user_id": {"type": "INT64", "index": 5, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 4835.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 114.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__pull_request_review"}, "model.github_source.stg_github__issue_comment": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "stg_github__issue_comment", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_comment_id": {"type": "INT64", "index": 1, "name": "issue_comment_id", "comment": null}, "issue_id": {"type": "INT64", "index": 2, "name": "issue_id", "comment": null}, "user_id": {"type": "INT64", "index": 3, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1032.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 43.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_comment"}, "seed.github_integration_tests.github_team_data": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "github_team_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "description": {"type": "STRING", "index": 3, "name": "description", "comment": null}, "name": {"type": "STRING", "index": 4, "name": "name", "comment": null}, "org_id": {"type": "INT64", "index": 5, "name": "org_id", "comment": null}, "parent_id": {"type": "INT64", "index": 6, "name": "parent_id", "comment": null}, "privacy": {"type": "STRING", "index": 7, "name": "privacy", "comment": null}, "slug": {"type": "STRING", "index": 8, "name": "slug", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2346.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 19.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_team_data"}, "model.github_source.stg_github__team": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "stg_github__team", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"team_id": {"type": "INT64", "index": 1, "name": "team_id", "comment": null}, "description": {"type": "STRING", "index": 2, "name": "description", "comment": null}, "name": {"type": "STRING", "index": 3, "name": "name", "comment": null}, "parent_id": {"type": "INT64", "index": 4, "name": "parent_id", "comment": null}, "privacy": {"type": "STRING", "index": 5, "name": "privacy", "comment": null}, "slug": {"type": "STRING", "index": 6, "name": "slug", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2042.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 19.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__team"}, "model.github_source.stg_github__user": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "stg_github__user", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"user_id": {"type": "INT64", "index": 1, "name": "user_id", "comment": null}, "login_name": {"type": "STRING", "index": 2, "name": "login_name", "comment": null}, "name": {"type": "STRING", "index": 3, "name": "name", "comment": null}, "company": {"type": "STRING", "index": 4, "name": "company", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 3502.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 17.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__user"}, "model.github_source.stg_github__user_tmp": {"metadata": {"type": "view", "schema": "github_source_integration_tests", "name": "stg_github__user_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "bio": {"type": "STRING", "index": 3, "name": "bio", "comment": null}, "blog": {"type": "STRING", "index": 4, "name": "blog", "comment": null}, "company": {"type": "STRING", "index": 5, "name": "company", "comment": null}, "created_at": {"type": "DATETIME", "index": 6, "name": "created_at", "comment": null}, "hireable": {"type": "BOOL", "index": 7, "name": "hireable", "comment": null}, "location": {"type": "STRING", "index": 8, "name": "location", "comment": null}, "login": {"type": "STRING", "index": 9, "name": "login", "comment": null}, "name": {"type": "STRING", "index": 10, "name": "name", "comment": null}, "site_admin": {"type": "BOOL", "index": 11, "name": "site_admin", "comment": null}, "type": {"type": "STRING", "index": 12, "name": "type", "comment": null}, "updated_at": {"type": "DATETIME", "index": 13, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__user_tmp"}, "seed.github_integration_tests.github_repo_team_data": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "github_repo_team_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"repository_id": {"type": "INT64", "index": 1, "name": "repository_id", "comment": null}, "team_id": {"type": "INT64", "index": 2, "name": "team_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "permission": {"type": "STRING", "index": 4, "name": "permission", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 464.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 8.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_repo_team_data"}, "model.github_source.stg_github__requested_reviewer_history_tmp": {"metadata": {"type": "view", "schema": "github_source_integration_tests", "name": "stg_github__requested_reviewer_history_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"created_at": {"type": "TIMESTAMP", "index": 1, "name": "created_at", "comment": null}, "pull_request_id": {"type": "INT64", "index": 2, "name": "pull_request_id", "comment": null}, "requested_id": {"type": "INT64", "index": 3, "name": "requested_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 5, "name": "actor_id", "comment": null}, "removed": {"type": "BOOL", "index": 6, "name": "removed", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__requested_reviewer_history_tmp"}, "model.github_source.stg_github__issue_tmp": {"metadata": {"type": "view", "schema": "github_source_integration_tests", "name": "stg_github__issue_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "closed_at": {"type": "TIMESTAMP", "index": 4, "name": "closed_at", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 5, "name": "created_at", "comment": null}, "locked": {"type": "BOOL", "index": 6, "name": "locked", "comment": null}, "milestone_id": {"type": "INT64", "index": 7, "name": "milestone_id", "comment": null}, "number": {"type": "INT64", "index": 8, "name": "number", "comment": null}, "pull_request": {"type": "BOOL", "index": 9, "name": "pull_request", "comment": null}, "repository_id": {"type": "INT64", "index": 10, "name": "repository_id", "comment": null}, "state": {"type": "STRING", "index": 11, "name": "state", "comment": null}, "title": {"type": "STRING", "index": 12, "name": "title", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 13, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 14, "name": "user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_tmp"}, "model.github_source.stg_github__issue_assignee_tmp": {"metadata": {"type": "view", "schema": "github_source_integration_tests", "name": "stg_github__issue_assignee_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "user_id": {"type": "INT64", "index": 2, "name": "user_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_assignee_tmp"}, "model.github_source.stg_github__issue_closed_history": {"metadata": {"type": "table", "schema": "github_source_integration_tests", "name": "stg_github__issue_closed_history", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 2, "name": "updated_at", "comment": null}, "is_closed": {"type": "BOOL", "index": 3, "name": "is_closed", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2907.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 171.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_closed_history"}}, "sources": {"source.github_source.github.issue": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "closed_at": {"type": "TIMESTAMP", "index": 4, "name": "closed_at", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 5, "name": "created_at", "comment": null}, "locked": {"type": "BOOL", "index": 6, "name": "locked", "comment": null}, "milestone_id": {"type": "INT64", "index": 7, "name": "milestone_id", "comment": null}, "number": {"type": "INT64", "index": 8, "name": "number", "comment": null}, "pull_request": {"type": "BOOL", "index": 9, "name": "pull_request", "comment": null}, "repository_id": {"type": "INT64", "index": 10, "name": "repository_id", "comment": null}, "state": {"type": "STRING", "index": 11, "name": "state", "comment": null}, "title": {"type": "STRING", "index": 12, "name": "title", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 13, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 14, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 40530.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 197.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.issue"}, "source.github_source.github.user": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_user_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "bio": {"type": "STRING", "index": 3, "name": "bio", "comment": null}, "blog": {"type": "STRING", "index": 4, "name": "blog", "comment": null}, "company": {"type": "STRING", "index": 5, "name": "company", "comment": null}, "created_at": {"type": "DATETIME", "index": 6, "name": "created_at", "comment": null}, "hireable": {"type": "BOOL", "index": 7, "name": "hireable", "comment": null}, "location": {"type": "STRING", "index": 8, "name": "location", "comment": null}, "login": {"type": "STRING", "index": 9, "name": "login", "comment": null}, "name": {"type": "STRING", "index": 10, "name": "name", "comment": null}, "site_admin": {"type": "BOOL", "index": 11, "name": "site_admin", "comment": null}, "type": {"type": "STRING", "index": 12, "name": "type", "comment": null}, "updated_at": {"type": "DATETIME", "index": 13, "name": "updated_at", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 7405.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 17.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.user"}, "source.github_source.github.repository": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_repository_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "archived": {"type": "BOOL", "index": 3, "name": "archived", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "default_branch": {"type": "STRING", "index": 5, "name": "default_branch", "comment": null}, "description": {"type": "STRING", "index": 6, "name": "description", "comment": null}, "fork": {"type": "BOOL", "index": 7, "name": "fork", "comment": null}, "full_name": {"type": "STRING", "index": 8, "name": "full_name", "comment": null}, "homepage": {"type": "INT64", "index": 9, "name": "homepage", "comment": null}, "language": {"type": "STRING", "index": 10, "name": "language", "comment": null}, "name": {"type": "STRING", "index": 11, "name": "name", "comment": null}, "owner_id": {"type": "INT64", "index": 12, "name": "owner_id", "comment": null}, "private": {"type": "BOOL", "index": 13, "name": "private", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 5793.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 24.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.repository"}, "source.github_source.github.requested_reviewer_history": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_requested_reviewer_history_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"created_at": {"type": "TIMESTAMP", "index": 1, "name": "created_at", "comment": null}, "pull_request_id": {"type": "INT64", "index": 2, "name": "pull_request_id", "comment": null}, "requested_id": {"type": "INT64", "index": 3, "name": "requested_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 5, "name": "actor_id", "comment": null}, "removed": {"type": "BOOL", "index": 6, "name": "removed", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1681.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 41.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.requested_reviewer_history"}, "source.github_source.github.issue_comment": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_comment_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "created_at": {"type": "DATETIME", "index": 4, "name": "created_at", "comment": null}, "issue_id": {"type": "INT64", "index": 5, "name": "issue_id", "comment": null}, "updated_at": {"type": "DATETIME", "index": 6, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 7, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 4902.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 43.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.issue_comment"}, "source.github_source.github.issue_closed_history": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_closed_history_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 2, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 4, "name": "actor_id", "comment": null}, "closed": {"type": "BOOL", "index": 5, "name": "closed", "comment": null}, "commit_sha": {"type": "INT64", "index": 6, "name": "commit_sha", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 5643.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 171.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.issue_closed_history"}, "source.github_source.github.pull_request": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_pull_request_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "base_label": {"type": "STRING", "index": 3, "name": "base_label", "comment": null}, "base_ref": {"type": "STRING", "index": 4, "name": "base_ref", "comment": null}, "base_repo_id": {"type": "INT64", "index": 5, "name": "base_repo_id", "comment": null}, "base_sha": {"type": "STRING", "index": 6, "name": "base_sha", "comment": null}, "base_user_id": {"type": "INT64", "index": 7, "name": "base_user_id", "comment": null}, "head_label": {"type": "STRING", "index": 8, "name": "head_label", "comment": null}, "head_ref": {"type": "STRING", "index": 9, "name": "head_ref", "comment": null}, "head_repo_id": {"type": "INT64", "index": 10, "name": "head_repo_id", "comment": null}, "head_sha": {"type": "STRING", "index": 11, "name": "head_sha", "comment": null}, "head_user_id": {"type": "INT64", "index": 12, "name": "head_user_id", "comment": null}, "issue_id": {"type": "INT64", "index": 13, "name": "issue_id", "comment": null}, "merge_commit_sha": {"type": "STRING", "index": 14, "name": "merge_commit_sha", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 56627.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 167.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.pull_request"}, "source.github_source.github.issue_label": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_label_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "label_id": {"type": "INT64", "index": 2, "name": "label_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1104.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 46.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.issue_label"}, "source.github_source.github.pull_request_review": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_pull_request_review_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "commit_sha": {"type": "STRING", "index": 4, "name": "commit_sha", "comment": null}, "pull_request_id": {"type": "INT64", "index": 5, "name": "pull_request_id", "comment": null}, "state": {"type": "STRING", "index": 6, "name": "state", "comment": null}, "submitted_at": {"type": "TIMESTAMP", "index": 7, "name": "submitted_at", "comment": null}, "user_id": {"type": "INT64", "index": 8, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 18059.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 114.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.pull_request_review"}, "source.github_source.github.issue_merged": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_merged_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"commit_sha": {"type": "STRING", "index": 1, "name": "commit_sha", "comment": null}, "issue_id": {"type": "INT64", "index": 2, "name": "issue_id", "comment": null}, "merged_at": {"type": "TIMESTAMP", "index": 3, "name": "merged_at", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 5, "name": "actor_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 8140.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 110.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.issue_merged"}, "source.github_source.github.label": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_label_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "color": {"type": "STRING", "index": 3, "name": "color", "comment": null}, "description": {"type": "STRING", "index": 4, "name": "description", "comment": null}, "is_default": {"type": "BOOL", "index": 5, "name": "is_default", "comment": null}, "name": {"type": "STRING", "index": 6, "name": "name", "comment": null}, "url": {"type": "STRING", "index": 7, "name": "url", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2016.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 15.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.label"}, "source.github_source.github.team": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_team_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "description": {"type": "STRING", "index": 3, "name": "description", "comment": null}, "name": {"type": "STRING", "index": 4, "name": "name", "comment": null}, "org_id": {"type": "INT64", "index": 5, "name": "org_id", "comment": null}, "parent_id": {"type": "INT64", "index": 6, "name": "parent_id", "comment": null}, "privacy": {"type": "STRING", "index": 7, "name": "privacy", "comment": null}, "slug": {"type": "STRING", "index": 8, "name": "slug", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2346.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 19.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.team"}, "source.github_source.github.issue_assignee": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_assignee_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "user_id": {"type": "INT64", "index": 2, "name": "user_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 4800.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 200.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.issue_assignee"}, "source.github_source.github.repo_team": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_repo_team_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"repository_id": {"type": "INT64", "index": 1, "name": "repository_id", "comment": null}, "team_id": {"type": "INT64", "index": 2, "name": "team_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "permission": {"type": "STRING", "index": 4, "name": "permission", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 464.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 8.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.repo_team"}}, "errors": null} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "1.3.0", "generated_at": "2022-11-07T19:30:44.248132Z", "invocation_id": "373a774a-fbd2-4652-b5ce-ec2e726cba75", "env": {}}, "nodes": {"seed.github_integration_tests.github_pull_request_review_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_pull_request_review_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "commit_sha": {"type": "STRING", "index": 4, "name": "commit_sha", "comment": null}, "pull_request_id": {"type": "INT64", "index": 5, "name": "pull_request_id", "comment": null}, "state": {"type": "STRING", "index": 6, "name": "state", "comment": null}, "submitted_at": {"type": "TIMESTAMP", "index": 7, "name": "submitted_at", "comment": null}, "user_id": {"type": "INT64", "index": 8, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 18059.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 114.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_pull_request_review_data"}, "model.github_source.stg_github__team": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__team", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"team_id": {"type": "INT64", "index": 1, "name": "team_id", "comment": null}, "description": {"type": "STRING", "index": 2, "name": "description", "comment": null}, "name": {"type": "STRING", "index": 3, "name": "name", "comment": null}, "parent_id": {"type": "INT64", "index": 4, "name": "parent_id", "comment": null}, "privacy": {"type": "STRING", "index": 5, "name": "privacy", "comment": null}, "slug": {"type": "STRING", "index": 6, "name": "slug", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2042.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 19.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__team"}, "seed.github_integration_tests.github_issue_comment_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_comment_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "created_at": {"type": "DATETIME", "index": 4, "name": "created_at", "comment": null}, "issue_id": {"type": "INT64", "index": 5, "name": "issue_id", "comment": null}, "updated_at": {"type": "DATETIME", "index": 6, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 7, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 4902.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 43.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_comment_data"}, "model.github.github__quarterly_metrics": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github__quarterly_metrics", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"quarter": {"type": "TIMESTAMP", "index": 1, "name": "quarter", "comment": null}, "number_issues_opened": {"type": "INT64", "index": 2, "name": "number_issues_opened", "comment": null}, "number_issues_closed": {"type": "INT64", "index": 3, "name": "number_issues_closed", "comment": null}, "avg_days_issue_open": {"type": "FLOAT64", "index": 4, "name": "avg_days_issue_open", "comment": null}, "longest_days_issue_open": {"type": "FLOAT64", "index": 5, "name": "longest_days_issue_open", "comment": null}, "number_prs_opened": {"type": "INT64", "index": 6, "name": "number_prs_opened", "comment": null}, "number_prs_merged": {"type": "INT64", "index": 7, "name": "number_prs_merged", "comment": null}, "number_prs_closed_without_merge": {"type": "INT64", "index": 8, "name": "number_prs_closed_without_merge", "comment": null}, "avg_days_pr_open": {"type": "FLOAT64", "index": 9, "name": "avg_days_pr_open", "comment": null}, "longest_days_pr_open": {"type": "FLOAT64", "index": 10, "name": "longest_days_pr_open", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 720.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 9.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__quarterly_metrics"}, "model.github_source.stg_github__pull_request_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__pull_request_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "base_label": {"type": "STRING", "index": 3, "name": "base_label", "comment": null}, "base_ref": {"type": "STRING", "index": 4, "name": "base_ref", "comment": null}, "base_repo_id": {"type": "INT64", "index": 5, "name": "base_repo_id", "comment": null}, "base_sha": {"type": "STRING", "index": 6, "name": "base_sha", "comment": null}, "base_user_id": {"type": "INT64", "index": 7, "name": "base_user_id", "comment": null}, "head_label": {"type": "STRING", "index": 8, "name": "head_label", "comment": null}, "head_ref": {"type": "STRING", "index": 9, "name": "head_ref", "comment": null}, "head_repo_id": {"type": "INT64", "index": 10, "name": "head_repo_id", "comment": null}, "head_sha": {"type": "STRING", "index": 11, "name": "head_sha", "comment": null}, "head_user_id": {"type": "INT64", "index": 12, "name": "head_user_id", "comment": null}, "issue_id": {"type": "INT64", "index": 13, "name": "issue_id", "comment": null}, "merge_commit_sha": {"type": "STRING", "index": 14, "name": "merge_commit_sha", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__pull_request_tmp"}, "model.github_source.stg_github__user": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__user", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"user_id": {"type": "INT64", "index": 1, "name": "user_id", "comment": null}, "login_name": {"type": "STRING", "index": 2, "name": "login_name", "comment": null}, "name": {"type": "STRING", "index": 3, "name": "name", "comment": null}, "company": {"type": "STRING", "index": 4, "name": "company", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 3502.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 17.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__user"}, "model.github_source.stg_github__issue_label": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__issue_label", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "label_id": {"type": "INT64", "index": 2, "name": "label_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 736.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 46.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_label"}, "model.github_source.stg_github__repo_team_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__repo_team_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"repository_id": {"type": "INT64", "index": 1, "name": "repository_id", "comment": null}, "team_id": {"type": "INT64", "index": 2, "name": "team_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "permission": {"type": "STRING", "index": 4, "name": "permission", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__repo_team_tmp"}, "seed.github_integration_tests.github_repository_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_repository_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "archived": {"type": "BOOL", "index": 3, "name": "archived", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "default_branch": {"type": "STRING", "index": 5, "name": "default_branch", "comment": null}, "description": {"type": "STRING", "index": 6, "name": "description", "comment": null}, "fork": {"type": "BOOL", "index": 7, "name": "fork", "comment": null}, "full_name": {"type": "STRING", "index": 8, "name": "full_name", "comment": null}, "homepage": {"type": "INT64", "index": 9, "name": "homepage", "comment": null}, "language": {"type": "STRING", "index": 10, "name": "language", "comment": null}, "name": {"type": "STRING", "index": 11, "name": "name", "comment": null}, "owner_id": {"type": "INT64", "index": 12, "name": "owner_id", "comment": null}, "private": {"type": "BOOL", "index": 13, "name": "private", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 5793.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 24.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_repository_data"}, "model.github_source.stg_github__repository": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__repository", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"repository_id": {"type": "INT64", "index": 1, "name": "repository_id", "comment": null}, "full_name": {"type": "STRING", "index": 2, "name": "full_name", "comment": null}, "is_private": {"type": "BOOL", "index": 3, "name": "is_private", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1800.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 24.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__repository"}, "seed.github_integration_tests.github_issue_merged_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_merged_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"commit_sha": {"type": "STRING", "index": 1, "name": "commit_sha", "comment": null}, "issue_id": {"type": "INT64", "index": 2, "name": "issue_id", "comment": null}, "merged_at": {"type": "TIMESTAMP", "index": 3, "name": "merged_at", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 5, "name": "actor_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 8140.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 110.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_merged_data"}, "model.github_source.stg_github__label_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__label_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "color": {"type": "STRING", "index": 3, "name": "color", "comment": null}, "description": {"type": "STRING", "index": 4, "name": "description", "comment": null}, "is_default": {"type": "BOOL", "index": 5, "name": "is_default", "comment": null}, "name": {"type": "STRING", "index": 6, "name": "name", "comment": null}, "url": {"type": "STRING", "index": 7, "name": "url", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__label_tmp"}, "model.github_source.stg_github__pull_request": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__pull_request", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"pull_request_id": {"type": "INT64", "index": 1, "name": "pull_request_id", "comment": null}, "issue_id": {"type": "INT64", "index": 2, "name": "issue_id", "comment": null}, "head_repo_id": {"type": "INT64", "index": 3, "name": "head_repo_id", "comment": null}, "head_user_id": {"type": "INT64", "index": 4, "name": "head_user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 5320.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 167.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__pull_request"}, "seed.github_integration_tests.github_issue_label_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_label_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "label_id": {"type": "INT64", "index": 2, "name": "label_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1104.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 46.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_label_data"}, "model.github_source.stg_github__issue_comment_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__issue_comment_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "created_at": {"type": "DATETIME", "index": 4, "name": "created_at", "comment": null}, "issue_id": {"type": "INT64", "index": 5, "name": "issue_id", "comment": null}, "updated_at": {"type": "DATETIME", "index": 6, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 7, "name": "user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_comment_tmp"}, "model.github_source.stg_github__issue_comment": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__issue_comment", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_comment_id": {"type": "INT64", "index": 1, "name": "issue_comment_id", "comment": null}, "issue_id": {"type": "INT64", "index": 2, "name": "issue_id", "comment": null}, "user_id": {"type": "INT64", "index": 3, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1032.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 43.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_comment"}, "model.github_source.stg_github__pull_request_review": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__pull_request_review", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"pull_request_review_id": {"type": "INT64", "index": 1, "name": "pull_request_review_id", "comment": null}, "pull_request_id": {"type": "INT64", "index": 2, "name": "pull_request_id", "comment": null}, "submitted_at": {"type": "TIMESTAMP", "index": 3, "name": "submitted_at", "comment": null}, "state": {"type": "STRING", "index": 4, "name": "state", "comment": null}, "user_id": {"type": "INT64", "index": 5, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 4835.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 114.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__pull_request_review"}, "model.github.github__monthly_metrics": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github__monthly_metrics", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"month": {"type": "TIMESTAMP", "index": 1, "name": "month", "comment": null}, "number_issues_opened": {"type": "INT64", "index": 2, "name": "number_issues_opened", "comment": null}, "number_issues_closed": {"type": "INT64", "index": 3, "name": "number_issues_closed", "comment": null}, "avg_days_issue_open": {"type": "FLOAT64", "index": 4, "name": "avg_days_issue_open", "comment": null}, "longest_days_issue_open": {"type": "FLOAT64", "index": 5, "name": "longest_days_issue_open", "comment": null}, "number_prs_opened": {"type": "INT64", "index": 6, "name": "number_prs_opened", "comment": null}, "number_prs_merged": {"type": "INT64", "index": 7, "name": "number_prs_merged", "comment": null}, "number_prs_closed_without_merge": {"type": "INT64", "index": 8, "name": "number_prs_closed_without_merge", "comment": null}, "avg_days_pr_open": {"type": "FLOAT64", "index": 9, "name": "avg_days_pr_open", "comment": null}, "longest_days_pr_open": {"type": "FLOAT64", "index": 10, "name": "longest_days_pr_open", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1888.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 25.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__monthly_metrics"}, "model.github.github__pull_requests": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github__pull_requests", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "body": {"type": "STRING", "index": 2, "name": "body", "comment": null}, "closed_at": {"type": "TIMESTAMP", "index": 3, "name": "closed_at", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "is_locked": {"type": "BOOL", "index": 5, "name": "is_locked", "comment": null}, "milestone_id": {"type": "INT64", "index": 6, "name": "milestone_id", "comment": null}, "issue_number": {"type": "INT64", "index": 7, "name": "issue_number", "comment": null}, "is_pull_request": {"type": "BOOL", "index": 8, "name": "is_pull_request", "comment": null}, "repository_id": {"type": "INT64", "index": 9, "name": "repository_id", "comment": null}, "state": {"type": "STRING", "index": 10, "name": "state", "comment": null}, "title": {"type": "STRING", "index": 11, "name": "title", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 12, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 13, "name": "user_id", "comment": null}, "url_link": {"type": "STRING", "index": 14, "name": "url_link", "comment": null}, "days_issue_open": {"type": "FLOAT64", "index": 15, "name": "days_issue_open", "comment": null}, "number_of_times_reopened": {"type": "INT64", "index": 16, "name": "number_of_times_reopened", "comment": null}, "labels": {"type": "STRING", "index": 17, "name": "labels", "comment": null}, "number_of_comments": {"type": "INT64", "index": 18, "name": "number_of_comments", "comment": null}, "repository": {"type": "STRING", "index": 19, "name": "repository", "comment": null}, "repository_team_names": {"type": "STRING", "index": 20, "name": "repository_team_names", "comment": null}, "assignees": {"type": "STRING", "index": 21, "name": "assignees", "comment": null}, "creator_login_name": {"type": "STRING", "index": 22, "name": "creator_login_name", "comment": null}, "creator_name": {"type": "STRING", "index": 23, "name": "creator_name", "comment": null}, "creator_company": {"type": "STRING", "index": 24, "name": "creator_company", "comment": null}, "hours_request_review_to_first_review": {"type": "FLOAT64", "index": 25, "name": "hours_request_review_to_first_review", "comment": null}, "hours_request_review_to_first_action": {"type": "FLOAT64", "index": 26, "name": "hours_request_review_to_first_action", "comment": null}, "hours_request_review_to_merge": {"type": "FLOAT64", "index": 27, "name": "hours_request_review_to_merge", "comment": null}, "merged_at": {"type": "TIMESTAMP", "index": 28, "name": "merged_at", "comment": null}, "reviewers": {"type": "STRING", "index": 29, "name": "reviewers", "comment": null}, "number_of_reviews": {"type": "INT64", "index": 30, "name": "number_of_reviews", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 106809.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 167.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__pull_requests"}, "model.github.github__issues": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github__issues", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "body": {"type": "STRING", "index": 2, "name": "body", "comment": null}, "closed_at": {"type": "TIMESTAMP", "index": 3, "name": "closed_at", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "is_locked": {"type": "BOOL", "index": 5, "name": "is_locked", "comment": null}, "milestone_id": {"type": "INT64", "index": 6, "name": "milestone_id", "comment": null}, "issue_number": {"type": "INT64", "index": 7, "name": "issue_number", "comment": null}, "is_pull_request": {"type": "BOOL", "index": 8, "name": "is_pull_request", "comment": null}, "repository_id": {"type": "INT64", "index": 9, "name": "repository_id", "comment": null}, "state": {"type": "STRING", "index": 10, "name": "state", "comment": null}, "title": {"type": "STRING", "index": 11, "name": "title", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 12, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 13, "name": "user_id", "comment": null}, "url_link": {"type": "STRING", "index": 14, "name": "url_link", "comment": null}, "days_issue_open": {"type": "FLOAT64", "index": 15, "name": "days_issue_open", "comment": null}, "number_of_times_reopened": {"type": "INT64", "index": 16, "name": "number_of_times_reopened", "comment": null}, "labels": {"type": "STRING", "index": 17, "name": "labels", "comment": null}, "number_of_comments": {"type": "INT64", "index": 18, "name": "number_of_comments", "comment": null}, "repository": {"type": "STRING", "index": 19, "name": "repository", "comment": null}, "repository_team_names": {"type": "STRING", "index": 20, "name": "repository_team_names", "comment": null}, "assignees": {"type": "STRING", "index": 21, "name": "assignees", "comment": null}, "creator_login_name": {"type": "STRING", "index": 22, "name": "creator_login_name", "comment": null}, "creator_name": {"type": "STRING", "index": 23, "name": "creator_name", "comment": null}, "creator_company": {"type": "STRING", "index": 24, "name": "creator_company", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 16053.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 30.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__issues"}, "seed.github_integration_tests.github_issue_assignee_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_assignee_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "user_id": {"type": "INT64", "index": 2, "name": "user_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 4800.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 200.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_assignee_data"}, "model.github.github__weekly_metrics": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github__weekly_metrics", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"week": {"type": "TIMESTAMP", "index": 1, "name": "week", "comment": null}, "number_issues_opened": {"type": "INT64", "index": 2, "name": "number_issues_opened", "comment": null}, "number_issues_closed": {"type": "INT64", "index": 3, "name": "number_issues_closed", "comment": null}, "avg_days_issue_open": {"type": "FLOAT64", "index": 4, "name": "avg_days_issue_open", "comment": null}, "longest_days_issue_open": {"type": "FLOAT64", "index": 5, "name": "longest_days_issue_open", "comment": null}, "number_prs_opened": {"type": "INT64", "index": 6, "name": "number_prs_opened", "comment": null}, "number_prs_merged": {"type": "INT64", "index": 7, "name": "number_prs_merged", "comment": null}, "number_prs_closed_without_merge": {"type": "INT64", "index": 8, "name": "number_prs_closed_without_merge", "comment": null}, "avg_days_pr_open": {"type": "FLOAT64", "index": 9, "name": "avg_days_pr_open", "comment": null}, "longest_days_pr_open": {"type": "FLOAT64", "index": 10, "name": "longest_days_pr_open", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 6672.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 102.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__weekly_metrics"}, "model.github_source.stg_github__issue_assignee": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__issue_assignee", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "user_id": {"type": "INT64", "index": 2, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 3200.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 200.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_assignee"}, "model.github_source.stg_github__issue": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__issue", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "body": {"type": "STRING", "index": 2, "name": "body", "comment": null}, "closed_at": {"type": "TIMESTAMP", "index": 3, "name": "closed_at", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "is_locked": {"type": "BOOL", "index": 5, "name": "is_locked", "comment": null}, "milestone_id": {"type": "INT64", "index": 6, "name": "milestone_id", "comment": null}, "issue_number": {"type": "INT64", "index": 7, "name": "issue_number", "comment": null}, "is_pull_request": {"type": "BOOL", "index": 8, "name": "is_pull_request", "comment": null}, "repository_id": {"type": "INT64", "index": 9, "name": "repository_id", "comment": null}, "state": {"type": "STRING", "index": 10, "name": "state", "comment": null}, "title": {"type": "STRING", "index": 11, "name": "title", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 12, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 13, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 38954.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 197.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue"}, "model.github.github__daily_metrics": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github__daily_metrics", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"day": {"type": "TIMESTAMP", "index": 1, "name": "day", "comment": null}, "number_issues_opened": {"type": "INT64", "index": 2, "name": "number_issues_opened", "comment": null}, "number_issues_closed": {"type": "INT64", "index": 3, "name": "number_issues_closed", "comment": null}, "sum_days_issue_open": {"type": "FLOAT64", "index": 4, "name": "sum_days_issue_open", "comment": null}, "longest_days_issue_open": {"type": "FLOAT64", "index": 5, "name": "longest_days_issue_open", "comment": null}, "number_prs_opened": {"type": "INT64", "index": 6, "name": "number_prs_opened", "comment": null}, "number_prs_merged": {"type": "INT64", "index": 7, "name": "number_prs_merged", "comment": null}, "number_prs_closed_without_merge": {"type": "INT64", "index": 8, "name": "number_prs_closed_without_merge", "comment": null}, "sum_days_pr_open": {"type": "FLOAT64", "index": 9, "name": "sum_days_pr_open", "comment": null}, "longest_days_pr_open": {"type": "FLOAT64", "index": 10, "name": "longest_days_pr_open", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 17552.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 305.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__daily_metrics"}, "model.github_source.stg_github__repo_team": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__repo_team", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"repository_id": {"type": "INT64", "index": 1, "name": "repository_id", "comment": null}, "team_id": {"type": "INT64", "index": 2, "name": "team_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 128.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 8.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__repo_team"}, "model.github_source.stg_github__label": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__label", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"label_id": {"type": "INT64", "index": 1, "name": "label_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "color": {"type": "STRING", "index": 3, "name": "color", "comment": null}, "description": {"type": "STRING", "index": 4, "name": "description", "comment": null}, "is_default": {"type": "BOOL", "index": 5, "name": "is_default", "comment": null}, "label": {"type": "STRING", "index": 6, "name": "label", "comment": null}, "url": {"type": "STRING", "index": 7, "name": "url", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2016.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 15.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__label"}, "model.github_source.stg_github__issue_label_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__issue_label_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "label_id": {"type": "INT64", "index": 2, "name": "label_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_label_tmp"}, "model.github_source.stg_github__issue_closed_history_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__issue_closed_history_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 2, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 4, "name": "actor_id", "comment": null}, "closed": {"type": "BOOL", "index": 5, "name": "closed", "comment": null}, "commit_sha": {"type": "INT64", "index": 6, "name": "commit_sha", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_closed_history_tmp"}, "model.github_source.stg_github__issue_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__issue_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "closed_at": {"type": "TIMESTAMP", "index": 4, "name": "closed_at", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 5, "name": "created_at", "comment": null}, "locked": {"type": "BOOL", "index": 6, "name": "locked", "comment": null}, "milestone_id": {"type": "INT64", "index": 7, "name": "milestone_id", "comment": null}, "number": {"type": "INT64", "index": 8, "name": "number", "comment": null}, "pull_request": {"type": "BOOL", "index": 9, "name": "pull_request", "comment": null}, "repository_id": {"type": "INT64", "index": 10, "name": "repository_id", "comment": null}, "state": {"type": "STRING", "index": 11, "name": "state", "comment": null}, "title": {"type": "STRING", "index": 12, "name": "title", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 13, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 14, "name": "user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_tmp"}, "model.github_source.stg_github__user_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__user_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "bio": {"type": "STRING", "index": 3, "name": "bio", "comment": null}, "blog": {"type": "STRING", "index": 4, "name": "blog", "comment": null}, "company": {"type": "STRING", "index": 5, "name": "company", "comment": null}, "created_at": {"type": "DATETIME", "index": 6, "name": "created_at", "comment": null}, "hireable": {"type": "BOOL", "index": 7, "name": "hireable", "comment": null}, "location": {"type": "STRING", "index": 8, "name": "location", "comment": null}, "login": {"type": "STRING", "index": 9, "name": "login", "comment": null}, "name": {"type": "STRING", "index": 10, "name": "name", "comment": null}, "site_admin": {"type": "BOOL", "index": 11, "name": "site_admin", "comment": null}, "type": {"type": "STRING", "index": 12, "name": "type", "comment": null}, "updated_at": {"type": "DATETIME", "index": 13, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__user_tmp"}, "model.github_source.stg_github__issue_merged_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__issue_merged_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"commit_sha": {"type": "STRING", "index": 1, "name": "commit_sha", "comment": null}, "issue_id": {"type": "INT64", "index": 2, "name": "issue_id", "comment": null}, "merged_at": {"type": "TIMESTAMP", "index": 3, "name": "merged_at", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 5, "name": "actor_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_merged_tmp"}, "seed.github_integration_tests.github_label_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_label_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "color": {"type": "STRING", "index": 3, "name": "color", "comment": null}, "description": {"type": "STRING", "index": 4, "name": "description", "comment": null}, "is_default": {"type": "BOOL", "index": 5, "name": "is_default", "comment": null}, "name": {"type": "STRING", "index": 6, "name": "name", "comment": null}, "url": {"type": "STRING", "index": 7, "name": "url", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2016.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 15.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_label_data"}, "model.github_source.stg_github__repository_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__repository_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "archived": {"type": "BOOL", "index": 3, "name": "archived", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "default_branch": {"type": "STRING", "index": 5, "name": "default_branch", "comment": null}, "description": {"type": "STRING", "index": 6, "name": "description", "comment": null}, "fork": {"type": "BOOL", "index": 7, "name": "fork", "comment": null}, "full_name": {"type": "STRING", "index": 8, "name": "full_name", "comment": null}, "homepage": {"type": "INT64", "index": 9, "name": "homepage", "comment": null}, "language": {"type": "STRING", "index": 10, "name": "language", "comment": null}, "name": {"type": "STRING", "index": 11, "name": "name", "comment": null}, "owner_id": {"type": "INT64", "index": 12, "name": "owner_id", "comment": null}, "private": {"type": "BOOL", "index": 13, "name": "private", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__repository_tmp"}, "model.github_source.stg_github__requested_reviewer_history": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__requested_reviewer_history", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"pull_request_id": {"type": "INT64", "index": 1, "name": "pull_request_id", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 2, "name": "created_at", "comment": null}, "requested_id": {"type": "INT64", "index": 3, "name": "requested_id", "comment": null}, "removed": {"type": "BOOL", "index": 4, "name": "removed", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1025.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 41.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__requested_reviewer_history"}, "model.github_source.stg_github__issue_merged": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__issue_merged", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "merged_at": {"type": "TIMESTAMP", "index": 2, "name": "merged_at", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1760.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 110.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_merged"}, "seed.github_integration_tests.github_repo_team_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_repo_team_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"repository_id": {"type": "INT64", "index": 1, "name": "repository_id", "comment": null}, "team_id": {"type": "INT64", "index": 2, "name": "team_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "permission": {"type": "STRING", "index": 4, "name": "permission", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 464.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 8.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_repo_team_data"}, "model.github_source.stg_github__team_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__team_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "description": {"type": "STRING", "index": 3, "name": "description", "comment": null}, "name": {"type": "STRING", "index": 4, "name": "name", "comment": null}, "org_id": {"type": "INT64", "index": 5, "name": "org_id", "comment": null}, "parent_id": {"type": "INT64", "index": 6, "name": "parent_id", "comment": null}, "privacy": {"type": "STRING", "index": 7, "name": "privacy", "comment": null}, "slug": {"type": "STRING", "index": 8, "name": "slug", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__team_tmp"}, "seed.github_integration_tests.github_pull_request_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_pull_request_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "base_label": {"type": "STRING", "index": 3, "name": "base_label", "comment": null}, "base_ref": {"type": "STRING", "index": 4, "name": "base_ref", "comment": null}, "base_repo_id": {"type": "INT64", "index": 5, "name": "base_repo_id", "comment": null}, "base_sha": {"type": "STRING", "index": 6, "name": "base_sha", "comment": null}, "base_user_id": {"type": "INT64", "index": 7, "name": "base_user_id", "comment": null}, "head_label": {"type": "STRING", "index": 8, "name": "head_label", "comment": null}, "head_ref": {"type": "STRING", "index": 9, "name": "head_ref", "comment": null}, "head_repo_id": {"type": "INT64", "index": 10, "name": "head_repo_id", "comment": null}, "head_sha": {"type": "STRING", "index": 11, "name": "head_sha", "comment": null}, "head_user_id": {"type": "INT64", "index": 12, "name": "head_user_id", "comment": null}, "issue_id": {"type": "INT64", "index": 13, "name": "issue_id", "comment": null}, "merge_commit_sha": {"type": "STRING", "index": 14, "name": "merge_commit_sha", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 56627.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 167.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_pull_request_data"}, "seed.github_integration_tests.github_issue_closed_history_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_closed_history_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 2, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 4, "name": "actor_id", "comment": null}, "closed": {"type": "BOOL", "index": 5, "name": "closed", "comment": null}, "commit_sha": {"type": "INT64", "index": 6, "name": "commit_sha", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 5643.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 171.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_closed_history_data"}, "seed.github_integration_tests.github_user_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_user_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "bio": {"type": "STRING", "index": 3, "name": "bio", "comment": null}, "blog": {"type": "STRING", "index": 4, "name": "blog", "comment": null}, "company": {"type": "STRING", "index": 5, "name": "company", "comment": null}, "created_at": {"type": "DATETIME", "index": 6, "name": "created_at", "comment": null}, "hireable": {"type": "BOOL", "index": 7, "name": "hireable", "comment": null}, "location": {"type": "STRING", "index": 8, "name": "location", "comment": null}, "login": {"type": "STRING", "index": 9, "name": "login", "comment": null}, "name": {"type": "STRING", "index": 10, "name": "name", "comment": null}, "site_admin": {"type": "BOOL", "index": 11, "name": "site_admin", "comment": null}, "type": {"type": "STRING", "index": 12, "name": "type", "comment": null}, "updated_at": {"type": "DATETIME", "index": 13, "name": "updated_at", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 7405.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 17.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_user_data"}, "model.github_source.stg_github__pull_request_review_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__pull_request_review_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "commit_sha": {"type": "STRING", "index": 4, "name": "commit_sha", "comment": null}, "pull_request_id": {"type": "INT64", "index": 5, "name": "pull_request_id", "comment": null}, "state": {"type": "STRING", "index": 6, "name": "state", "comment": null}, "submitted_at": {"type": "TIMESTAMP", "index": 7, "name": "submitted_at", "comment": null}, "user_id": {"type": "INT64", "index": 8, "name": "user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__pull_request_review_tmp"}, "seed.github_integration_tests.github_requested_reviewer_history_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_requested_reviewer_history_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"created_at": {"type": "TIMESTAMP", "index": 1, "name": "created_at", "comment": null}, "pull_request_id": {"type": "INT64", "index": 2, "name": "pull_request_id", "comment": null}, "requested_id": {"type": "INT64", "index": 3, "name": "requested_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 5, "name": "actor_id", "comment": null}, "removed": {"type": "BOOL", "index": 6, "name": "removed", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1681.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 41.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_requested_reviewer_history_data"}, "model.github_source.stg_github__requested_reviewer_history_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__requested_reviewer_history_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"created_at": {"type": "TIMESTAMP", "index": 1, "name": "created_at", "comment": null}, "pull_request_id": {"type": "INT64", "index": 2, "name": "pull_request_id", "comment": null}, "requested_id": {"type": "INT64", "index": 3, "name": "requested_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 5, "name": "actor_id", "comment": null}, "removed": {"type": "BOOL", "index": 6, "name": "removed", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__requested_reviewer_history_tmp"}, "seed.github_integration_tests.github_issue_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "closed_at": {"type": "TIMESTAMP", "index": 4, "name": "closed_at", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 5, "name": "created_at", "comment": null}, "locked": {"type": "BOOL", "index": 6, "name": "locked", "comment": null}, "milestone_id": {"type": "INT64", "index": 7, "name": "milestone_id", "comment": null}, "number": {"type": "INT64", "index": 8, "name": "number", "comment": null}, "pull_request": {"type": "BOOL", "index": 9, "name": "pull_request", "comment": null}, "repository_id": {"type": "INT64", "index": 10, "name": "repository_id", "comment": null}, "state": {"type": "STRING", "index": 11, "name": "state", "comment": null}, "title": {"type": "STRING", "index": 12, "name": "title", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 13, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 14, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 40530.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 197.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_data"}, "model.github_source.stg_github__issue_assignee_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__issue_assignee_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "user_id": {"type": "INT64", "index": 2, "name": "user_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_assignee_tmp"}, "seed.github_integration_tests.github_team_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_team_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "description": {"type": "STRING", "index": 3, "name": "description", "comment": null}, "name": {"type": "STRING", "index": 4, "name": "name", "comment": null}, "org_id": {"type": "INT64", "index": 5, "name": "org_id", "comment": null}, "parent_id": {"type": "INT64", "index": 6, "name": "parent_id", "comment": null}, "privacy": {"type": "STRING", "index": 7, "name": "privacy", "comment": null}, "slug": {"type": "STRING", "index": 8, "name": "slug", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2346.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 19.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_team_data"}, "model.github_source.stg_github__issue_closed_history": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__issue_closed_history", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 2, "name": "updated_at", "comment": null}, "is_closed": {"type": "BOOL", "index": 3, "name": "is_closed", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2907.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 171.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_closed_history"}}, "sources": {"source.github_source.github.pull_request_review": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_pull_request_review_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "commit_sha": {"type": "STRING", "index": 4, "name": "commit_sha", "comment": null}, "pull_request_id": {"type": "INT64", "index": 5, "name": "pull_request_id", "comment": null}, "state": {"type": "STRING", "index": 6, "name": "state", "comment": null}, "submitted_at": {"type": "TIMESTAMP", "index": 7, "name": "submitted_at", "comment": null}, "user_id": {"type": "INT64", "index": 8, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 18059.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 114.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.pull_request_review"}, "source.github_source.github.issue_comment": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_comment_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "created_at": {"type": "DATETIME", "index": 4, "name": "created_at", "comment": null}, "issue_id": {"type": "INT64", "index": 5, "name": "issue_id", "comment": null}, "updated_at": {"type": "DATETIME", "index": 6, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 7, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 4902.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 43.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.issue_comment"}, "source.github_source.github.repository": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_repository_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "archived": {"type": "BOOL", "index": 3, "name": "archived", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "default_branch": {"type": "STRING", "index": 5, "name": "default_branch", "comment": null}, "description": {"type": "STRING", "index": 6, "name": "description", "comment": null}, "fork": {"type": "BOOL", "index": 7, "name": "fork", "comment": null}, "full_name": {"type": "STRING", "index": 8, "name": "full_name", "comment": null}, "homepage": {"type": "INT64", "index": 9, "name": "homepage", "comment": null}, "language": {"type": "STRING", "index": 10, "name": "language", "comment": null}, "name": {"type": "STRING", "index": 11, "name": "name", "comment": null}, "owner_id": {"type": "INT64", "index": 12, "name": "owner_id", "comment": null}, "private": {"type": "BOOL", "index": 13, "name": "private", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 5793.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 24.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.repository"}, "source.github_source.github.issue_merged": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_merged_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"commit_sha": {"type": "STRING", "index": 1, "name": "commit_sha", "comment": null}, "issue_id": {"type": "INT64", "index": 2, "name": "issue_id", "comment": null}, "merged_at": {"type": "TIMESTAMP", "index": 3, "name": "merged_at", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 5, "name": "actor_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 8140.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 110.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.issue_merged"}, "source.github_source.github.issue_label": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_label_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "label_id": {"type": "INT64", "index": 2, "name": "label_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1104.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 46.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.issue_label"}, "source.github_source.github.issue_assignee": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_assignee_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "user_id": {"type": "INT64", "index": 2, "name": "user_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 4800.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 200.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.issue_assignee"}, "source.github_source.github.label": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_label_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "color": {"type": "STRING", "index": 3, "name": "color", "comment": null}, "description": {"type": "STRING", "index": 4, "name": "description", "comment": null}, "is_default": {"type": "BOOL", "index": 5, "name": "is_default", "comment": null}, "name": {"type": "STRING", "index": 6, "name": "name", "comment": null}, "url": {"type": "STRING", "index": 7, "name": "url", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2016.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 15.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.label"}, "source.github_source.github.repo_team": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_repo_team_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"repository_id": {"type": "INT64", "index": 1, "name": "repository_id", "comment": null}, "team_id": {"type": "INT64", "index": 2, "name": "team_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "permission": {"type": "STRING", "index": 4, "name": "permission", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 464.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 8.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.repo_team"}, "source.github_source.github.pull_request": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_pull_request_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "base_label": {"type": "STRING", "index": 3, "name": "base_label", "comment": null}, "base_ref": {"type": "STRING", "index": 4, "name": "base_ref", "comment": null}, "base_repo_id": {"type": "INT64", "index": 5, "name": "base_repo_id", "comment": null}, "base_sha": {"type": "STRING", "index": 6, "name": "base_sha", "comment": null}, "base_user_id": {"type": "INT64", "index": 7, "name": "base_user_id", "comment": null}, "head_label": {"type": "STRING", "index": 8, "name": "head_label", "comment": null}, "head_ref": {"type": "STRING", "index": 9, "name": "head_ref", "comment": null}, "head_repo_id": {"type": "INT64", "index": 10, "name": "head_repo_id", "comment": null}, "head_sha": {"type": "STRING", "index": 11, "name": "head_sha", "comment": null}, "head_user_id": {"type": "INT64", "index": 12, "name": "head_user_id", "comment": null}, "issue_id": {"type": "INT64", "index": 13, "name": "issue_id", "comment": null}, "merge_commit_sha": {"type": "STRING", "index": 14, "name": "merge_commit_sha", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 56627.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 167.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.pull_request"}, "source.github_source.github.issue_closed_history": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_closed_history_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 2, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 4, "name": "actor_id", "comment": null}, "closed": {"type": "BOOL", "index": 5, "name": "closed", "comment": null}, "commit_sha": {"type": "INT64", "index": 6, "name": "commit_sha", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 5643.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 171.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.issue_closed_history"}, "source.github_source.github.user": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_user_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "bio": {"type": "STRING", "index": 3, "name": "bio", "comment": null}, "blog": {"type": "STRING", "index": 4, "name": "blog", "comment": null}, "company": {"type": "STRING", "index": 5, "name": "company", "comment": null}, "created_at": {"type": "DATETIME", "index": 6, "name": "created_at", "comment": null}, "hireable": {"type": "BOOL", "index": 7, "name": "hireable", "comment": null}, "location": {"type": "STRING", "index": 8, "name": "location", "comment": null}, "login": {"type": "STRING", "index": 9, "name": "login", "comment": null}, "name": {"type": "STRING", "index": 10, "name": "name", "comment": null}, "site_admin": {"type": "BOOL", "index": 11, "name": "site_admin", "comment": null}, "type": {"type": "STRING", "index": 12, "name": "type", "comment": null}, "updated_at": {"type": "DATETIME", "index": 13, "name": "updated_at", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 7405.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 17.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.user"}, "source.github_source.github.requested_reviewer_history": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_requested_reviewer_history_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"created_at": {"type": "TIMESTAMP", "index": 1, "name": "created_at", "comment": null}, "pull_request_id": {"type": "INT64", "index": 2, "name": "pull_request_id", "comment": null}, "requested_id": {"type": "INT64", "index": 3, "name": "requested_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 5, "name": "actor_id", "comment": null}, "removed": {"type": "BOOL", "index": 6, "name": "removed", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1681.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 41.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.requested_reviewer_history"}, "source.github_source.github.issue": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "closed_at": {"type": "TIMESTAMP", "index": 4, "name": "closed_at", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 5, "name": "created_at", "comment": null}, "locked": {"type": "BOOL", "index": 6, "name": "locked", "comment": null}, "milestone_id": {"type": "INT64", "index": 7, "name": "milestone_id", "comment": null}, "number": {"type": "INT64", "index": 8, "name": "number", "comment": null}, "pull_request": {"type": "BOOL", "index": 9, "name": "pull_request", "comment": null}, "repository_id": {"type": "INT64", "index": 10, "name": "repository_id", "comment": null}, "state": {"type": "STRING", "index": 11, "name": "state", "comment": null}, "title": {"type": "STRING", "index": 12, "name": "title", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 13, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 14, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 40530.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 197.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.issue"}, "source.github_source.github.team": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_team_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "description": {"type": "STRING", "index": 3, "name": "description", "comment": null}, "name": {"type": "STRING", "index": 4, "name": "name", "comment": null}, "org_id": {"type": "INT64", "index": 5, "name": "org_id", "comment": null}, "parent_id": {"type": "INT64", "index": 6, "name": "parent_id", "comment": null}, "privacy": {"type": "STRING", "index": 7, "name": "privacy", "comment": null}, "slug": {"type": "STRING", "index": 8, "name": "slug", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2346.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 19.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.team"}}, "errors": null} \ No newline at end of file diff --git a/docs/manifest.json b/docs/manifest.json index ce7583e..919505d 100644 --- a/docs/manifest.json +++ b/docs/manifest.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v7.json", "dbt_version": "1.3.0", "generated_at": "2022-11-01T00:40:11.757530Z", "invocation_id": "581c3815-414c-47e3-91e9-f6b3f49621e9", "env": {}, "project_id": "b4ed7eda1f97e936d48d60e52edb4717", "user_id": "8268eefe-e8f7-472e-ab2a-a92f0135d76d", "send_anonymous_usage_stats": true, "adapter_type": "bigquery"}, "nodes": {"seed.github_integration_tests.github_pull_request_review_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "INT64", "submitted_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_integration_tests", "github_pull_request_review_data"], "unique_id": "seed.github_integration_tests.github_pull_request_review_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_pull_request_review_data.csv", "original_file_path": "seeds/github_pull_request_review_data.csv", "name": "github_pull_request_review_data", "alias": "github_pull_request_review_data", "checksum": {"name": "sha256", "checksum": "4bdebf989d5e5d1bf41df343300be0a7e2a12f74b8148de6a97e75118edf0efa"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "submitted_at": "timestamp"}}, "created_at": 1667263067.480431, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`github_pull_request_review_data`"}, "seed.github_integration_tests.github_label_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "INT64"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_integration_tests", "github_label_data"], "unique_id": "seed.github_integration_tests.github_label_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_label_data.csv", "original_file_path": "seeds/github_label_data.csv", "name": "github_label_data", "alias": "github_label_data", "checksum": {"name": "sha256", "checksum": "f47357ad7761ae8e671c889ce5e385f6916b78cb669dfc65f09bacea1ecafb1f"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "created_at": 1667263067.485953, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`github_label_data`"}, "seed.github_integration_tests.github_repository_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "created_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_integration_tests", "github_repository_data"], "unique_id": "seed.github_integration_tests.github_repository_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_repository_data.csv", "original_file_path": "seeds/github_repository_data.csv", "name": "github_repository_data", "alias": "github_repository_data", "checksum": {"name": "sha256", "checksum": "78cd55c70468340db27d24a3fc299fc8c191129ca26ea80620a0d796a608a1a4"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"created_at": "timestamp"}}, "created_at": 1667263067.487318, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`github_repository_data`"}, "seed.github_integration_tests.github_issue_merged_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "merged_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_integration_tests", "github_issue_merged_data"], "unique_id": "seed.github_integration_tests.github_issue_merged_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_issue_merged_data.csv", "original_file_path": "seeds/github_issue_merged_data.csv", "name": "github_issue_merged_data", "alias": "github_issue_merged_data", "checksum": {"name": "sha256", "checksum": "397efa928dca45bafbdc11219b3335265bd9a6cce1447c02e07c0bf53ddaba31"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"merged_at": "timestamp"}}, "created_at": 1667263067.4884942, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`github_issue_merged_data`"}, "seed.github_integration_tests.github_issue_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "closed_at": "timestamp", "created_at": "timestamp", "updated_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_integration_tests", "github_issue_data"], "unique_id": "seed.github_integration_tests.github_issue_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_issue_data.csv", "original_file_path": "seeds/github_issue_data.csv", "name": "github_issue_data", "alias": "github_issue_data", "checksum": {"name": "sha256", "checksum": "6eabcc9bc0920d64775f8058446b279e803384a2205f18a07d7a2f1ebcf89286"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"closed_at": "timestamp", "created_at": "timestamp", "updated_at": "timestamp"}}, "created_at": 1667263067.4896698, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`github_issue_data`"}, "seed.github_integration_tests.github_repo_team_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_integration_tests", "github_repo_team_data"], "unique_id": "seed.github_integration_tests.github_repo_team_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_repo_team_data.csv", "original_file_path": "seeds/github_repo_team_data.csv", "name": "github_repo_team_data", "alias": "github_repo_team_data", "checksum": {"name": "sha256", "checksum": "3a16bf772f5f15231f0d7e26c116041543fad5a9dbdabbdfec30ddd063058722"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1667263067.4909859, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`github_repo_team_data`"}, "seed.github_integration_tests.github_requested_reviewer_history_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "created_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_integration_tests", "github_requested_reviewer_history_data"], "unique_id": "seed.github_integration_tests.github_requested_reviewer_history_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_requested_reviewer_history_data.csv", "original_file_path": "seeds/github_requested_reviewer_history_data.csv", "name": "github_requested_reviewer_history_data", "alias": "github_requested_reviewer_history_data", "checksum": {"name": "sha256", "checksum": "91225ac95874fc314f772530dfcb6ece74f35c292ea5bba53ff86b599b902743"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"created_at": "timestamp"}}, "created_at": 1667263067.4922812, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`github_requested_reviewer_history_data`"}, "seed.github_integration_tests.github_issue_label_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "issue_id": "INT64", "label_id": "INT64"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_integration_tests", "github_issue_label_data"], "unique_id": "seed.github_integration_tests.github_issue_label_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_issue_label_data.csv", "original_file_path": "seeds/github_issue_label_data.csv", "name": "github_issue_label_data", "alias": "github_issue_label_data", "checksum": {"name": "sha256", "checksum": "847ef3245b5610a81f3d8e91b4787d24829b2b0d3d064c529a61d430e90f0585"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"issue_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "label_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "created_at": 1667263067.493474, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`github_issue_label_data`"}, "seed.github_integration_tests.github_issue_comment_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "INT64"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_integration_tests", "github_issue_comment_data"], "unique_id": "seed.github_integration_tests.github_issue_comment_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_issue_comment_data.csv", "original_file_path": "seeds/github_issue_comment_data.csv", "name": "github_issue_comment_data", "alias": "github_issue_comment_data", "checksum": {"name": "sha256", "checksum": "6cc173c061308bc4de703c7c5d0fc30228b2c86117ed7db1daf9decf1a4238cd"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "created_at": 1667263067.494654, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`github_issue_comment_data`"}, "seed.github_integration_tests.github_issue_assignee_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_integration_tests", "github_issue_assignee_data"], "unique_id": "seed.github_integration_tests.github_issue_assignee_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_issue_assignee_data.csv", "original_file_path": "seeds/github_issue_assignee_data.csv", "name": "github_issue_assignee_data", "alias": "github_issue_assignee_data", "checksum": {"name": "sha256", "checksum": "fe25fadc4593349b873b50da5e2e2fbf436cbb3c1bcfe325c3340c64a7d8972b"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1667263067.495799, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`github_issue_assignee_data`"}, "seed.github_integration_tests.github_issue_closed_history_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "updated_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_integration_tests", "github_issue_closed_history_data"], "unique_id": "seed.github_integration_tests.github_issue_closed_history_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_issue_closed_history_data.csv", "original_file_path": "seeds/github_issue_closed_history_data.csv", "name": "github_issue_closed_history_data", "alias": "github_issue_closed_history_data", "checksum": {"name": "sha256", "checksum": "5f281ce9e29e69280633dc6aae2e9f8028c86815442821a608bb793c82aab3f1"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"updated_at": "timestamp"}}, "created_at": 1667263067.497047, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`github_issue_closed_history_data`"}, "seed.github_integration_tests.github_pull_request_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_integration_tests", "github_pull_request_data"], "unique_id": "seed.github_integration_tests.github_pull_request_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_pull_request_data.csv", "original_file_path": "seeds/github_pull_request_data.csv", "name": "github_pull_request_data", "alias": "github_pull_request_data", "checksum": {"name": "sha256", "checksum": "1e27d3e9b6881a3fda6402b048071032411d81612ff4b2009d852a194b137006"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1667263067.4981918, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`github_pull_request_data`"}, "seed.github_integration_tests.github_team_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_integration_tests", "github_team_data"], "unique_id": "seed.github_integration_tests.github_team_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_team_data.csv", "original_file_path": "seeds/github_team_data.csv", "name": "github_team_data", "alias": "github_team_data", "checksum": {"name": "sha256", "checksum": "a3916608387192c2bcec219067bd19e3280a23a3d4f546390e5d7e9aa16420bd"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1667263067.499292, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`github_team_data`"}, "seed.github_integration_tests.github_user_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_integration_tests", "github_user_data"], "unique_id": "seed.github_integration_tests.github_user_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_user_data.csv", "original_file_path": "seeds/github_user_data.csv", "name": "github_user_data", "alias": "github_user_data", "checksum": {"name": "sha256", "checksum": "5d101839c6a685fac17231a071c6516f3ac668b133d7a96a83d97ede20f16e46"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1667263067.500515, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`github_user_data`"}, "model.github.github__weekly_metrics": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.date_trunc"], "nodes": ["model.github.github__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github", "github__weekly_metrics"], "unique_id": "model.github.github__weekly_metrics", "raw_code": "with daily_metrics as (\n select *\n from {{ ref('github__daily_metrics') }}\n)\n\nselect \n {{ dbt.date_trunc('week', 'day') }} as week, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__weekly_metrics.sql", "original_file_path": "models/github__weekly_metrics.sql", "name": "github__weekly_metrics", "alias": "github__weekly_metrics", "checksum": {"name": "sha256", "checksum": "0c23e13d9ae5aa9256b832965069a021826131bbcf8c23be244b660d1a513870"}, "tags": [], "refs": [["github__daily_metrics"]], "sources": [], "metrics": [], "description": "Summary numbers for issues and pull requests by week\n", "columns": {"week": {"name": "week", "description": "The reporting week", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_opened": {"name": "number_issues_opened", "description": "The total number of issues created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_closed": {"name": "number_issues_closed", "description": "The total number of issues closed during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_issue_open": {"name": "avg_days_issue_open", "description": "The average number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_issue_open": {"name": "longest_days_issue_open", "description": "The longest number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_opened": {"name": "number_prs_opened", "description": "The total number of pull requests created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_merged": {"name": "number_prs_merged", "description": "The total number of pull requests merged during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_closed_without_merge": {"name": "number_prs_closed_without_merge", "description": "The total number of pull requests closed without a merge during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_pr_open": {"name": "avg_days_pr_open", "description": "The average number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_pr_open": {"name": "longest_days_pr_open", "description": "The longest number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__weekly_metrics.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667263067.7840981, "compiled_code": "with daily_metrics as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`github__daily_metrics`\n)\n\nselect \n timestamp_trunc(\n cast(day as timestamp),\n week\n ) as week, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`github__weekly_metrics`"}, "model.github.github__monthly_metrics": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.date_trunc"], "nodes": ["model.github.github__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github", "github__monthly_metrics"], "unique_id": "model.github.github__monthly_metrics", "raw_code": "with daily_metrics as (\n select *\n from {{ ref('github__daily_metrics') }}\n)\n\nselect \n {{ dbt.date_trunc('month', 'day') }} as month, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__monthly_metrics.sql", "original_file_path": "models/github__monthly_metrics.sql", "name": "github__monthly_metrics", "alias": "github__monthly_metrics", "checksum": {"name": "sha256", "checksum": "13125ad4966c9d1caa3cd74e6174cc3845a7ceb7929836e849e70628af2b0d0d"}, "tags": [], "refs": [["github__daily_metrics"]], "sources": [], "metrics": [], "description": "Summary numbers for issues and pull requests by month\n", "columns": {"month": {"name": "month", "description": "The reporting month", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_opened": {"name": "number_issues_opened", "description": "The total number of issues created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_closed": {"name": "number_issues_closed", "description": "The total number of issues closed during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_issue_open": {"name": "avg_days_issue_open", "description": "The average number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_issue_open": {"name": "longest_days_issue_open", "description": "The longest number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_opened": {"name": "number_prs_opened", "description": "The total number of pull requests created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_merged": {"name": "number_prs_merged", "description": "The total number of pull requests merged during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_closed_without_merge": {"name": "number_prs_closed_without_merge", "description": "The total number of pull requests closed without a merge during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_pr_open": {"name": "avg_days_pr_open", "description": "The average number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_pr_open": {"name": "longest_days_pr_open", "description": "The longest number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__monthly_metrics.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667263067.785713, "compiled_code": "with daily_metrics as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`github__daily_metrics`\n)\n\nselect \n timestamp_trunc(\n cast(day as timestamp),\n month\n ) as month, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`github__monthly_metrics`"}, "model.github.github__quarterly_metrics": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.date_trunc"], "nodes": ["model.github.github__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github", "github__quarterly_metrics"], "unique_id": "model.github.github__quarterly_metrics", "raw_code": "with daily_metrics as (\n select *\n from {{ ref('github__daily_metrics') }}\n)\n\nselect \n {{ dbt.date_trunc('quarter', 'day') }} as quarter, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\n\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__quarterly_metrics.sql", "original_file_path": "models/github__quarterly_metrics.sql", "name": "github__quarterly_metrics", "alias": "github__quarterly_metrics", "checksum": {"name": "sha256", "checksum": "482a40e9b5ae8283bec98905910cc35747f7f98accd058453d69064844533c50"}, "tags": [], "refs": [["github__daily_metrics"]], "sources": [], "metrics": [], "description": "Summary numbers for issues and pull requests by quarter\n", "columns": {"quarter": {"name": "quarter", "description": "The reporting quarter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_opened": {"name": "number_issues_opened", "description": "The total number of issues created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_closed": {"name": "number_issues_closed", "description": "The total number of issues closed during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_issue_open": {"name": "avg_days_issue_open", "description": "The average number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_issue_open": {"name": "longest_days_issue_open", "description": "The longest number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_opened": {"name": "number_prs_opened", "description": "The total number of pull requests created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_merged": {"name": "number_prs_merged", "description": "The total number of pull requests merged during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_closed_without_merge": {"name": "number_prs_closed_without_merge", "description": "The total number of pull requests closed without a merge during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_pr_open": {"name": "avg_days_pr_open", "description": "The average number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_pr_open": {"name": "longest_days_pr_open", "description": "The longest number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__quarterly_metrics.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667263067.787318, "compiled_code": "with daily_metrics as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`github__daily_metrics`\n)\n\nselect \n timestamp_trunc(\n cast(day as timestamp),\n quarter\n ) as quarter, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\n\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`github__quarterly_metrics`"}, "model.github.github__pull_requests": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.github.int_github__issue_joined"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github", "github__pull_requests"], "unique_id": "model.github.github__pull_requests", "raw_code": "with issue_joined as (\n select *\n from {{ ref('int_github__issue_joined') }} \n)\n\nselect\n *\nfrom issue_joined\nwhere is_pull_request", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__pull_requests.sql", "original_file_path": "models/github__pull_requests.sql", "name": "github__pull_requests", "alias": "github__pull_requests", "checksum": {"name": "sha256", "checksum": "ab4761ae05c0aabc7585d92ed7c68e12b53317a47a4278810e1777a051f43350"}, "tags": [], "refs": [["int_github__issue_joined"]], "sources": [], "metrics": [], "description": "Basic information about pull_requests as well as additional fields about reviews and time between actions\n", "columns": {"issue_id": {"name": "issue_id", "description": "The unique ID of an issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "body": {"name": "body", "description": "the text body of the description of the pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed_at": {"name": "closed_at", "description": "Timestamp of when the pull request was closed. NULL for pull requests that are still open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the pull request was created", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_locked": {"name": "is_locked", "description": "Boolean indicating whether the issue is locked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "milestone_id": {"name": "milestone_id", "description": "Foreign key that references the milestone.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_pull_request": {"name": "is_pull_request", "description": "Boolean indiciating whether the issue is a pull request.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_number": {"name": "issue_number", "description": "The number of the pull request. Unique within a repository, but not accross.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_id": {"name": "repository_id", "description": "Foreign key that references the repository table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the issue was last updated", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "days_issue_open": {"name": "days_issue_open", "description": "The number of days an issue has been open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_times_reopened": {"name": "number_of_times_reopened", "description": "Total number of times the issue was reopened", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_comments": {"name": "number_of_comments", "description": "The total number of comments included in the issue", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_login_name": {"name": "creator_login_name", "description": "User that created the issue login name", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_name": {"name": "creator_name", "description": "User that created the issue name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_company": {"name": "creator_company", "description": "User that created the issue company name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the pull request is open or closed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url_link": {"name": "url_link", "description": "A link to the pull request on github.com", "meta": {}, "data_type": null, "quote": null, "tags": []}, "labels": {"name": "labels", "description": "The labels currently applied to the pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository": {"name": "repository", "description": "The repository that the pull request applies to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_team_names": {"name": "repository_team_names", "description": "An aggreate of the teams associated with the repository", "meta": {}, "data_type": null, "quote": null, "tags": []}, "assignees": {"name": "assignees", "description": "Users who have been assigned to the pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hours_request_review_to_first_review": {"name": "hours_request_review_to_first_review", "description": "Number of hours between the first request for review and a review", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hours_request_review_to_first_action": {"name": "hours_request_review_to_first_action", "description": "Number of hours between the first request for review and any action besides dismissing the request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hours_request_review_to_merge": {"name": "hours_request_review_to_merge", "description": "Number of hours between the first request for review and the pull request being merged", "meta": {}, "data_type": null, "quote": null, "tags": []}, "merged_at": {"name": "merged_at", "description": "Timestamp of when the pull request was merged", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reviewers": {"name": "reviewers", "description": "List of Users who reviewed the pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_reviews": {"name": "number_of_reviews", "description": "Number of times a pull request was reviewed", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__pull_requests.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667263067.780905, "compiled_code": "with __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n), __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n), __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n), __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n), __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n), __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n), __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n), __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n), __dbt__cte__int_github__issue_joined as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\n), \n\nissue_labels as (\n select *\n from __dbt__cte__int_github__issue_labels\n), \n\nrepository_teams as (\n select \n \n *\n from __dbt__cte__int_github__repository_teams\n\n \n), \n\nissue_assignees as (\n select *\n from __dbt__cte__int_github__issue_assignees\n), \n\nissue_open_length as (\n select *\n from __dbt__cte__int_github__issue_open_length\n), \n\nissue_comments as (\n select *\n from __dbt__cte__int_github__issue_comments\n), \n\ncreator as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\n), \n\npull_request_times as (\n select *\n from __dbt__cte__int_github__pull_request_times\n), \n\npull_request_reviewers as (\n select *\n from __dbt__cte__int_github__pull_request_reviewers\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request`\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then 'https://github.com/' || repository_teams.repository || '/pull/' || issue.issue_number\n else 'https://github.com/' || repository_teams.repository || '/issues/' || issue.issue_number\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n \n repository_teams.repository_team_names,\n \n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id\n),issue_joined as (\n select *\n from __dbt__cte__int_github__issue_joined \n)\n\nselect\n *\nfrom issue_joined\nwhere is_pull_request", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.github.int_github__issue_label_joined", "sql": " __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n)"}, {"id": "model.github.int_github__issue_labels", "sql": " __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n)"}, {"id": "model.github.int_github__repository_teams", "sql": " __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n)"}, {"id": "model.github.int_github__issue_assignees", "sql": " __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n)"}, {"id": "model.github.int_github__issue_open_length", "sql": " __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n)"}, {"id": "model.github.int_github__issue_comments", "sql": " __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n)"}, {"id": "model.github.int_github__pull_request_times", "sql": " __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n)"}, {"id": "model.github.int_github__pull_request_reviewers", "sql": " __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n)"}, {"id": "model.github.int_github__issue_joined", "sql": " __dbt__cte__int_github__issue_joined as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\n), \n\nissue_labels as (\n select *\n from __dbt__cte__int_github__issue_labels\n), \n\nrepository_teams as (\n select \n \n *\n from __dbt__cte__int_github__repository_teams\n\n \n), \n\nissue_assignees as (\n select *\n from __dbt__cte__int_github__issue_assignees\n), \n\nissue_open_length as (\n select *\n from __dbt__cte__int_github__issue_open_length\n), \n\nissue_comments as (\n select *\n from __dbt__cte__int_github__issue_comments\n), \n\ncreator as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\n), \n\npull_request_times as (\n select *\n from __dbt__cte__int_github__pull_request_times\n), \n\npull_request_reviewers as (\n select *\n from __dbt__cte__int_github__pull_request_reviewers\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request`\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then 'https://github.com/' || repository_teams.repository || '/pull/' || issue.issue_number\n else 'https://github.com/' || repository_teams.repository || '/issues/' || issue.issue_number\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n \n repository_teams.repository_team_names,\n \n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id\n)"}], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`github__pull_requests`"}, "model.github.github__daily_metrics": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.date_trunc"], "nodes": ["model.github.github__issues", "model.github.github__pull_requests"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github", "github__daily_metrics"], "unique_id": "model.github.github__daily_metrics", "raw_code": "with github_issues as (\n select *\n from {{ ref('github__issues') }}\n), \n\npull_requests as (\n select *\n from {{ ref('github__pull_requests') }}\n), \n\nissues_opened_per_day as (\n select \n {{ dbt.date_trunc('day', 'created_at') }} as day, \n count(*) as number_issues_opened,\n sum(days_issue_open) as sum_days_issue_open,\n max(days_issue_open) as longest_days_issue_open\n from github_issues\n group by 1\n), \n\nissues_closed_per_day as (\n select \n {{ dbt.date_trunc('day', 'closed_at') }} as day, \n count(*) as number_issues_closed\n from github_issues\n where closed_at is not null\n group by 1\n), \n\nprs_opened_per_day as (\n select \n {{ dbt.date_trunc('day', 'created_at') }} as day, \n count(*) as number_prs_opened,\n sum(days_issue_open) as sum_days_pr_open,\n max(days_issue_open) as longest_days_pr_open\n from pull_requests\n group by 1\n), \n\nprs_merged_per_day as (\n select \n {{ dbt.date_trunc('day', 'merged_at') }} as day, \n count(*) as number_prs_merged\n from pull_requests\n where merged_at is not null\n group by 1\n), \n\nprs_closed_without_merge_per_day as (\n select \n {{ dbt.date_trunc('day', 'closed_at') }} as day, \n count(*) as number_prs_closed_without_merge\n from pull_requests\n where closed_at is not null\n and merged_at is null\n group by 1\n), \n\nissues_per_day as (\n select \n coalesce(issues_opened_per_day.day, \n issues_closed_per_day.day\n ) as day,\n number_issues_opened,\n number_issues_closed, \n sum_days_issue_open,\n longest_days_issue_open\n from issues_opened_per_day\n full outer join issues_closed_per_day on issues_opened_per_day.day = issues_closed_per_day.day\n), \n\nprs_per_day as (\n select \n coalesce(prs_opened_per_day.day, \n prs_merged_per_day.day,\n prs_closed_without_merge_per_day.day\n ) as day,\n number_prs_opened,\n number_prs_merged,\n number_prs_closed_without_merge,\n sum_days_pr_open,\n longest_days_pr_open\n from prs_opened_per_day\n full outer join prs_merged_per_day on prs_opened_per_day.day = prs_merged_per_day.day\n full outer join prs_closed_without_merge_per_day on coalesce(prs_opened_per_day.day, prs_merged_per_day.day) = prs_closed_without_merge_per_day.day\n)\n\nselect \n coalesce(issues_per_day.day, prs_per_day.day) as day,\n coalesce(number_issues_opened, 0) as number_issues_opened,\n coalesce(number_issues_closed, 0) as number_issues_closed,\n sum_days_issue_open,\n longest_days_issue_open,\n coalesce(number_prs_opened, 0) as number_prs_opened,\n coalesce(number_prs_merged, 0) as number_prs_merged,\n coalesce(number_prs_closed_without_merge, 0) as number_prs_closed_without_merge,\n sum_days_pr_open,\n longest_days_pr_open\nfrom issues_per_day \nfull outer join prs_per_day on issues_per_day.day = prs_per_day.day\norder by day desc", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__daily_metrics.sql", "original_file_path": "models/github__daily_metrics.sql", "name": "github__daily_metrics", "alias": "github__daily_metrics", "checksum": {"name": "sha256", "checksum": "a6ee3eb9c8198f8b11e48b8e0206e90860a02af8a20f748985a58499dde4f476"}, "tags": [], "refs": [["github__issues"], ["github__pull_requests"]], "sources": [], "metrics": [], "description": "Summary numbers for issues and pull requests by day\n", "columns": {"day": {"name": "day", "description": "The reporting day", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_opened": {"name": "number_issues_opened", "description": "The total number of issues created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_closed": {"name": "number_issues_closed", "description": "The total number of issues closed during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sum_days_issue_open": {"name": "sum_days_issue_open", "description": "The total number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_issue_open": {"name": "longest_days_issue_open", "description": "The longest number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_opened": {"name": "number_prs_opened", "description": "The total number of pull requests created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_merged": {"name": "number_prs_merged", "description": "The total number of pull requests merged during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_closed_without_merge": {"name": "number_prs_closed_without_merge", "description": "The total number of pull requests closed without a merge during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sum_days_pr_open": {"name": "sum_days_pr_open", "description": "The total number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_pr_open": {"name": "longest_days_pr_open", "description": "The longest number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__daily_metrics.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667263067.78254, "compiled_code": "with github_issues as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`github__issues`\n), \n\npull_requests as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`github__pull_requests`\n), \n\nissues_opened_per_day as (\n select \n timestamp_trunc(\n cast(created_at as timestamp),\n day\n ) as day, \n count(*) as number_issues_opened,\n sum(days_issue_open) as sum_days_issue_open,\n max(days_issue_open) as longest_days_issue_open\n from github_issues\n group by 1\n), \n\nissues_closed_per_day as (\n select \n timestamp_trunc(\n cast(closed_at as timestamp),\n day\n ) as day, \n count(*) as number_issues_closed\n from github_issues\n where closed_at is not null\n group by 1\n), \n\nprs_opened_per_day as (\n select \n timestamp_trunc(\n cast(created_at as timestamp),\n day\n ) as day, \n count(*) as number_prs_opened,\n sum(days_issue_open) as sum_days_pr_open,\n max(days_issue_open) as longest_days_pr_open\n from pull_requests\n group by 1\n), \n\nprs_merged_per_day as (\n select \n timestamp_trunc(\n cast(merged_at as timestamp),\n day\n ) as day, \n count(*) as number_prs_merged\n from pull_requests\n where merged_at is not null\n group by 1\n), \n\nprs_closed_without_merge_per_day as (\n select \n timestamp_trunc(\n cast(closed_at as timestamp),\n day\n ) as day, \n count(*) as number_prs_closed_without_merge\n from pull_requests\n where closed_at is not null\n and merged_at is null\n group by 1\n), \n\nissues_per_day as (\n select \n coalesce(issues_opened_per_day.day, \n issues_closed_per_day.day\n ) as day,\n number_issues_opened,\n number_issues_closed, \n sum_days_issue_open,\n longest_days_issue_open\n from issues_opened_per_day\n full outer join issues_closed_per_day on issues_opened_per_day.day = issues_closed_per_day.day\n), \n\nprs_per_day as (\n select \n coalesce(prs_opened_per_day.day, \n prs_merged_per_day.day,\n prs_closed_without_merge_per_day.day\n ) as day,\n number_prs_opened,\n number_prs_merged,\n number_prs_closed_without_merge,\n sum_days_pr_open,\n longest_days_pr_open\n from prs_opened_per_day\n full outer join prs_merged_per_day on prs_opened_per_day.day = prs_merged_per_day.day\n full outer join prs_closed_without_merge_per_day on coalesce(prs_opened_per_day.day, prs_merged_per_day.day) = prs_closed_without_merge_per_day.day\n)\n\nselect \n coalesce(issues_per_day.day, prs_per_day.day) as day,\n coalesce(number_issues_opened, 0) as number_issues_opened,\n coalesce(number_issues_closed, 0) as number_issues_closed,\n sum_days_issue_open,\n longest_days_issue_open,\n coalesce(number_prs_opened, 0) as number_prs_opened,\n coalesce(number_prs_merged, 0) as number_prs_merged,\n coalesce(number_prs_closed_without_merge, 0) as number_prs_closed_without_merge,\n sum_days_pr_open,\n longest_days_pr_open\nfrom issues_per_day \nfull outer join prs_per_day on issues_per_day.day = prs_per_day.day\norder by day desc", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`github__daily_metrics`"}, "model.github.github__issues": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.github.int_github__issue_joined"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github", "github__issues"], "unique_id": "model.github.github__issues", "raw_code": "with issue_joined as (\n select *\n from {{ ref('int_github__issue_joined') }} \n)\n\nselect\n issue_id,\n body,\n closed_at,\n created_at,\n is_locked,\n milestone_id,\n issue_number,\n is_pull_request,\n repository_id,\n state,\n title,\n updated_at,\n user_id,\n url_link,\n days_issue_open,\n number_of_times_reopened,\n labels,\n number_of_comments,\n repository,\n {% if var('github__using_repo_team', true) %}\n repository_team_names,\n {% endif %}\n assignees,\n creator_login_name,\n creator_name,\n creator_company\nfrom issue_joined\nwhere not is_pull_request", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__issues.sql", "original_file_path": "models/github__issues.sql", "name": "github__issues", "alias": "github__issues", "checksum": {"name": "sha256", "checksum": "382d94f82ea63be958d53cc7353d6e3e792844f45ab9c48609e03355eb68a133"}, "tags": [], "refs": [["int_github__issue_joined"]], "sources": [], "metrics": [], "description": "Basic information about issues as well as additional fields for things like assignees, projects, labels and open time\n", "columns": {"issue_id": {"name": "issue_id", "description": "The unique ID of an issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "body": {"name": "body", "description": "The text body of the issue's main description", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed_at": {"name": "closed_at", "description": "The timestamp for when an issue was last closed. \"null\" for issues that are open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The timestamp for when an issue was created", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_locked": {"name": "is_locked", "description": "Boolean indicating if the issue is locked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "milestone_id": {"name": "milestone_id", "description": "Foreign key that references the milestone table representing the current milestone the issue is in", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_number": {"name": "issue_number", "description": "The number of the issue. Is unique within a repository, but not accross", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_pull_request": {"name": "is_pull_request", "description": "Boolean indicating whether the issue is a pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_id": {"name": "repository_id", "description": "Foreign key that references the repository table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the issue is open or closed", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the issue", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the issue was last updated", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url_link": {"name": "url_link", "description": "a link to the issue on github.com", "meta": {}, "data_type": null, "quote": null, "tags": []}, "days_issue_open": {"name": "days_issue_open", "description": "The number of days an issue has been open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_times_reopened": {"name": "number_of_times_reopened", "description": "Total number of times the issue was reopened", "meta": {}, "data_type": null, "quote": null, "tags": []}, "labels": {"name": "labels", "description": "A list of the labels that are currently applied to the issue", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_comments": {"name": "number_of_comments", "description": "The total number of comments included in the issue", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_login_name": {"name": "creator_login_name", "description": "User that created the issue login name", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_name": {"name": "creator_name", "description": "User that created the issue name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_company": {"name": "creator_company", "description": "User that created the issue company name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository": {"name": "repository", "description": "The repository that the issue is applicable to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_team_names": {"name": "repository_team_names", "description": "An aggreate of the teams associated with the repository", "meta": {}, "data_type": null, "quote": null, "tags": []}, "assignees": {"name": "assignees", "description": "The current list of users assigned to the issue", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__issues.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667263067.776181, "compiled_code": "with __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n), __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n), __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n), __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n), __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n), __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n), __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n), __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n), __dbt__cte__int_github__issue_joined as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\n), \n\nissue_labels as (\n select *\n from __dbt__cte__int_github__issue_labels\n), \n\nrepository_teams as (\n select \n \n *\n from __dbt__cte__int_github__repository_teams\n\n \n), \n\nissue_assignees as (\n select *\n from __dbt__cte__int_github__issue_assignees\n), \n\nissue_open_length as (\n select *\n from __dbt__cte__int_github__issue_open_length\n), \n\nissue_comments as (\n select *\n from __dbt__cte__int_github__issue_comments\n), \n\ncreator as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\n), \n\npull_request_times as (\n select *\n from __dbt__cte__int_github__pull_request_times\n), \n\npull_request_reviewers as (\n select *\n from __dbt__cte__int_github__pull_request_reviewers\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request`\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then 'https://github.com/' || repository_teams.repository || '/pull/' || issue.issue_number\n else 'https://github.com/' || repository_teams.repository || '/issues/' || issue.issue_number\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n \n repository_teams.repository_team_names,\n \n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id\n),issue_joined as (\n select *\n from __dbt__cte__int_github__issue_joined \n)\n\nselect\n issue_id,\n body,\n closed_at,\n created_at,\n is_locked,\n milestone_id,\n issue_number,\n is_pull_request,\n repository_id,\n state,\n title,\n updated_at,\n user_id,\n url_link,\n days_issue_open,\n number_of_times_reopened,\n labels,\n number_of_comments,\n repository,\n \n repository_team_names,\n \n assignees,\n creator_login_name,\n creator_name,\n creator_company\nfrom issue_joined\nwhere not is_pull_request", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.github.int_github__issue_label_joined", "sql": " __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n)"}, {"id": "model.github.int_github__issue_labels", "sql": " __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n)"}, {"id": "model.github.int_github__repository_teams", "sql": " __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n)"}, {"id": "model.github.int_github__issue_assignees", "sql": " __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n)"}, {"id": "model.github.int_github__issue_open_length", "sql": " __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n)"}, {"id": "model.github.int_github__issue_comments", "sql": " __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n)"}, {"id": "model.github.int_github__pull_request_times", "sql": " __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n)"}, {"id": "model.github.int_github__pull_request_reviewers", "sql": " __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n)"}, {"id": "model.github.int_github__issue_joined", "sql": " __dbt__cte__int_github__issue_joined as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\n), \n\nissue_labels as (\n select *\n from __dbt__cte__int_github__issue_labels\n), \n\nrepository_teams as (\n select \n \n *\n from __dbt__cte__int_github__repository_teams\n\n \n), \n\nissue_assignees as (\n select *\n from __dbt__cte__int_github__issue_assignees\n), \n\nissue_open_length as (\n select *\n from __dbt__cte__int_github__issue_open_length\n), \n\nissue_comments as (\n select *\n from __dbt__cte__int_github__issue_comments\n), \n\ncreator as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\n), \n\npull_request_times as (\n select *\n from __dbt__cte__int_github__pull_request_times\n), \n\npull_request_reviewers as (\n select *\n from __dbt__cte__int_github__pull_request_reviewers\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request`\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then 'https://github.com/' || repository_teams.repository || '/pull/' || issue.issue_number\n else 'https://github.com/' || repository_teams.repository || '/issues/' || issue.issue_number\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n \n repository_teams.repository_team_names,\n \n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id\n)"}], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`github__issues`"}, "model.github.int_github__pull_request_times": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt.datediff"], "nodes": ["model.github_source.stg_github__pull_request_review", "model.github_source.stg_github__pull_request", "model.github_source.stg_github__requested_reviewer_history", "model.github_source.stg_github__issue", "model.github_source.stg_github__issue_merged"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github", "intermediate", "int_github__pull_request_times"], "unique_id": "model.github.int_github__pull_request_times", "raw_code": "with pull_request_review as (\n select *\n from {{ var('pull_request_review') }}\n), \n\npull_request as (\n select *\n from {{ var('pull_request')}}\n), \n\nrequested_reviewer_history as (\n select *\n from {{ var('requested_reviewer_history')}}\n where not removed\n), \n\nissue as (\n select *\n from {{ var('issue') }}\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from {{ var('issue_merged')}}\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n {{ dbt.datediff(\n 'time_of_first_request', \n \"coalesce(time_of_first_review_post_request, \" ~ dbt.current_timestamp_backcompat() ~ \")\", \n 'second') \n }}/ 60/60 as hours_request_review_to_first_review,\n {{ dbt.datediff(\n 'time_of_first_request', \n \"least(\n coalesce(time_of_first_requested_reviewer_review, \" ~ dbt.current_timestamp_backcompat() ~ \"),\n coalesce(issue.closed_at, \" ~ dbt.current_timestamp_backcompat() ~ \"))\", \n 'second') \n }} / 60/60 as hours_request_review_to_first_action,\n {{ dbt.datediff('time_of_first_request', 'merged_at', 'second') }}/ 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__pull_request_times.sql", "original_file_path": "models/intermediate/int_github__pull_request_times.sql", "name": "int_github__pull_request_times", "alias": "int_github__pull_request_times", "checksum": {"name": "sha256", "checksum": "35a197fef6ef12f2b408564be9d54b15ba8ff1eee0cf8514abedef9f7818422c"}, "tags": [], "refs": [["stg_github__pull_request_review"], ["stg_github__pull_request"], ["stg_github__requested_reviewer_history"], ["stg_github__issue"], ["stg_github__issue_merged"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__pull_request_times.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1667263067.5416598, "compiled_code": "with pull_request_review as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__pull_request_reviewers": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.github_source.stg_github__pull_request_review", "model.github_source.stg_github__user"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github", "intermediate", "int_github__pull_request_reviewers"], "unique_id": "model.github.int_github__pull_request_reviewers", "raw_code": "with pull_request_review as (\n select *\n from {{ var('pull_request_review') }}\n), \n\ngithub_user as (\n select *\n from {{ var('user')}}\n)\n\nselect\n pull_request_review.pull_request_id,\n {{ fivetran_utils.string_agg( 'github_user.login_name', \"', '\" )}} as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__pull_request_reviewers.sql", "original_file_path": "models/intermediate/int_github__pull_request_reviewers.sql", "name": "int_github__pull_request_reviewers", "alias": "int_github__pull_request_reviewers", "checksum": {"name": "sha256", "checksum": "fd5518273ce75ae9066be686308ee078ce9a3df73f3799620f8eb6e611655cd7"}, "tags": [], "refs": [["stg_github__pull_request_review"], ["stg_github__user"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__pull_request_reviewers.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1667263067.551459, "compiled_code": "with pull_request_review as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__issue_label_joined": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.github_source.stg_github__issue_label", "model.github_source.stg_github__label"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_label_joined"], "unique_id": "model.github.int_github__issue_label_joined", "raw_code": "with issue_label as (\n\n select *\n from {{ var('issue_label') }}\n\n), label as (\n\n select *\n from {{ var('label') }}\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_label_joined.sql", "original_file_path": "models/intermediate/int_github__issue_label_joined.sql", "name": "int_github__issue_label_joined", "alias": "int_github__issue_label_joined", "checksum": {"name": "sha256", "checksum": "6f1b225ff9958e67fae4ea1ba0be10ebb9426da364c758c37d0b83305d575d98"}, "tags": [], "refs": [["stg_github__issue_label"], ["stg_github__label"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_label_joined.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1667263067.556171, "compiled_code": "with issue_label as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__issue_joined": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.concat"], "nodes": ["model.github_source.stg_github__issue", "model.github.int_github__issue_labels", "model.github.int_github__repository_teams", "model.github.int_github__issue_assignees", "model.github.int_github__issue_open_length", "model.github.int_github__issue_comments", "model.github_source.stg_github__user", "model.github.int_github__pull_request_times", "model.github.int_github__pull_request_reviewers", "model.github_source.stg_github__pull_request"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_joined"], "unique_id": "model.github.int_github__issue_joined", "raw_code": "with issue as (\n select *\n from {{ var('issue') }}\n), \n\nissue_labels as (\n select *\n from {{ ref('int_github__issue_labels')}}\n), \n\nrepository_teams as (\n select \n {% if var('github__using_repo_team', true) %}\n *\n from {{ ref('int_github__repository_teams') }}\n\n {% else %}\n repository_id,\n full_name as repository\n from {{ var('repository') }}\n\n {% endif %}\n), \n\nissue_assignees as (\n select *\n from {{ ref('int_github__issue_assignees')}}\n), \n\nissue_open_length as (\n select *\n from {{ ref('int_github__issue_open_length')}}\n), \n\nissue_comments as (\n select *\n from {{ ref('int_github__issue_comments')}}\n), \n\ncreator as (\n select *\n from {{ var('user')}}\n), \n\npull_request_times as (\n select *\n from {{ ref('int_github__pull_request_times')}}\n), \n\npull_request_reviewers as (\n select *\n from {{ ref('int_github__pull_request_reviewers')}}\n), \n\npull_request as (\n select *\n from {{ var('pull_request')}}\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then {{ dbt.concat([\"'https://github.com/'\",'repository_teams.repository',\"'/pull/'\", 'issue.issue_number']) }}\n else {{ dbt.concat([\"'https://github.com/'\",'repository_teams.repository',\"'/issues/'\", 'issue.issue_number']) }}\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n {% if var('github__using_repo_team', true) %}\n repository_teams.repository_team_names,\n {% endif %}\n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_joined.sql", "original_file_path": "models/intermediate/int_github__issue_joined.sql", "name": "int_github__issue_joined", "alias": "int_github__issue_joined", "checksum": {"name": "sha256", "checksum": "75658855b696a3744360bbbf58433d6155e44d35128236e08da3df93b87ead16"}, "tags": [], "refs": [["stg_github__issue"], ["int_github__issue_labels"], ["int_github__repository_teams"], ["int_github__issue_assignees"], ["int_github__issue_open_length"], ["int_github__issue_comments"], ["stg_github__user"], ["int_github__pull_request_times"], ["int_github__pull_request_reviewers"], ["stg_github__pull_request"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_joined.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1667263067.559647, "compiled_code": "with __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n), __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n), __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n), __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n), __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n), __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n), __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n), __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n),issue as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\n), \n\nissue_labels as (\n select *\n from __dbt__cte__int_github__issue_labels\n), \n\nrepository_teams as (\n select \n \n *\n from __dbt__cte__int_github__repository_teams\n\n \n), \n\nissue_assignees as (\n select *\n from __dbt__cte__int_github__issue_assignees\n), \n\nissue_open_length as (\n select *\n from __dbt__cte__int_github__issue_open_length\n), \n\nissue_comments as (\n select *\n from __dbt__cte__int_github__issue_comments\n), \n\ncreator as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\n), \n\npull_request_times as (\n select *\n from __dbt__cte__int_github__pull_request_times\n), \n\npull_request_reviewers as (\n select *\n from __dbt__cte__int_github__pull_request_reviewers\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request`\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then 'https://github.com/' || repository_teams.repository || '/pull/' || issue.issue_number\n else 'https://github.com/' || repository_teams.repository || '/issues/' || issue.issue_number\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n \n repository_teams.repository_team_names,\n \n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.github.int_github__issue_label_joined", "sql": " __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n)"}, {"id": "model.github.int_github__issue_labels", "sql": " __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n)"}, {"id": "model.github.int_github__repository_teams", "sql": " __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n)"}, {"id": "model.github.int_github__issue_assignees", "sql": " __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n)"}, {"id": "model.github.int_github__issue_open_length", "sql": " __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n)"}, {"id": "model.github.int_github__issue_comments", "sql": " __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n)"}, {"id": "model.github.int_github__pull_request_times", "sql": " __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n)"}, {"id": "model.github.int_github__pull_request_reviewers", "sql": " __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n)"}], "relation_name": null}, "model.github.int_github__issue_labels": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.github.int_github__issue_label_joined"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_labels"], "unique_id": "model.github.int_github__issue_labels", "raw_code": "with issue_label as (\n select *\n from {{ ref('int_github__issue_label_joined') }}\n)\n\nselect\n issue_id,\n {{ fivetran_utils.string_agg( 'label', \"', '\" )}} as labels\nfrom issue_label\ngroup by issue_id", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_labels.sql", "original_file_path": "models/intermediate/int_github__issue_labels.sql", "name": "int_github__issue_labels", "alias": "int_github__issue_labels", "checksum": {"name": "sha256", "checksum": "126b7de5034d8b9e5067e9d0a346ea3d93132574cc3ae85d4d711270404f4064"}, "tags": [], "refs": [["int_github__issue_label_joined"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_labels.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1667263067.566566, "compiled_code": "with __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n),issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.github.int_github__issue_label_joined", "sql": " __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n)"}], "relation_name": null}, "model.github.int_github__issue_assignees": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.github_source.stg_github__issue_assignee", "model.github_source.stg_github__user"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_assignees"], "unique_id": "model.github.int_github__issue_assignees", "raw_code": "with issue_assignee as (\n select *\n from {{ var('issue_assignee') }}\n), \n\ngithub_user as (\n select *\n from {{ var('user')}}\n)\n\nselect\n issue_assignee.issue_id,\n {{ fivetran_utils.string_agg( 'github_user.login_name', \"', '\" )}} as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_assignees.sql", "original_file_path": "models/intermediate/int_github__issue_assignees.sql", "name": "int_github__issue_assignees", "alias": "int_github__issue_assignees", "checksum": {"name": "sha256", "checksum": "837310bb78ff6f1460babc622037227dbc0c5776aae3ce3f5e9de48cb2ffac9c"}, "tags": [], "refs": [["stg_github__issue_assignee"], ["stg_github__user"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_assignees.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1667263067.569479, "compiled_code": "with issue_assignee as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__issue_comments": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.github_source.stg_github__issue_comment"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_comments"], "unique_id": "model.github.int_github__issue_comments", "raw_code": "with issue_comment as (\n select *\n from {{ var('issue_comment') }}\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_comments.sql", "original_file_path": "models/intermediate/int_github__issue_comments.sql", "name": "int_github__issue_comments", "alias": "int_github__issue_comments", "checksum": {"name": "sha256", "checksum": "b56ffccc19ec39a1d1bc4137557c8e1971167f97e673ea30d0f713bd34bc111a"}, "tags": [], "refs": [["stg_github__issue_comment"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_comments.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1667263067.57319, "compiled_code": "with issue_comment as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__issue_open_length": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt.datediff"], "nodes": ["model.github_source.stg_github__issue", "model.github_source.stg_github__issue_closed_history"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_open_length"], "unique_id": "model.github.int_github__issue_open_length", "raw_code": "with issue as (\n select *\n from {{ var('issue') }}\n), \n\nissue_closed_history as (\n select *\n from {{ var('issue_closed_history') }}\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), {{ dbt.current_timestamp_backcompat() }}) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum({{ dbt.datediff('valid_starting', 'valid_until', 'second') }}) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_open_length.sql", "original_file_path": "models/intermediate/int_github__issue_open_length.sql", "name": "int_github__issue_open_length", "alias": "int_github__issue_open_length", "checksum": {"name": "sha256", "checksum": "58de864860664b785e8000ef983dcb006d60af6cbba301e72e9e4c45aa1d8d5a"}, "tags": [], "refs": [["stg_github__issue"], ["stg_github__issue_closed_history"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_open_length.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1667263067.5767329, "compiled_code": "with issue as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__repository_teams": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.github_source.stg_github__repository", "model.github_source.stg_github__repo_team", "model.github_source.stg_github__team"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github", "intermediate", "int_github__repository_teams"], "unique_id": "model.github.int_github__repository_teams", "raw_code": "{{ config(enabled=var('github__using_repo_team', True)) }}\n\nwith repository as (\n select *\n from {{ var('repository')}}\n),\n\nrepo_teams as (\n select *\n from {{ var('repo_team')}}\n),\n\nteams as (\n select *\n from {{ var('team')}}\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n {{ fivetran_utils.string_agg('team_name', \"', '\" ) }} as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__repository_teams.sql", "original_file_path": "models/intermediate/int_github__repository_teams.sql", "name": "int_github__repository_teams", "alias": "int_github__repository_teams", "checksum": {"name": "sha256", "checksum": "aa75375faa9f533b0c9c935f80ed6e9c7b90f20249089e7d64b7b47194f9044e"}, "tags": [], "refs": [["stg_github__repository"], ["stg_github__repo_team"], ["stg_github__team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__repository_teams.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "enabled": true}, "created_at": 1667263067.580707, "compiled_code": "\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github_source.stg_github__issue_comment": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_comment_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__issue_comment_tmp", "model.github_source.stg_github__issue_comment_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "stg_github__issue_comment"], "unique_id": "model.github_source.stg_github__issue_comment", "raw_code": "with issue_comment as (\n\n select *\n from {{ ref('stg_github__issue_comment_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_comment_tmp')),\n staging_columns=get_issue_comment_columns()\n )\n }}\n\n from issue_comment\n\n), fields as (\n\n select \n id as issue_comment_id,\n issue_id,\n user_id\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue_comment.sql", "original_file_path": "models/stg_github__issue_comment.sql", "name": "stg_github__issue_comment", "alias": "stg_github__issue_comment", "checksum": {"name": "sha256", "checksum": "2f96156ac9d0de0afe220888eb6912117a7d04b1680b8fb1f5890dfbbcdb2994"}, "tags": [], "refs": [["stg_github__issue_comment_tmp"], ["stg_github__issue_comment_tmp"]], "sources": [], "metrics": [], "description": "Table that contains comments made on issues", "columns": {"issue_comment_id": {"name": "issue_comment_id", "description": "System generated unique id for the issue comment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue_comment.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667263067.828927, "compiled_code": "with issue_comment as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_comment_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n body\n \n as \n \n body\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 issue_id\n \n as \n \n issue_id\n \n, \n \n \n updated_at\n \n as \n \n updated_at\n \n, \n \n \n user_id\n \n as \n \n user_id\n \n\n\n\n\n from issue_comment\n\n), fields as (\n\n select \n id as issue_comment_id,\n issue_id,\n user_id\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_comment`"}, "model.github_source.stg_github__requested_reviewer_history": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_requested_reviewer_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.github_source.stg_github__requested_reviewer_history_tmp", "model.github_source.stg_github__requested_reviewer_history_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "stg_github__requested_reviewer_history"], "unique_id": "model.github_source.stg_github__requested_reviewer_history", "raw_code": "with requested_reviewer_history as (\n\n select *\n from {{ ref('stg_github__requested_reviewer_history_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__requested_reviewer_history_tmp')),\n staging_columns=get_requested_reviewer_history_columns()\n )\n }}\n\n from requested_reviewer_history\n\n), fields as (\n\n select \n pull_request_id,\n cast(created_at as {{ dbt.type_timestamp() }}) as created_at,\n requested_id,\n removed\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__requested_reviewer_history.sql", "original_file_path": "models/stg_github__requested_reviewer_history.sql", "name": "stg_github__requested_reviewer_history", "alias": "stg_github__requested_reviewer_history", "checksum": {"name": "sha256", "checksum": "40abf6ac94bece080abe8e8a45ed43030166df171697acf3c59c5958ffe68eba"}, "tags": [], "refs": [["stg_github__requested_reviewer_history_tmp"], ["stg_github__requested_reviewer_history_tmp"]], "sources": [], "metrics": [], "description": "Table containing when a user requests another user to review a pull request", "columns": {"pull_request_id": {"name": "pull_request_id", "description": "Foreign key that references the pull request table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the review was submitted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "requested_id": {"name": "requested_id", "description": "Foreign key that references the user table, representing the user that was requested to review a PR.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "removed": {"name": "removed", "description": "Boolean variable indicating if the requester was removed from the PR (true) or added to the PR (false).", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__requested_reviewer_history.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667263067.835099, "compiled_code": "with requested_reviewer_history as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__requested_reviewer_history_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n actor_id\n \n as \n \n actor_id\n \n, \n \n \n created_at\n \n as \n \n created_at\n \n, \n \n \n pull_request_id\n \n as \n \n pull_request_id\n \n, \n \n \n removed\n \n as \n \n removed\n \n, \n \n \n requested_id\n \n as \n \n requested_id\n \n\n\n\n\n from requested_reviewer_history\n\n), fields as (\n\n select \n pull_request_id,\n cast(created_at as TIMESTAMP) as created_at,\n requested_id,\n removed\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__requested_reviewer_history`"}, "model.github_source.stg_github__issue_label": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_label_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__issue_label_tmp", "model.github_source.stg_github__issue_label_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "stg_github__issue_label"], "unique_id": "model.github_source.stg_github__issue_label", "raw_code": "with issue_label as (\n\n select *\n from {{ ref('stg_github__issue_label_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_label_tmp')),\n staging_columns=get_issue_label_columns()\n )\n }}\n\n from issue_label\n\n), fields as (\n\n select \n issue_id,\n label_id\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue_label.sql", "original_file_path": "models/stg_github__issue_label.sql", "name": "stg_github__issue_label", "alias": "stg_github__issue_label", "checksum": {"name": "sha256", "checksum": "bbc4b8e82ab26b7cb753ead2165a6d483171b6def78a34c8ab6b2c9d1dc1357c"}, "tags": [], "refs": [["stg_github__issue_label_tmp"], ["stg_github__issue_label_tmp"]], "sources": [], "metrics": [], "description": "The current labels attached to an issue", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "label_id": {"name": "label_id", "description": "Unique identifier of the used label", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue_label.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667263067.828303, "compiled_code": "with issue_label as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_label_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n label_id\n \n as \n \n label_id\n \n, \n \n \n issue_id\n \n as \n \n issue_id\n \n\n\n\n\n from issue_label\n\n), fields as (\n\n select \n issue_id,\n label_id\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_label`"}, "model.github_source.stg_github__issue_merged": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_merged_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.github_source.stg_github__issue_merged_tmp", "model.github_source.stg_github__issue_merged_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "stg_github__issue_merged"], "unique_id": "model.github_source.stg_github__issue_merged", "raw_code": "with issue_merged as (\n\n select *\n from {{ ref('stg_github__issue_merged_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_merged_tmp')),\n staging_columns=get_issue_merged_columns()\n )\n }}\n\n from issue_merged\n\n), fields as (\n\n select \n issue_id,\n cast(merged_at as {{ dbt.type_timestamp() }}) as merged_at\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue_merged.sql", "original_file_path": "models/stg_github__issue_merged.sql", "name": "stg_github__issue_merged", "alias": "stg_github__issue_merged", "checksum": {"name": "sha256", "checksum": "d0ffc63496f8a12ccde9c115909db85d5f2fbd7c2ca8a7761cd96abcf31f532c"}, "tags": [], "refs": [["stg_github__issue_merged_tmp"], ["stg_github__issue_merged_tmp"]], "sources": [], "metrics": [], "description": "Table that tracks when an issue (always a pull request) is merged", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table. This table will only reference issues that are pull requests", "meta": {}, "data_type": null, "quote": null, "tags": []}, "merged_at": {"name": "merged_at", "description": "Timestamp of when the code merge took place", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue_merged.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667263067.8293881, "compiled_code": "with issue_merged as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_merged_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n actor_id\n \n as \n \n actor_id\n \n, \n \n \n commit_sha\n \n as \n \n commit_sha\n \n, \n \n \n issue_id\n \n as \n \n issue_id\n \n, \n \n \n merged_at\n \n as \n \n merged_at\n \n\n\n\n\n from issue_merged\n\n), fields as (\n\n select \n issue_id,\n cast(merged_at as TIMESTAMP) as merged_at\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_merged`"}, "model.github_source.stg_github__issue_closed_history": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_closed_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.github_source.stg_github__issue_closed_history_tmp", "model.github_source.stg_github__issue_closed_history_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "stg_github__issue_closed_history"], "unique_id": "model.github_source.stg_github__issue_closed_history", "raw_code": "with issue_closed_history as (\n\n select *\n from {{ ref('stg_github__issue_closed_history_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_closed_history_tmp')),\n staging_columns=get_issue_closed_history_columns()\n )\n }}\n\n from issue_closed_history\n\n), fields as (\n\n select \n issue_id,\n cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at,\n closed as is_closed\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue_closed_history.sql", "original_file_path": "models/stg_github__issue_closed_history.sql", "name": "stg_github__issue_closed_history", "alias": "stg_github__issue_closed_history", "checksum": {"name": "sha256", "checksum": "8820baed7a5b47177c8e57576741ab5d3763026682f66c52429092e655e07408"}, "tags": [], "refs": [["stg_github__issue_closed_history_tmp"], ["stg_github__issue_closed_history_tmp"]], "sources": [], "metrics": [], "description": "Table to track when an issue is closed or re-opened", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the action took place", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_closed": {"name": "is_closed", "description": "Boolean variable for if the issue was closed (true) or re-opened (false)", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue_closed_history.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667263067.827839, "compiled_code": "with issue_closed_history as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_closed_history_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n actor_id\n \n as \n \n actor_id\n \n, \n \n \n closed\n \n as \n \n closed\n \n, \n \n \n commit_sha\n \n as \n \n commit_sha\n \n, \n \n \n issue_id\n \n as \n \n issue_id\n \n, \n \n \n updated_at\n \n as \n \n updated_at\n \n\n\n\n\n from issue_closed_history\n\n), fields as (\n\n select \n issue_id,\n cast(updated_at as TIMESTAMP) as updated_at,\n closed as is_closed\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_closed_history`"}, "model.github_source.stg_github__issue_assignee": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_assignee_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__issue_assignee_tmp", "model.github_source.stg_github__issue_assignee_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "stg_github__issue_assignee"], "unique_id": "model.github_source.stg_github__issue_assignee", "raw_code": "with issue_assignee as (\n\n select *\n from {{ ref('stg_github__issue_assignee_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_assignee_tmp')),\n staging_columns=get_issue_assignee_columns()\n )\n }}\n\n from issue_assignee\n\n), fields as (\n\n select \n issue_id,\n user_id\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue_assignee.sql", "original_file_path": "models/stg_github__issue_assignee.sql", "name": "stg_github__issue_assignee", "alias": "stg_github__issue_assignee", "checksum": {"name": "sha256", "checksum": "1ee1ae6a0a648f4fddde4964f184b889bfd09ca43f0560fb10faaa8544b2f90d"}, "tags": [], "refs": [["stg_github__issue_assignee_tmp"], ["stg_github__issue_assignee_tmp"]], "sources": [], "metrics": [], "description": "Table with the current user(s) assigned to an issue", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue_assignee.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667263067.8259358, "compiled_code": "with issue_assignee as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_assignee_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n issue_id\n \n as \n \n issue_id\n \n, \n \n \n user_id\n \n as \n \n user_id\n \n\n\n\n\n from issue_assignee\n\n), fields as (\n\n select \n issue_id,\n user_id\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_assignee`"}, "model.github_source.stg_github__repository": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_repository_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__repository_tmp", "model.github_source.stg_github__repository_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "stg_github__repository"], "unique_id": "model.github_source.stg_github__repository", "raw_code": "with repository as (\n\n select *\n from {{ ref('stg_github__repository_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__repository_tmp')),\n staging_columns=get_repository_columns()\n )\n }}\n\n from repository\n\n), fields as (\n\n select \n id as repository_id,\n full_name,\n private as is_private\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__repository.sql", "original_file_path": "models/stg_github__repository.sql", "name": "stg_github__repository", "alias": "stg_github__repository", "checksum": {"name": "sha256", "checksum": "52faadfa1a36e8b144c01bdba106b9b22c58154bbd60b69c069c409f1b2f4712"}, "tags": [], "refs": [["stg_github__repository_tmp"], ["stg_github__repository_tmp"]], "sources": [], "metrics": [], "description": "Table representing the file structure of a directory under git control", "columns": {"repository_id": {"name": "repository_id", "description": "System generated unique id for the repository.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "full_name": {"name": "full_name", "description": "The name of the git repository.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_private": {"name": "is_private", "description": "Boolean field indicating whether the repository is private (true) or public (false).", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__repository.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667263067.834193, "compiled_code": "with repository as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__repository_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\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 created_at\n \n as \n \n created_at\n \n, \n \n \n default_branch\n \n as \n \n default_branch\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n fork\n \n as \n \n fork\n \n, \n \n \n full_name\n \n as \n \n full_name\n \n, \n \n \n homepage\n \n as \n \n homepage\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n language\n \n as \n \n language\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n owner_id\n \n as \n \n owner_id\n \n, \n \n \n private\n \n as \n \n private\n \n\n\n\n\n from repository\n\n), fields as (\n\n select \n id as repository_id,\n full_name,\n private as is_private\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__repository`"}, "model.github_source.stg_github__user": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_user_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__user_tmp", "model.github_source.stg_github__user_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "stg_github__user"], "unique_id": "model.github_source.stg_github__user", "raw_code": "with github_user as (\n\n select *\n from {{ ref('stg_github__user_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__user_tmp')),\n staging_columns=get_user_columns()\n )\n }}\n \n \n from github_user\n\n), fields as (\n\n select\n id as user_id,\n login as login_name,\n name,\n company\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__user.sql", "original_file_path": "models/stg_github__user.sql", "name": "stg_github__user", "alias": "stg_github__user", "checksum": {"name": "sha256", "checksum": "3fade99df6af62e01efd3bdabe4245077eeb17d7c05a33eae885ab9cebfb33a6"}, "tags": [], "refs": [["stg_github__user_tmp"], ["stg_github__user_tmp"]], "sources": [], "metrics": [], "description": "Table representing contributors to a git project", "columns": {"user_id": {"name": "user_id", "description": "System generated unique id for the user.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "login_name": {"name": "login_name", "description": "The alias the user uses to login to github.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the user", "meta": {}, "data_type": null, "quote": null, "tags": []}, "company": {"name": "company", "description": "The company of the user.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__user.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667263067.8369422, "compiled_code": "with github_user as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n company\n \n as \n \n company\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n login\n \n as \n \n login\n \n, \n \n \n name\n \n as \n \n name\n \n\n\n\n \n \n from github_user\n\n), fields as (\n\n select\n id as user_id,\n login as login_name,\n name,\n company\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`"}, "model.github_source.stg_github__pull_request_review": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_pull_request_review_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.github_source.stg_github__pull_request_review_tmp", "model.github_source.stg_github__pull_request_review_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "stg_github__pull_request_review"], "unique_id": "model.github_source.stg_github__pull_request_review", "raw_code": "with pull_request_review as (\n\n select *\n from {{ ref('stg_github__pull_request_review_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__pull_request_review_tmp')),\n staging_columns=get_pull_request_review_columns()\n )\n }}\n\n from pull_request_review\n\n), fields as (\n\n select \n id as pull_request_review_id,\n pull_request_id,\n cast(submitted_at as {{ dbt.type_timestamp() }}) as submitted_at,\n state,\n user_id\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__pull_request_review.sql", "original_file_path": "models/stg_github__pull_request_review.sql", "name": "stg_github__pull_request_review", "alias": "stg_github__pull_request_review", "checksum": {"name": "sha256", "checksum": "3c5b56fcda26503106a11215aa4895199d140d378e4f81dc73fee0a95a39ef6b"}, "tags": [], "refs": [["stg_github__pull_request_review_tmp"], ["stg_github__pull_request_review_tmp"]], "sources": [], "metrics": [], "description": "Table containing reviews made to pull requests", "columns": {"pull_request_review_id": {"name": "pull_request_review_id", "description": "System generated unique id for the pull request review.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pull_request_id": {"name": "pull_request_id", "description": "Foreign key that references the pull request table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "submitted_at": {"name": "submitted_at", "description": "Timestamp of when the request for review was submitted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the review was an approval, request for change, comment, dismissal.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table, representing the user that reviewed the pull request.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__pull_request_review.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667263067.832313, "compiled_code": "with pull_request_review as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_review_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n body\n \n as \n \n body\n \n, \n \n \n commit_sha\n \n as \n \n commit_sha\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n pull_request_id\n \n as \n \n pull_request_id\n \n, \n \n \n state\n \n as \n \n state\n \n, \n \n \n submitted_at\n \n as \n \n submitted_at\n \n, \n \n \n user_id\n \n as \n \n user_id\n \n\n\n\n\n from pull_request_review\n\n), fields as (\n\n select \n id as pull_request_review_id,\n pull_request_id,\n cast(submitted_at as TIMESTAMP) as submitted_at,\n state,\n user_id\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_review`"}, "model.github_source.stg_github__repo_team": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_repo_team_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__repo_team_tmp", "model.github_source.stg_github__repo_team_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "stg_github__repo_team"], "unique_id": "model.github_source.stg_github__repo_team", "raw_code": "{{ config(enabled=var('github__using_repo_team', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_github__repo_team_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__repo_team_tmp')),\n staging_columns=get_repo_team_columns()\n )\n }}\n \n from base\n \n), final as (\n \n select \n repository_id,\n team_id\n from fields\n)\n\nselect * from final", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__repo_team.sql", "original_file_path": "models/stg_github__repo_team.sql", "name": "stg_github__repo_team", "alias": "stg_github__repo_team", "checksum": {"name": "sha256", "checksum": "bbf2296c63f5601191f285d1b9509717c9af73282ef8faae25df101d5c2058ec"}, "tags": [], "refs": [["stg_github__repo_team_tmp"], ["stg_github__repo_team_tmp"]], "sources": [], "metrics": [], "description": "Table representing the mapping relationships between repositories and teams", "columns": {"repository_id": {"name": "repository_id", "description": "Reference to the respective repository for the record.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "team_id": {"name": "team_id", "description": "Reference to the respective team for the record.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__repo_team.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "enabled": true}, "created_at": 1667263067.83357, "compiled_code": "\n\nwith base as (\n\n select * \n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__repo_team_tmp`\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n permission\n \n as \n \n permission\n \n, \n \n \n repository_id\n \n as \n \n repository_id\n \n, \n \n \n team_id\n \n as \n \n team_id\n \n\n\n\n \n from base\n \n), final as (\n \n select \n repository_id,\n team_id\n from fields\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__repo_team`"}, "model.github_source.stg_github__label": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_label_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__label_tmp", "model.github_source.stg_github__label_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "stg_github__label"], "unique_id": "model.github_source.stg_github__label", "raw_code": "with issue_label as (\n\n select *\n from {{ ref('stg_github__label_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__label_tmp')),\n staging_columns=get_label_columns()\n )\n }}\n\n from issue_label\n\n), fields as (\n\n select \n id as label_id,\n _fivetran_synced,\t\n color,\n description,\n is_default,\n name as label,\n url\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__label.sql", "original_file_path": "models/stg_github__label.sql", "name": "stg_github__label", "alias": "stg_github__label", "checksum": {"name": "sha256", "checksum": "65919f8309be5eb259a6143e007f38f4ac91c1692d10990206708faa17f086e1"}, "tags": [], "refs": [["stg_github__label_tmp"], ["stg_github__label_tmp"]], "sources": [], "metrics": [], "description": "Table that contains labels that are used across your Github account within individual repositories.", "columns": {"label_id": {"name": "label_id", "description": "Unique identifier of the Github label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of the record being synced by Fivetran", "meta": {}, "data_type": null, "quote": null, "tags": []}, "color": {"name": "color", "description": "The color of the label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "The description of the label indicating the purpose", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_default": {"name": "is_default", "description": "Boolean flagging if the label is default on creation", "meta": {}, "data_type": null, "quote": null, "tags": []}, "label": {"name": "label", "description": "Name of the label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url": {"name": "url", "description": "Url where the label was used", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__label.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667263067.827134, "compiled_code": "with issue_label as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__label_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\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 description\n \n as \n \n description\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n is_default\n \n as \n \n is_default\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n url\n \n as \n \n url\n \n\n\n\n\n from issue_label\n\n), fields as (\n\n select \n id as label_id,\n _fivetran_synced,\t\n color,\n description,\n is_default,\n name as label,\n url\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__label`"}, "model.github_source.stg_github__issue": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.github_source.stg_github__issue_tmp", "model.github_source.stg_github__issue_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "stg_github__issue"], "unique_id": "model.github_source.stg_github__issue", "raw_code": "with issue as (\n\n select *\n from {{ ref('stg_github__issue_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_tmp')),\n staging_columns=get_issue_columns()\n )\n }}\n\n from issue \n\n), fields as (\n\n select \n id as issue_id,\n body,\n cast(closed_at as {{ dbt.type_timestamp() }}) as closed_at,\n cast(created_at as {{ dbt.type_timestamp() }}) as created_at,\n locked as is_locked,\n milestone_id,\n number as issue_number,\n pull_request as is_pull_request,\n repository_id,\n state,\n title,\n cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at,\n user_id\n \n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue.sql", "original_file_path": "models/stg_github__issue.sql", "name": "stg_github__issue", "alias": "stg_github__issue", "checksum": {"name": "sha256", "checksum": "4fa11e7a1ff0785189f14a205478aba55bb62784e05066f421e1723ec12240d0"}, "tags": [], "refs": [["stg_github__issue_tmp"], ["stg_github__issue_tmp"]], "sources": [], "metrics": [], "description": "Table that contains 1 entry for every issue created. Pull Requests also create an entry in this table, and there is a boolean field to determine if an entry is a pull request.", "columns": {"issue_id": {"name": "issue_id", "description": "System generated unique id for the issue. This is not the number that appears in the URL.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "body": {"name": "body", "description": "The text of the main description of the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed_at": {"name": "closed_at", "description": "Timestamp of when the issue was closed, NULL for issues that are open.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_locked": {"name": "is_locked", "description": "Boolean indicating whether the issue is locked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the issue was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "milestone_id": {"name": "milestone_id", "description": "Foreign key that references the milestone table representing the current milestone the issue is in.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_number": {"name": "issue_number", "description": "The issue number within a repository. Is unique by repository, but not across repositories.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_pull_request": {"name": "is_pull_request", "description": "Boolean for is the issue is a pull request (true) ot regular issue (false)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_id": {"name": "repository_id", "description": "Foreign key that references the repository table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the issue is open or closed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "Title of the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the last update was made to the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table, representing the user that created the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667263067.83136, "compiled_code": "with issue as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n body\n \n as \n \n body\n \n, \n \n \n closed_at\n \n as \n \n closed_at\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 locked\n \n as \n \n locked\n \n, \n \n \n milestone_id\n \n as \n \n milestone_id\n \n, \n \n \n number\n \n as \n \n number\n \n, \n \n \n pull_request\n \n as \n \n pull_request\n \n, \n \n \n repository_id\n \n as \n \n repository_id\n \n, \n \n \n state\n \n as \n \n state\n \n, \n \n \n title\n \n as \n \n title\n \n, \n \n \n updated_at\n \n as \n \n updated_at\n \n, \n \n \n user_id\n \n as \n \n user_id\n \n\n\n\n\n from issue \n\n), fields as (\n\n select \n id as issue_id,\n body,\n cast(closed_at as TIMESTAMP) as closed_at,\n cast(created_at as TIMESTAMP) as created_at,\n locked as is_locked,\n milestone_id,\n number as issue_number,\n pull_request as is_pull_request,\n repository_id,\n state,\n title,\n cast(updated_at as TIMESTAMP) as updated_at,\n user_id\n \n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`"}, "model.github_source.stg_github__team": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_team_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__team_tmp", "model.github_source.stg_github__team_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "stg_github__team"], "unique_id": "model.github_source.stg_github__team", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_github__team_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__team_tmp')),\n staging_columns=get_team_columns()\n )\n }}\n \n from base\n \n), final as (\n \n select \n id as team_id,\n description,\n name,\n parent_id,\n privacy,\n slug\n from fields\n)\n\nselect * \nfrom final", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__team.sql", "original_file_path": "models/stg_github__team.sql", "name": "stg_github__team", "alias": "stg_github__team", "checksum": {"name": "sha256", "checksum": "219e47883ec9f076dc1c27b22f72534709edaedd60e8ad9dc1b13db05499f4a4"}, "tags": [], "refs": [["stg_github__team_tmp"], ["stg_github__team_tmp"]], "sources": [], "metrics": [], "description": "Table containing teams and team details", "columns": {"team_id": {"name": "team_id", "description": "System generated unique id for the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "User created description of the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "User created name of the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "Reference to the parent team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "privacy": {"name": "privacy", "description": "Type of privacy permissions associated with the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "slug": {"name": "slug", "description": "Url friendly version of the team name.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__team.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667263067.836115, "compiled_code": "with base as (\n\n select * \n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__team_tmp`\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n description\n \n as \n \n description\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 org_id\n \n as \n \n org_id\n \n, \n \n \n parent_id\n \n as \n \n parent_id\n \n, \n \n \n privacy\n \n as \n \n privacy\n \n, \n \n \n slug\n \n as \n \n slug\n \n\n\n\n \n from base\n \n), final as (\n \n select \n id as team_id,\n description,\n name,\n parent_id,\n privacy,\n slug\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__team`"}, "model.github_source.stg_github__pull_request": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_pull_request_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__pull_request_tmp", "model.github_source.stg_github__pull_request_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "stg_github__pull_request"], "unique_id": "model.github_source.stg_github__pull_request", "raw_code": "with pull_request as (\n\n select *\n from {{ ref('stg_github__pull_request_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__pull_request_tmp')),\n staging_columns=get_pull_request_columns()\n )\n }}\n\n from pull_request\n\n), fields as (\n\n select \n id as pull_request_id,\n issue_id,\n head_repo_id,\n head_user_id\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__pull_request.sql", "original_file_path": "models/stg_github__pull_request.sql", "name": "stg_github__pull_request", "alias": "stg_github__pull_request", "checksum": {"name": "sha256", "checksum": "c2b1a593030492afcf35407523b636105f42f1cf3fd14f6067e31ba76d70dfe8"}, "tags": [], "refs": [["stg_github__pull_request_tmp"], ["stg_github__pull_request_tmp"]], "sources": [], "metrics": [], "description": "A special type of issue that is created when a user wants to merge one branch of code into another", "columns": {"pull_request_id": {"name": "pull_request_id", "description": "System generated unique id for the pull request.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "head_repo_id": {"name": "head_repo_id", "description": "Foreign key that references the repository table, referencing the current branch.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "head_user_id": {"name": "head_user_id", "description": "Foreign key that references the user table, referencing who created the current branch.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__pull_request.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667263067.8330681, "compiled_code": "with pull_request as (\n\n select *\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n base_label\n \n as \n \n base_label\n \n, \n \n \n base_ref\n \n as \n \n base_ref\n \n, \n \n \n base_repo_id\n \n as \n \n base_repo_id\n \n, \n \n \n base_sha\n \n as \n \n base_sha\n \n, \n \n \n base_user_id\n \n as \n \n base_user_id\n \n, \n \n \n head_label\n \n as \n \n head_label\n \n, \n \n \n head_ref\n \n as \n \n head_ref\n \n, \n \n \n head_repo_id\n \n as \n \n head_repo_id\n \n, \n \n \n head_sha\n \n as \n \n head_sha\n \n, \n \n \n head_user_id\n \n as \n \n head_user_id\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n issue_id\n \n as \n \n issue_id\n \n, \n \n \n merge_commit_sha\n \n as \n \n merge_commit_sha\n \n\n\n\n\n from pull_request\n\n), fields as (\n\n select \n id as pull_request_id,\n issue_id,\n head_repo_id,\n head_user_id\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request`"}, "model.github_source.stg_github__repository_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.repository"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "tmp", "stg_github__repository_tmp"], "unique_id": "model.github_source.stg_github__repository_tmp", "raw_code": "select *\nfrom {{ var('repository') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__repository_tmp.sql", "original_file_path": "models/tmp/stg_github__repository_tmp.sql", "name": "stg_github__repository_tmp", "alias": "stg_github__repository_tmp", "checksum": {"name": "sha256", "checksum": "e090c8cb68dc96c49ee363d95e9bbaf417dd03e2ec675bfdc3d9cefdf889cfc8"}, "tags": [], "refs": [], "sources": [["github", "repository"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__repository_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667263067.7230778, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_repository_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__repository_tmp`"}, "model.github_source.stg_github__label_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.label"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "tmp", "stg_github__label_tmp"], "unique_id": "model.github_source.stg_github__label_tmp", "raw_code": "select *\nfrom {{ var('label') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__label_tmp.sql", "original_file_path": "models/tmp/stg_github__label_tmp.sql", "name": "stg_github__label_tmp", "alias": "stg_github__label_tmp", "checksum": {"name": "sha256", "checksum": "8e66aceee9e6c677e3b0b105b85de66edea0f4141bef42cd097fd9a236abcf2f"}, "tags": [], "refs": [], "sources": [["github", "label"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__label_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667263067.726113, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_label_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__label_tmp`"}, "model.github_source.stg_github__requested_reviewer_history_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.requested_reviewer_history"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "tmp", "stg_github__requested_reviewer_history_tmp"], "unique_id": "model.github_source.stg_github__requested_reviewer_history_tmp", "raw_code": "select *\nfrom {{ var('requested_reviewer_history') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__requested_reviewer_history_tmp.sql", "original_file_path": "models/tmp/stg_github__requested_reviewer_history_tmp.sql", "name": "stg_github__requested_reviewer_history_tmp", "alias": "stg_github__requested_reviewer_history_tmp", "checksum": {"name": "sha256", "checksum": "ed713a77bb2c7407b63c6cc1eb5da22d3267a585bd972dabeb7c86e568180aaf"}, "tags": [], "refs": [], "sources": [["github", "requested_reviewer_history"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__requested_reviewer_history_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667263067.7290618, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_requested_reviewer_history_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__requested_reviewer_history_tmp`"}, "model.github_source.stg_github__issue_comment_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.issue_comment"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_comment_tmp"], "unique_id": "model.github_source.stg_github__issue_comment_tmp", "raw_code": "select *\nfrom {{ var('issue_comment') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_comment_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_comment_tmp.sql", "name": "stg_github__issue_comment_tmp", "alias": "stg_github__issue_comment_tmp", "checksum": {"name": "sha256", "checksum": "0954877e30180964df220c97f9b398d775fc74106c25666bf9dd98c5449a72a1"}, "tags": [], "refs": [], "sources": [["github", "issue_comment"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_comment_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667263067.732517, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_issue_comment_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_comment_tmp`"}, "model.github_source.stg_github__pull_request_review_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.pull_request_review"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "tmp", "stg_github__pull_request_review_tmp"], "unique_id": "model.github_source.stg_github__pull_request_review_tmp", "raw_code": "select *\nfrom {{ var('pull_request_review') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__pull_request_review_tmp.sql", "original_file_path": "models/tmp/stg_github__pull_request_review_tmp.sql", "name": "stg_github__pull_request_review_tmp", "alias": "stg_github__pull_request_review_tmp", "checksum": {"name": "sha256", "checksum": "3419833d93b14d370eb3c9cfb7fda9a373c47a2f9701620425d882b95fbaa55c"}, "tags": [], "refs": [], "sources": [["github", "pull_request_review"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__pull_request_review_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667263067.735492, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_pull_request_review_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_review_tmp`"}, "model.github_source.stg_github__issue_label_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.issue_label"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_label_tmp"], "unique_id": "model.github_source.stg_github__issue_label_tmp", "raw_code": "select *\nfrom {{ var('issue_label') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_label_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_label_tmp.sql", "name": "stg_github__issue_label_tmp", "alias": "stg_github__issue_label_tmp", "checksum": {"name": "sha256", "checksum": "3cd52e662c2bc67a66c9c3e6250e38739362a0b688287d41329d2989297fa201"}, "tags": [], "refs": [], "sources": [["github", "issue_label"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_label_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667263067.7384589, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_issue_label_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_label_tmp`"}, "model.github_source.stg_github__team_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.team"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "tmp", "stg_github__team_tmp"], "unique_id": "model.github_source.stg_github__team_tmp", "raw_code": "select * \nfrom {{ var('team') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__team_tmp.sql", "original_file_path": "models/tmp/stg_github__team_tmp.sql", "name": "stg_github__team_tmp", "alias": "stg_github__team_tmp", "checksum": {"name": "sha256", "checksum": "8c107692c9394962da82e0c2460045e6686d962c1eefe0cff564c618aed7a17d"}, "tags": [], "refs": [], "sources": [["github", "team"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__team_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667263067.741408, "compiled_code": "select * \nfrom `dbt-package-testing`.`github_integration_tests`.`github_team_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__team_tmp`"}, "model.github_source.stg_github__pull_request_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.pull_request"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "tmp", "stg_github__pull_request_tmp"], "unique_id": "model.github_source.stg_github__pull_request_tmp", "raw_code": "select *\nfrom {{ var('pull_request') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__pull_request_tmp.sql", "original_file_path": "models/tmp/stg_github__pull_request_tmp.sql", "name": "stg_github__pull_request_tmp", "alias": "stg_github__pull_request_tmp", "checksum": {"name": "sha256", "checksum": "11df5e7fd7046db485c6654ea88c82c566b71140c4e233f3567bd63bbf1cca19"}, "tags": [], "refs": [], "sources": [["github", "pull_request"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__pull_request_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667263067.7443452, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_pull_request_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_tmp`"}, "model.github_source.stg_github__issue_merged_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.issue_merged"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_merged_tmp"], "unique_id": "model.github_source.stg_github__issue_merged_tmp", "raw_code": "select *\nfrom {{ var('issue_merged') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_merged_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_merged_tmp.sql", "name": "stg_github__issue_merged_tmp", "alias": "stg_github__issue_merged_tmp", "checksum": {"name": "sha256", "checksum": "e61fb5297937f494370067232958a443ec21c885a55cca0022f480b463ce90a9"}, "tags": [], "refs": [], "sources": [["github", "issue_merged"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_merged_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667263067.747297, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_issue_merged_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_merged_tmp`"}, "model.github_source.stg_github__user_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.user"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "tmp", "stg_github__user_tmp"], "unique_id": "model.github_source.stg_github__user_tmp", "raw_code": "select *\nfrom {{ var('user') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__user_tmp.sql", "original_file_path": "models/tmp/stg_github__user_tmp.sql", "name": "stg_github__user_tmp", "alias": "stg_github__user_tmp", "checksum": {"name": "sha256", "checksum": "e71885bca06f3e1feaef9e729cfb58827c8999bc4d4b7cda538c392c5f56ffdf"}, "tags": [], "refs": [], "sources": [["github", "user"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__user_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667263067.7509298, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_user_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__user_tmp`"}, "model.github_source.stg_github__issue_closed_history_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.issue_closed_history"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_closed_history_tmp"], "unique_id": "model.github_source.stg_github__issue_closed_history_tmp", "raw_code": "select *\nfrom {{ var('issue_closed_history') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_closed_history_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_closed_history_tmp.sql", "name": "stg_github__issue_closed_history_tmp", "alias": "stg_github__issue_closed_history_tmp", "checksum": {"name": "sha256", "checksum": "5ce3eed90261c385c0ddcb0dc9d914a0bf3d3e0f737e4e233af244d29bbf3ce4"}, "tags": [], "refs": [], "sources": [["github", "issue_closed_history"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_closed_history_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667263067.753899, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_issue_closed_history_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_closed_history_tmp`"}, "model.github_source.stg_github__issue_assignee_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.issue_assignee"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_assignee_tmp"], "unique_id": "model.github_source.stg_github__issue_assignee_tmp", "raw_code": "select *\nfrom {{ var('issue_assignee') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_assignee_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_assignee_tmp.sql", "name": "stg_github__issue_assignee_tmp", "alias": "stg_github__issue_assignee_tmp", "checksum": {"name": "sha256", "checksum": "4cab39e652c5972bfa16de13454df8e5745610e91b69f3840305e49a9d613753"}, "tags": [], "refs": [], "sources": [["github", "issue_assignee"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_assignee_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667263067.7568371, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_issue_assignee_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_assignee_tmp`"}, "model.github_source.stg_github__issue_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.issue"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_tmp"], "unique_id": "model.github_source.stg_github__issue_tmp", "raw_code": "select *\nfrom {{ var('issue') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_tmp.sql", "name": "stg_github__issue_tmp", "alias": "stg_github__issue_tmp", "checksum": {"name": "sha256", "checksum": "4100b13686c42d580a5eeaab15449896ec2ce740b0e5f002775eb9f222ef7c32"}, "tags": [], "refs": [], "sources": [["github", "issue"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667263067.759789, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_issue_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_tmp`"}, "model.github_source.stg_github__repo_team_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.repo_team"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_source_integration_tests", "fqn": ["github_source", "tmp", "stg_github__repo_team_tmp"], "unique_id": "model.github_source.stg_github__repo_team_tmp", "raw_code": "{{ config(enabled=var('github__using_repo_team', True)) }}\n\nselect * \nfrom {{ var('repo_team') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__repo_team_tmp.sql", "original_file_path": "models/tmp/stg_github__repo_team_tmp.sql", "name": "stg_github__repo_team_tmp", "alias": "stg_github__repo_team_tmp", "checksum": {"name": "sha256", "checksum": "25a704d9235d40dc05601995f184779690eabcc6e3a64d3a0489e00c3e6d13ab"}, "tags": [], "refs": [], "sources": [["github", "repo_team"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__repo_team_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "enabled": true}, "created_at": 1667263067.7627242, "compiled_code": "\n\nselect * \nfrom `dbt-package-testing`.`github_integration_tests`.`github_repo_team_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_source_integration_tests`.`stg_github__repo_team_tmp`"}, "test.github.unique_github__issues_issue_id.6723b9b1db": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('github__issues')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__issues"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__issues_issue_id"], "unique_id": "test.github.unique_github__issues_issue_id.6723b9b1db", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__issues_issue_id.sql", "original_file_path": "models/github.yml", "name": "unique_github__issues_issue_id", "alias": "unique_github__issues_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__issues"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__issues_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.7913768, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select issue_id as unique_field\n from `dbt-package-testing`.`github_source_integration_tests`.`github__issues`\n where issue_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.github__issues"}, "test.github.not_null_github__issues_issue_id.fed0631e25": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('github__issues')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__issues"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__issues_issue_id"], "unique_id": "test.github.not_null_github__issues_issue_id.fed0631e25", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__issues_issue_id.sql", "original_file_path": "models/github.yml", "name": "not_null_github__issues_issue_id", "alias": "not_null_github__issues_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__issues"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__issues_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.792384, "compiled_code": "\n \n \n\n\n\nselect issue_id\nfrom `dbt-package-testing`.`github_source_integration_tests`.`github__issues`\nwhere issue_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.github__issues"}, "test.github.unique_github__pull_requests_issue_id.ce23997907": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('github__pull_requests')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__pull_requests"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__pull_requests_issue_id"], "unique_id": "test.github.unique_github__pull_requests_issue_id.ce23997907", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__pull_requests_issue_id.sql", "original_file_path": "models/github.yml", "name": "unique_github__pull_requests_issue_id", "alias": "unique_github__pull_requests_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__pull_requests"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__pull_requests_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.7933261, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select issue_id as unique_field\n from `dbt-package-testing`.`github_source_integration_tests`.`github__pull_requests`\n where issue_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.github__pull_requests"}, "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('github__pull_requests')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__pull_requests"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__pull_requests_issue_id"], "unique_id": "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__pull_requests_issue_id.sql", "original_file_path": "models/github.yml", "name": "not_null_github__pull_requests_issue_id", "alias": "not_null_github__pull_requests_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__pull_requests"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__pull_requests_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.79424, "compiled_code": "\n \n \n\n\n\nselect issue_id\nfrom `dbt-package-testing`.`github_source_integration_tests`.`github__pull_requests`\nwhere issue_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.github__pull_requests"}, "test.github.unique_github__daily_metrics_day.f98cab9456": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "day", "model": "{{ get_where_subquery(ref('github__daily_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__daily_metrics_day"], "unique_id": "test.github.unique_github__daily_metrics_day.f98cab9456", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__daily_metrics_day.sql", "original_file_path": "models/github.yml", "name": "unique_github__daily_metrics_day", "alias": "unique_github__daily_metrics_day", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__daily_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__daily_metrics_day.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.7952871, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select day as unique_field\n from `dbt-package-testing`.`github_source_integration_tests`.`github__daily_metrics`\n where day is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "day", "file_key_name": "models.github__daily_metrics"}, "test.github.not_null_github__daily_metrics_day.647e494434": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "day", "model": "{{ get_where_subquery(ref('github__daily_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__daily_metrics_day"], "unique_id": "test.github.not_null_github__daily_metrics_day.647e494434", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__daily_metrics_day.sql", "original_file_path": "models/github.yml", "name": "not_null_github__daily_metrics_day", "alias": "not_null_github__daily_metrics_day", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__daily_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__daily_metrics_day.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.796187, "compiled_code": "\n \n \n\n\n\nselect day\nfrom `dbt-package-testing`.`github_source_integration_tests`.`github__daily_metrics`\nwhere day is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "day", "file_key_name": "models.github__daily_metrics"}, "test.github.unique_github__weekly_metrics_week.6794858a8e": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "week", "model": "{{ get_where_subquery(ref('github__weekly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__weekly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__weekly_metrics_week"], "unique_id": "test.github.unique_github__weekly_metrics_week.6794858a8e", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__weekly_metrics_week.sql", "original_file_path": "models/github.yml", "name": "unique_github__weekly_metrics_week", "alias": "unique_github__weekly_metrics_week", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__weekly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__weekly_metrics_week.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.797098, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select week as unique_field\n from `dbt-package-testing`.`github_source_integration_tests`.`github__weekly_metrics`\n where week is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "week", "file_key_name": "models.github__weekly_metrics"}, "test.github.not_null_github__weekly_metrics_week.4b0b928243": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "week", "model": "{{ get_where_subquery(ref('github__weekly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__weekly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__weekly_metrics_week"], "unique_id": "test.github.not_null_github__weekly_metrics_week.4b0b928243", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__weekly_metrics_week.sql", "original_file_path": "models/github.yml", "name": "not_null_github__weekly_metrics_week", "alias": "not_null_github__weekly_metrics_week", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__weekly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__weekly_metrics_week.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.7980108, "compiled_code": "\n \n \n\n\n\nselect week\nfrom `dbt-package-testing`.`github_source_integration_tests`.`github__weekly_metrics`\nwhere week is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "week", "file_key_name": "models.github__weekly_metrics"}, "test.github.unique_github__monthly_metrics_month.3076284fbb": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "month", "model": "{{ get_where_subquery(ref('github__monthly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__monthly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__monthly_metrics_month"], "unique_id": "test.github.unique_github__monthly_metrics_month.3076284fbb", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__monthly_metrics_month.sql", "original_file_path": "models/github.yml", "name": "unique_github__monthly_metrics_month", "alias": "unique_github__monthly_metrics_month", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__monthly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__monthly_metrics_month.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.799058, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select month as unique_field\n from `dbt-package-testing`.`github_source_integration_tests`.`github__monthly_metrics`\n where month is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "month", "file_key_name": "models.github__monthly_metrics"}, "test.github.not_null_github__monthly_metrics_month.9e4fba84df": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "month", "model": "{{ get_where_subquery(ref('github__monthly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__monthly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__monthly_metrics_month"], "unique_id": "test.github.not_null_github__monthly_metrics_month.9e4fba84df", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__monthly_metrics_month.sql", "original_file_path": "models/github.yml", "name": "not_null_github__monthly_metrics_month", "alias": "not_null_github__monthly_metrics_month", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__monthly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__monthly_metrics_month.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.799993, "compiled_code": "\n \n \n\n\n\nselect month\nfrom `dbt-package-testing`.`github_source_integration_tests`.`github__monthly_metrics`\nwhere month is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "month", "file_key_name": "models.github__monthly_metrics"}, "test.github.unique_github__quarterly_metrics_quarter.9165a921c1": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "quarter", "model": "{{ get_where_subquery(ref('github__quarterly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__quarterly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__quarterly_metrics_quarter"], "unique_id": "test.github.unique_github__quarterly_metrics_quarter.9165a921c1", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__quarterly_metrics_quarter.sql", "original_file_path": "models/github.yml", "name": "unique_github__quarterly_metrics_quarter", "alias": "unique_github__quarterly_metrics_quarter", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__quarterly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__quarterly_metrics_quarter.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.800896, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select quarter as unique_field\n from `dbt-package-testing`.`github_source_integration_tests`.`github__quarterly_metrics`\n where quarter is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "quarter", "file_key_name": "models.github__quarterly_metrics"}, "test.github.not_null_github__quarterly_metrics_quarter.92394d46dc": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "quarter", "model": "{{ get_where_subquery(ref('github__quarterly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__quarterly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__quarterly_metrics_quarter"], "unique_id": "test.github.not_null_github__quarterly_metrics_quarter.92394d46dc", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__quarterly_metrics_quarter.sql", "original_file_path": "models/github.yml", "name": "not_null_github__quarterly_metrics_quarter", "alias": "not_null_github__quarterly_metrics_quarter", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__quarterly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__quarterly_metrics_quarter.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.801795, "compiled_code": "\n \n \n\n\n\nselect quarter\nfrom `dbt-package-testing`.`github_source_integration_tests`.`github__quarterly_metrics`\nwhere quarter is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "quarter", "file_key_name": "models.github__quarterly_metrics"}, "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["issue_id", "user_id"], "model": "{{ get_where_subquery(ref('stg_github__issue_assignee')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue_assignee"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github_source", "dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id"], "unique_id": "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388\") }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388.sql", "original_file_path": "models/stg_github.yml", "name": "dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id", "alias": "dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue_assignee"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388"}, "created_at": 1667263067.8373692, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n issue_id, user_id\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_assignee`\n group by issue_id, user_id\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_github__issue_assignee"}, "test.github_source.not_null_stg_github__label_label_id.9f07379974": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "label_id", "model": "{{ get_where_subquery(ref('stg_github__label')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__label"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__label_label_id"], "unique_id": "test.github_source.not_null_stg_github__label_label_id.9f07379974", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__label_label_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__label_label_id", "alias": "not_null_stg_github__label_label_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__label"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__label_label_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.8440058, "compiled_code": "\n \n \n\n\n\nselect label_id\nfrom `dbt-package-testing`.`github_source_integration_tests`.`stg_github__label`\nwhere label_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "label_id", "file_key_name": "models.stg_github__label"}, "test.github_source.unique_stg_github__label_label_id.74d3c21466": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "label_id", "model": "{{ get_where_subquery(ref('stg_github__label')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__label"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__label_label_id"], "unique_id": "test.github_source.unique_stg_github__label_label_id.74d3c21466", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__label_label_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__label_label_id", "alias": "unique_stg_github__label_label_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__label"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__label_label_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.844934, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select label_id as unique_field\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__label`\n where label_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "label_id", "file_key_name": "models.stg_github__label"}, "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["issue_id", "updated_at"], "model": "{{ get_where_subquery(ref('stg_github__issue_closed_history')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue_closed_history"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github_source", "dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at"], "unique_id": "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f\") }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f.sql", "original_file_path": "models/stg_github.yml", "name": "dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at", "alias": "dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue_closed_history"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f"}, "created_at": 1667263067.845997, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n issue_id, updated_at\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_closed_history`\n group by issue_id, updated_at\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_github__issue_closed_history"}, "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "issue_comment_id", "model": "{{ get_where_subquery(ref('stg_github__issue_comment')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue_comment"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__issue_comment_issue_comment_id"], "unique_id": "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__issue_comment_issue_comment_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__issue_comment_issue_comment_id", "alias": "unique_stg_github__issue_comment_issue_comment_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue_comment"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__issue_comment_issue_comment_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.8484669, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select issue_comment_id as unique_field\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_comment`\n where issue_comment_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_comment_id", "file_key_name": "models.stg_github__issue_comment"}, "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "issue_comment_id", "model": "{{ get_where_subquery(ref('stg_github__issue_comment')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue_comment"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__issue_comment_issue_comment_id"], "unique_id": "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__issue_comment_issue_comment_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__issue_comment_issue_comment_id", "alias": "not_null_stg_github__issue_comment_issue_comment_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue_comment"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__issue_comment_issue_comment_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.849505, "compiled_code": "\n \n \n\n\n\nselect issue_comment_id\nfrom `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue_comment`\nwhere issue_comment_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_comment_id", "file_key_name": "models.stg_github__issue_comment"}, "test.github_source.unique_stg_github__issue_issue_id.84891aeece": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('stg_github__issue')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__issue_issue_id"], "unique_id": "test.github_source.unique_stg_github__issue_issue_id.84891aeece", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__issue_issue_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__issue_issue_id", "alias": "unique_stg_github__issue_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__issue_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.850421, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select issue_id as unique_field\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\n where issue_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.stg_github__issue"}, "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('stg_github__issue')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__issue_issue_id"], "unique_id": "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__issue_issue_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__issue_issue_id", "alias": "not_null_stg_github__issue_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__issue_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.851326, "compiled_code": "\n \n \n\n\n\nselect issue_id\nfrom `dbt-package-testing`.`github_source_integration_tests`.`stg_github__issue`\nwhere issue_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.stg_github__issue"}, "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "pull_request_review_id", "model": "{{ get_where_subquery(ref('stg_github__pull_request_review')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__pull_request_review"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__pull_request_review_pull_request_review_id"], "unique_id": "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__pull_request_review_pull_request_review_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__pull_request_review_pull_request_review_id", "alias": "unique_stg_github__pull_request_review_pull_request_review_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__pull_request_review"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__pull_request_review_pull_request_review_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.852256, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select pull_request_review_id as unique_field\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_review`\n where pull_request_review_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "pull_request_review_id", "file_key_name": "models.stg_github__pull_request_review"}, "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "pull_request_review_id", "model": "{{ get_where_subquery(ref('stg_github__pull_request_review')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__pull_request_review"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__pull_request_review_pull_request_review_id"], "unique_id": "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__pull_request_review_pull_request_review_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__pull_request_review_pull_request_review_id", "alias": "not_null_stg_github__pull_request_review_pull_request_review_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__pull_request_review"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__pull_request_review_pull_request_review_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.853288, "compiled_code": "\n \n \n\n\n\nselect pull_request_review_id\nfrom `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request_review`\nwhere pull_request_review_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "pull_request_review_id", "file_key_name": "models.stg_github__pull_request_review"}, "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "pull_request_id", "model": "{{ get_where_subquery(ref('stg_github__pull_request')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__pull_request"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__pull_request_pull_request_id"], "unique_id": "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__pull_request_pull_request_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__pull_request_pull_request_id", "alias": "unique_stg_github__pull_request_pull_request_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__pull_request"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__pull_request_pull_request_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.854191, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select pull_request_id as unique_field\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request`\n where pull_request_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "pull_request_id", "file_key_name": "models.stg_github__pull_request"}, "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "pull_request_id", "model": "{{ get_where_subquery(ref('stg_github__pull_request')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__pull_request"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__pull_request_pull_request_id"], "unique_id": "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__pull_request_pull_request_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__pull_request_pull_request_id", "alias": "not_null_stg_github__pull_request_pull_request_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__pull_request"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__pull_request_pull_request_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.855096, "compiled_code": "\n \n \n\n\n\nselect pull_request_id\nfrom `dbt-package-testing`.`github_source_integration_tests`.`stg_github__pull_request`\nwhere pull_request_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "pull_request_id", "file_key_name": "models.stg_github__pull_request"}, "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "repository_id", "model": "{{ get_where_subquery(ref('stg_github__repo_team')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__repo_team"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__repo_team_repository_id"], "unique_id": "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__repo_team_repository_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__repo_team_repository_id", "alias": "not_null_stg_github__repo_team_repository_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__repo_team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__repo_team_repository_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.855996, "compiled_code": "\n \n \n\n\n\nselect repository_id\nfrom `dbt-package-testing`.`github_source_integration_tests`.`stg_github__repo_team`\nwhere repository_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "repository_id", "file_key_name": "models.stg_github__repo_team"}, "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "team_id", "model": "{{ get_where_subquery(ref('stg_github__repo_team')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__repo_team"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__repo_team_team_id"], "unique_id": "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__repo_team_team_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__repo_team_team_id", "alias": "not_null_stg_github__repo_team_team_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__repo_team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__repo_team_team_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.8570151, "compiled_code": "\n \n \n\n\n\nselect team_id\nfrom `dbt-package-testing`.`github_source_integration_tests`.`stg_github__repo_team`\nwhere team_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "team_id", "file_key_name": "models.stg_github__repo_team"}, "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "repository_id", "model": "{{ get_where_subquery(ref('stg_github__repository')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__repository"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__repository_repository_id"], "unique_id": "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__repository_repository_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__repository_repository_id", "alias": "unique_stg_github__repository_repository_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__repository"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__repository_repository_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.85791, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select repository_id as unique_field\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__repository`\n where repository_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "repository_id", "file_key_name": "models.stg_github__repository"}, "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "repository_id", "model": "{{ get_where_subquery(ref('stg_github__repository')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__repository"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__repository_repository_id"], "unique_id": "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__repository_repository_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__repository_repository_id", "alias": "not_null_stg_github__repository_repository_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__repository"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__repository_repository_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.858805, "compiled_code": "\n \n \n\n\n\nselect repository_id\nfrom `dbt-package-testing`.`github_source_integration_tests`.`stg_github__repository`\nwhere repository_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "repository_id", "file_key_name": "models.stg_github__repository"}, "test.github_source.unique_stg_github__team_team_id.94e9716ab4": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "team_id", "model": "{{ get_where_subquery(ref('stg_github__team')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__team"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__team_team_id"], "unique_id": "test.github_source.unique_stg_github__team_team_id.94e9716ab4", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__team_team_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__team_team_id", "alias": "unique_stg_github__team_team_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__team_team_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.8596978, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select team_id as unique_field\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__team`\n where team_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "team_id", "file_key_name": "models.stg_github__team"}, "test.github_source.not_null_stg_github__team_team_id.440aefe7a7": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "team_id", "model": "{{ get_where_subquery(ref('stg_github__team')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__team"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__team_team_id"], "unique_id": "test.github_source.not_null_stg_github__team_team_id.440aefe7a7", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__team_team_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__team_team_id", "alias": "not_null_stg_github__team_team_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__team_team_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.860714, "compiled_code": "\n \n \n\n\n\nselect team_id\nfrom `dbt-package-testing`.`github_source_integration_tests`.`stg_github__team`\nwhere team_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "team_id", "file_key_name": "models.stg_github__team"}, "test.github_source.unique_stg_github__user_user_id.5c1a00cd90": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(ref('stg_github__user')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__user"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__user_user_id"], "unique_id": "test.github_source.unique_stg_github__user_user_id.5c1a00cd90", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__user_user_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__user_user_id", "alias": "unique_stg_github__user_user_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__user"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__user_user_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.861614, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select user_id as unique_field\n from `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\n where user_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "user_id", "file_key_name": "models.stg_github__user"}, "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(ref('stg_github__user')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__user"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_source_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__user_user_id"], "unique_id": "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__user_user_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__user_user_id", "alias": "not_null_stg_github__user_user_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__user"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__user_user_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667263067.862509, "compiled_code": "\n \n \n\n\n\nselect user_id\nfrom `dbt-package-testing`.`github_source_integration_tests`.`stg_github__user`\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "user_id", "file_key_name": "models.stg_github__user"}}, "sources": {"source.github_source.github.issue_assignee": {"fqn": ["github_source", "github", "issue_assignee"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue_assignee", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue_assignee", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_issue_assignee_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table with the current user(s) assigned to an issue", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_assignee_data`", "created_at": 1667263067.86323}, "source.github_source.github.label": {"fqn": ["github_source", "github", "label"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.label", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "label", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_label_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Table that contains labels that are used across your Github account within individual repositories.", "columns": {"id": {"name": "id", "description": "Unique identifier of the Github label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of the record being synced by Fivetran", "meta": {}, "data_type": null, "quote": null, "tags": []}, "color": {"name": "color", "description": "The color of the label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "The description of the label indicating the purpose", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_default": {"name": "is_default", "description": "Boolean flagging if the label is default on creation", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "Name of the label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url": {"name": "url", "description": "Url where the label was used", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_label_data`", "created_at": 1667263067.863311}, "source.github_source.github.issue_closed_history": {"fqn": ["github_source", "github", "issue_closed_history"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue_closed_history", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue_closed_history", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_issue_closed_history_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table to track when an issue is closed or re-opened", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the action took place", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed": {"name": "closed", "description": "Boolean variable for if the issue was closed (true) or re-opened (false)", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_closed_history_data`", "created_at": 1667263067.863376}, "source.github_source.github.issue_label": {"fqn": ["github_source", "github", "issue_label"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue_label", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue_label", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_issue_label_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "The current labels attached to an issue", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "label_id": {"name": "label_id", "description": "Unique identifier of the used label", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_label_data`", "created_at": 1667263067.863435}, "source.github_source.github.issue_comment": {"fqn": ["github_source", "github", "issue_comment"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue_comment", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue_comment", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_issue_comment_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table that contains comments made on issues", "columns": {"id": {"name": "id", "description": "System generated unique id for the issue comment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_comment_data`", "created_at": 1667263067.8634949}, "source.github_source.github.issue_merged": {"fqn": ["github_source", "github", "issue_merged"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue_merged", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue_merged", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_issue_merged_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table that tracks when an issue (always a pull request) is merged", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table. This table will only reference issues that are pull requests", "meta": {}, "data_type": null, "quote": null, "tags": []}, "merged_at": {"name": "merged_at", "description": "Timestamp of when the code merge took place", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_merged_data`", "created_at": 1667263067.863553}, "source.github_source.github.issue": {"fqn": ["github_source", "github", "issue"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_issue_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table that contains 1 entry for every issue created. Pull Requests also create an entry in this table, and there is a boolean field to determine if an entry is a pull request.", "columns": {"id": {"name": "id", "description": "System generated unique id for the issue. This is not the number that appears in the URL.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "body": {"name": "body", "description": "The text of the main description of the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "locked": {"name": "locked", "description": "Boolean indicating whether the issue is locked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed_at": {"name": "closed_at", "description": "Timestamp of when the issue was closed, NULL for issues that are open.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the issue was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "milestone_id": {"name": "milestone_id", "description": "Foreign key that references the milestone table representing the current milestone the issue is in.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number": {"name": "number", "description": "The issue number within a repository. Is unique by repository, but not across repositories.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pull_request": {"name": "pull_request", "description": "Boolean for is the issue is a pull request (true) ot regular issue (false)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_id": {"name": "repository_id", "description": "Foreign key that references the repository table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the issue is open or closed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "Title of the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the last update was made to the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table, representing the user that created the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_data`", "created_at": 1667263067.863622}, "source.github_source.github.pull_request_review": {"fqn": ["github_source", "github", "pull_request_review"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.pull_request_review", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "pull_request_review", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_pull_request_review_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table containing reviews made to pull requests", "columns": {"id": {"name": "id", "description": "System generated unique id for the pull request review.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pull_request_id": {"name": "pull_request_id", "description": "Foreign key that references the pull request table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "submitted_at": {"name": "submitted_at", "description": "Timestamp of when the request for review was submitted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the review was an approval, request for change, comment, dismissal.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table, representing the user that reviewed the pull request.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_pull_request_review_data`", "created_at": 1667263067.863682}, "source.github_source.github.pull_request": {"fqn": ["github_source", "github", "pull_request"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.pull_request", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "pull_request", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_pull_request_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "A special type of issue that is created when a user wants to merge one branch of code into another", "columns": {"id": {"name": "id", "description": "System generated unique id for the pull request.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "head_repo_id": {"name": "head_repo_id", "description": "Foreign key that references the repository table, referencing the current branch.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "head_user_id": {"name": "head_user_id", "description": "Foreign key that references the user table, referencing who created the current branch.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_pull_request_data`", "created_at": 1667263067.86374}, "source.github_source.github.repo_team": {"fqn": ["github_source", "github", "repo_team"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.repo_team", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "repo_team", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_repo_team_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table representing the mapping relationships between repositories and teams", "columns": {"repository_id": {"name": "repository_id", "description": "Reference to the respective repository for the record.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "team_id": {"name": "team_id", "description": "Reference to the respective team for the record.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {"is_enabled": true}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_repo_team_data`", "created_at": 1667263067.863798}, "source.github_source.github.repository": {"fqn": ["github_source", "github", "repository"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.repository", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "repository", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_repository_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Table representing the file structure of a directory under git control", "columns": {"id": {"name": "id", "description": "System generated unique id for the repository.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the repository was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "full_name": {"name": "full_name", "description": "The name of the git repository.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "private": {"name": "private", "description": "Boolean field indicating whether the repository is private (true) or public (false).", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_repository_data`", "created_at": 1667263067.863856}, "source.github_source.github.requested_reviewer_history": {"fqn": ["github_source", "github", "requested_reviewer_history"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.requested_reviewer_history", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "requested_reviewer_history", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_requested_reviewer_history_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table containing when a user requests another user to review a pull request", "columns": {"pull_request_id": {"name": "pull_request_id", "description": "Foreign key that references the pull request table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the review was submitted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "requested_id": {"name": "requested_id", "description": "Foreign key that references the user table, representing the user that was requested to review a PR.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "removed": {"name": "removed", "description": "Boolean variable indicating if the requester was removed from the PR (true) or added to the PR (false).", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_requested_reviewer_history_data`", "created_at": 1667263067.863915}, "source.github_source.github.team": {"fqn": ["github_source", "github", "team"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.team", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "team", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_team_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table containing teams and team details", "columns": {"id": {"name": "id", "description": "System generated unique id for the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "User created description of the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "User created name of the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "Reference to the parent team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "privacy": {"name": "privacy", "description": "Type of privacy permissions associated with the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "slug": {"name": "slug", "description": "Url friendly version of the team name.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_team_data`", "created_at": 1667263067.863977}, "source.github_source.github.user": {"fqn": ["github_source", "github", "user"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.user", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "user", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_user_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Table representing contributors to a git project", "columns": {"id": {"name": "id", "description": "System generated unique id for the user.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "login": {"name": "login", "description": "The alias the user uses to login to github.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the user", "meta": {}, "data_type": null, "quote": null, "tags": []}, "company": {"name": "company", "description": "The company of the user.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_user_data`", "created_at": 1667263067.864033}}, "macros": {"macro.dbt_bigquery.date_sharded_table": {"unique_id": "macro.dbt_bigquery.date_sharded_table", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "date_sharded_table", "macro_sql": "{% macro date_sharded_table(base_name) %}\n {{ return(base_name ~ \"[DBT__PARTITION_DATE]\") }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.976444, "supported_languages": null}, "macro.dbt_bigquery.grant_access_to": {"unique_id": "macro.dbt_bigquery.grant_access_to", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "grant_access_to", "macro_sql": "{% macro grant_access_to(entity, entity_type, role, grant_target_dict) -%}\n {% do adapter.grant_access_to(entity, entity_type, role, grant_target_dict) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.976681, "supported_languages": null}, "macro.dbt_bigquery.get_partitions_metadata": {"unique_id": "macro.dbt_bigquery.get_partitions_metadata", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "get_partitions_metadata", "macro_sql": "\n\n{%- macro get_partitions_metadata(table) -%}\n {%- if execute -%}\n {%- set res = adapter.get_partitions_metadata(table) -%}\n {{- return(res) -}}\n {%- endif -%}\n {{- return(None) -}}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.9769778, "supported_languages": null}, "macro.dbt_bigquery.bigquery__get_catalog": {"unique_id": "macro.dbt_bigquery.bigquery__get_catalog", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "name": "bigquery__get_catalog", "macro_sql": "{% macro bigquery__get_catalog(information_schema, schemas) -%}\n\n {%- if (schemas | length) == 0 -%}\n {# Hopefully nothing cares about the columns we return when there are no rows #}\n {%- set query = \"select 1 as id limit 0\" -%}\n {%- else -%}\n\n {%- set query -%}\n with tables as (\n select\n project_id as table_database,\n dataset_id as table_schema,\n table_id as original_table_name,\n\n concat(project_id, '.', dataset_id, '.', table_id) as relation_id,\n\n row_count,\n size_bytes as size_bytes,\n case\n when type = 1 then 'table'\n when type = 2 then 'view'\n else 'external'\n end as table_type,\n\n REGEXP_CONTAINS(table_id, '^.+[0-9]{8}$') and coalesce(type, 0) = 1 as is_date_shard,\n REGEXP_EXTRACT(table_id, '^(.+)[0-9]{8}$') as shard_base_name,\n REGEXP_EXTRACT(table_id, '^.+([0-9]{8})$') as shard_name\n\n from {{ information_schema.replace(information_schema_view='__TABLES__') }}\n where (\n {%- for schema in schemas -%}\n upper(dataset_id) = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n ),\n\n extracted as (\n\n select *,\n case\n when is_date_shard then shard_base_name\n else original_table_name\n end as table_name\n\n from tables\n\n ),\n\n unsharded_tables as (\n\n select\n table_database,\n table_schema,\n table_name,\n coalesce(table_type, 'external') as table_type,\n is_date_shard,\n\n struct(\n min(shard_name) as shard_min,\n max(shard_name) as shard_max,\n count(*) as shard_count\n ) as table_shards,\n\n sum(size_bytes) as size_bytes,\n sum(row_count) as row_count,\n\n max(relation_id) as relation_id\n\n from extracted\n group by 1,2,3,4,5\n\n ),\n\n info_schema_columns as (\n\n select\n concat(table_catalog, '.', table_schema, '.', table_name) as relation_id,\n table_catalog as table_database,\n table_schema,\n table_name,\n\n -- use the \"real\" column name from the paths query below\n column_name as base_column_name,\n ordinal_position as column_index,\n\n is_partitioning_column,\n clustering_ordinal_position\n\n from {{ information_schema.replace(information_schema_view='COLUMNS') }}\n where ordinal_position is not null\n\n ),\n\n info_schema_column_paths as (\n\n select\n concat(table_catalog, '.', table_schema, '.', table_name) as relation_id,\n field_path as column_name,\n data_type as column_type,\n column_name as base_column_name,\n description as column_comment\n\n from {{ information_schema.replace(information_schema_view='COLUMN_FIELD_PATHS') }}\n\n ),\n\n columns as (\n\n select * except (base_column_name)\n from info_schema_columns\n join info_schema_column_paths using (relation_id, base_column_name)\n\n ),\n\n column_stats as (\n\n select\n table_database,\n table_schema,\n table_name,\n max(relation_id) as relation_id,\n max(case when is_partitioning_column = 'YES' then 1 else 0 end) = 1 as is_partitioned,\n max(case when is_partitioning_column = 'YES' then column_name else null end) as partition_column,\n max(case when clustering_ordinal_position is not null then 1 else 0 end) = 1 as is_clustered,\n array_to_string(\n array_agg(\n case\n when clustering_ordinal_position is not null then column_name\n else null\n end ignore nulls\n order by clustering_ordinal_position\n ), ', '\n ) as clustering_columns\n\n from columns\n group by 1,2,3\n\n )\n\n select\n unsharded_tables.table_database,\n unsharded_tables.table_schema,\n case\n when is_date_shard then concat(unsharded_tables.table_name, '*')\n else unsharded_tables.table_name\n end as table_name,\n unsharded_tables.table_type,\n\n -- coalesce name and type for External tables - these columns are not\n -- present in the COLUMN_FIELD_PATHS resultset\n coalesce(columns.column_name, '') as column_name,\n -- invent a row number to account for nested fields -- BQ does\n -- not treat these nested properties as independent fields\n row_number() over (\n partition by relation_id\n order by columns.column_index, columns.column_name\n ) as column_index,\n coalesce(columns.column_type, '') as column_type,\n columns.column_comment,\n\n 'Shard count' as `stats__date_shards__label`,\n table_shards.shard_count as `stats__date_shards__value`,\n 'The number of date shards in this table' as `stats__date_shards__description`,\n is_date_shard as `stats__date_shards__include`,\n\n 'Shard (min)' as `stats__date_shard_min__label`,\n table_shards.shard_min as `stats__date_shard_min__value`,\n 'The first date shard in this table' as `stats__date_shard_min__description`,\n is_date_shard as `stats__date_shard_min__include`,\n\n 'Shard (max)' as `stats__date_shard_max__label`,\n table_shards.shard_max as `stats__date_shard_max__value`,\n 'The last date shard in this table' as `stats__date_shard_max__description`,\n is_date_shard as `stats__date_shard_max__include`,\n\n '# Rows' as `stats__num_rows__label`,\n row_count as `stats__num_rows__value`,\n 'Approximate count of rows in this table' as `stats__num_rows__description`,\n (unsharded_tables.table_type = 'table') as `stats__num_rows__include`,\n\n 'Approximate Size' as `stats__num_bytes__label`,\n size_bytes as `stats__num_bytes__value`,\n 'Approximate size of table as reported by BigQuery' as `stats__num_bytes__description`,\n (unsharded_tables.table_type = 'table') as `stats__num_bytes__include`,\n\n 'Partitioned By' as `stats__partitioning_type__label`,\n partition_column as `stats__partitioning_type__value`,\n 'The partitioning column for this table' as `stats__partitioning_type__description`,\n is_partitioned as `stats__partitioning_type__include`,\n\n 'Clustered By' as `stats__clustering_fields__label`,\n clustering_columns as `stats__clustering_fields__value`,\n 'The clustering columns for this table' as `stats__clustering_fields__description`,\n is_clustered as `stats__clustering_fields__include`\n\n -- join using relation_id (an actual relation, not a shard prefix) to make\n -- sure that column metadata is picked up through the join. This will only\n -- return the column information for the \"max\" table in a date-sharded table set\n from unsharded_tables\n left join columns using (relation_id)\n left join column_stats using (relation_id)\n {%- endset -%}\n\n {%- endif -%}\n\n {{ return(run_query(query)) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.980373, "supported_languages": null}, "macro.dbt_bigquery.partition_by": {"unique_id": "macro.dbt_bigquery.partition_by", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "partition_by", "macro_sql": "{% macro partition_by(partition_config) -%}\n {%- if partition_config is none -%}\n {% do return('') %}\n {%- elif partition_config.data_type | lower in ('date','timestamp','datetime') -%}\n partition by {{ partition_config.render() }}\n {%- elif partition_config.data_type | lower in ('int64') -%}\n {%- set range = partition_config.range -%}\n partition by range_bucket(\n {{ partition_config.field }},\n generate_array({{ range.start}}, {{ range.end }}, {{ range.interval }})\n )\n {%- endif -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.9844182, "supported_languages": null}, "macro.dbt_bigquery.cluster_by": {"unique_id": "macro.dbt_bigquery.cluster_by", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "cluster_by", "macro_sql": "{% macro cluster_by(raw_cluster_by) %}\n {%- if raw_cluster_by is not none -%}\n cluster by {% if raw_cluster_by is string -%}\n {% set raw_cluster_by = [raw_cluster_by] %}\n {%- endif -%}\n {%- for cluster in raw_cluster_by -%}\n {{ cluster }}\n {%- if not loop.last -%}, {% endif -%}\n {%- endfor -%}\n\n {% endif %}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.984839, "supported_languages": null}, "macro.dbt_bigquery.bigquery_options": {"unique_id": "macro.dbt_bigquery.bigquery_options", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_options", "macro_sql": "{% macro bigquery_options(opts) %}\n {% set options -%}\n OPTIONS({% for opt_key, opt_val in opts.items() %}\n {{ opt_key }}={{ opt_val }}{{ \",\" if not loop.last }}\n {% endfor %})\n {%- endset %}\n {%- do return(options) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.985218, "supported_languages": null}, "macro.dbt_bigquery.bigquery_table_options": {"unique_id": "macro.dbt_bigquery.bigquery_table_options", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_table_options", "macro_sql": "{% macro bigquery_table_options(config, node, temporary) %}\n {% set opts = adapter.get_table_options(config, node, temporary) %}\n {%- do return(bigquery_options(opts)) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.985483, "supported_languages": null}, "macro.dbt_bigquery.bigquery__create_table_as": {"unique_id": "macro.dbt_bigquery.bigquery__create_table_as", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_table_as", "macro_sql": "{% macro bigquery__create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {%- if language == '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 {{ compiled_code }}\n );\n {%- elif language == 'python' -%}\n {#--\n N.B. Python models _can_ write to temp views HOWEVER they use a different session\n and have already expired by the time they need to be used (I.E. in merges for incremental models)\n\n TODO: Deep dive into spark sessions to see if we can reuse a single session for an entire\n dbt invocation.\n --#}\n {{ py_write_table(compiled_code=compiled_code, target_relation=relation.quote(database=False, schema=False, identifier=False)) }}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"bigquery__create_table_as macro didn't get supported language, it got %s\" % language) %}\n {%- endif -%}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.partition_by", "macro.dbt_bigquery.cluster_by", "macro.dbt_bigquery.bigquery_table_options", "macro.dbt_bigquery.py_write_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.986509, "supported_languages": null}, "macro.dbt_bigquery.bigquery_view_options": {"unique_id": "macro.dbt_bigquery.bigquery_view_options", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_view_options", "macro_sql": "{% macro bigquery_view_options(config, node) %}\n {% set opts = adapter.get_view_options(config, node) %}\n {%- do return(bigquery_options(opts)) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.986759, "supported_languages": null}, "macro.dbt_bigquery.bigquery__create_view_as": {"unique_id": "macro.dbt_bigquery.bigquery__create_view_as", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_view_as", "macro_sql": "{% macro bigquery__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create or replace view {{ relation }}\n {{ bigquery_view_options(config, model) }}\n as {{ sql }};\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_view_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.9870772, "supported_languages": null}, "macro.dbt_bigquery.bigquery__drop_schema": {"unique_id": "macro.dbt_bigquery.bigquery__drop_schema", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__drop_schema", "macro_sql": "{% macro bigquery__drop_schema(relation) -%}\n {{ adapter.drop_schema(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.98721, "supported_languages": null}, "macro.dbt_bigquery.bigquery__drop_relation": {"unique_id": "macro.dbt_bigquery.bigquery__drop_relation", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__drop_relation", "macro_sql": "{% macro bigquery__drop_relation(relation) -%}\n {% call statement('drop_relation') -%}\n drop {{ relation.type }} if exists {{ relation }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.987406, "supported_languages": null}, "macro.dbt_bigquery.bigquery__get_columns_in_relation": {"unique_id": "macro.dbt_bigquery.bigquery__get_columns_in_relation", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__get_columns_in_relation", "macro_sql": "{% macro bigquery__get_columns_in_relation(relation) -%}\n {{ return(adapter.get_columns_in_relation(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.987556, "supported_languages": null}, "macro.dbt_bigquery.bigquery__list_relations_without_caching": {"unique_id": "macro.dbt_bigquery.bigquery__list_relations_without_caching", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__list_relations_without_caching", "macro_sql": "{% macro bigquery__list_relations_without_caching(schema_relation) -%}\n {{ return(adapter.list_relations_without_caching(schema_relation)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.9877021, "supported_languages": null}, "macro.dbt_bigquery.bigquery__list_schemas": {"unique_id": "macro.dbt_bigquery.bigquery__list_schemas", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__list_schemas", "macro_sql": "{% macro bigquery__list_schemas(database) -%}\n {{ return(adapter.list_schemas(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.987843, "supported_languages": null}, "macro.dbt_bigquery.bigquery__check_schema_exists": {"unique_id": "macro.dbt_bigquery.bigquery__check_schema_exists", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__check_schema_exists", "macro_sql": "{% macro bigquery__check_schema_exists(information_schema, schema) %}\n {{ return(adapter.check_schema_exists(information_schema.database, schema)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.988018, "supported_languages": null}, "macro.dbt_bigquery.bigquery__persist_docs": {"unique_id": "macro.dbt_bigquery.bigquery__persist_docs", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__persist_docs", "macro_sql": "{% macro bigquery__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do alter_column_comment(relation, model.columns) %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.9883678, "supported_languages": null}, "macro.dbt_bigquery.bigquery__alter_column_comment": {"unique_id": "macro.dbt_bigquery.bigquery__alter_column_comment", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_column_comment", "macro_sql": "{% macro bigquery__alter_column_comment(relation, column_dict) -%}\n {% do adapter.update_columns(relation, column_dict) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.98852, "supported_languages": null}, "macro.dbt_bigquery.bigquery__rename_relation": {"unique_id": "macro.dbt_bigquery.bigquery__rename_relation", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__rename_relation", "macro_sql": "{% macro bigquery__rename_relation(from_relation, to_relation) -%}\n {% do adapter.rename_relation(from_relation, to_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.988671, "supported_languages": null}, "macro.dbt_bigquery.bigquery__alter_relation_add_columns": {"unique_id": "macro.dbt_bigquery.bigquery__alter_relation_add_columns", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_relation_add_columns", "macro_sql": "{% macro bigquery__alter_relation_add_columns(relation, add_columns) %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation }}\n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {{ return(run_query(sql)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.989065, "supported_languages": null}, "macro.dbt_bigquery.bigquery__alter_relation_drop_columns": {"unique_id": "macro.dbt_bigquery.bigquery__alter_relation_drop_columns", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_relation_drop_columns", "macro_sql": "{% macro bigquery__alter_relation_drop_columns(relation, drop_columns) %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation }}\n\n {% for column in drop_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {{ return(run_query(sql)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.989436, "supported_languages": null}, "macro.dbt_bigquery.bigquery__alter_column_type": {"unique_id": "macro.dbt_bigquery.bigquery__alter_column_type", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_column_type", "macro_sql": "{% macro bigquery__alter_column_type(relation, column_name, new_column_type) -%}\n {#-- Changing a column's data type using a query requires you to scan the entire table.\n The query charges can be significant if the table is very large.\n\n https://cloud.google.com/bigquery/docs/manually-changing-schemas#changing_a_columns_data_type\n #}\n {% set relation_columns = get_columns_in_relation(relation) %}\n\n {% set sql %}\n select\n {%- for col in relation_columns -%}\n {% if col.column == column_name %}\n CAST({{ col.quoted }} AS {{ new_column_type }}) AS {{ col.quoted }}\n {%- else %}\n {{ col.quoted }}\n {%- endif %}\n {%- if not loop.last %},{% endif -%}\n {%- endfor %}\n from {{ relation }}\n {% endset %}\n\n {% call statement('alter_column_type') %}\n {{ create_table_as(False, relation, sql)}}\n {%- endcall %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_columns_in_relation", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.990098, "supported_languages": null}, "macro.dbt_bigquery.bigquery__test_unique": {"unique_id": "macro.dbt_bigquery.bigquery__test_unique", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__test_unique", "macro_sql": "{% macro bigquery__test_unique(model, column_name) %}\n\nwith dbt_test__target as (\n\n select {{ column_name }} as unique_field\n from {{ model }}\n where {{ column_name }} is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.990268, "supported_languages": null}, "macro.dbt_bigquery.bigquery__upload_file": {"unique_id": "macro.dbt_bigquery.bigquery__upload_file", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__upload_file", "macro_sql": "{% macro bigquery__upload_file(local_file_path, database, table_schema, table_name) %}\n\n {{ log(\"kwargs: \" ~ kwargs) }}\n\n {% do adapter.upload_file(local_file_path, database, table_schema, table_name, kwargs=kwargs) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.990547, "supported_languages": null}, "macro.dbt_bigquery.bigquery__create_csv_table": {"unique_id": "macro.dbt_bigquery.bigquery__create_csv_table", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__create_csv_table", "macro_sql": "{% macro bigquery__create_csv_table(model, agate_table) %}\n -- no-op\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.990977, "supported_languages": null}, "macro.dbt_bigquery.bigquery__reset_csv_table": {"unique_id": "macro.dbt_bigquery.bigquery__reset_csv_table", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__reset_csv_table", "macro_sql": "{% macro bigquery__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.9911392, "supported_languages": null}, "macro.dbt_bigquery.bigquery__load_csv_rows": {"unique_id": "macro.dbt_bigquery.bigquery__load_csv_rows", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__load_csv_rows", "macro_sql": "{% macro bigquery__load_csv_rows(model, agate_table) %}\n\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {{ adapter.load_dataframe(model['database'], model['schema'], model['alias'],\n \t\t\t\t\t\t\tagate_table, column_override) }}\n {% if config.persist_relation_docs() and 'description' in model %}\n\n \t{{ adapter.update_table_description(model['database'], model['schema'], model['alias'], model['description']) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.991752, "supported_languages": null}, "macro.dbt_bigquery.bigquery__handle_existing_table": {"unique_id": "macro.dbt_bigquery.bigquery__handle_existing_table", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/view.sql", "original_file_path": "macros/materializations/view.sql", "name": "bigquery__handle_existing_table", "macro_sql": "{% macro bigquery__handle_existing_table(full_refresh, old_relation) %}\n {%- if full_refresh -%}\n {{ adapter.drop_relation(old_relation) }}\n {%- else -%}\n {{ exceptions.relation_wrong_type(old_relation, 'view') }}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.9923751, "supported_languages": null}, "macro.dbt_bigquery.materialization_view_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_view_bigquery", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/view.sql", "original_file_path": "macros/materializations/view.sql", "name": "materialization_view_bigquery", "macro_sql": "{% materialization view, adapter='bigquery' -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {% set to_return = create_or_replace_view() %}\n\n {% set target_relation = this.incorporate(type='view') %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if config.get('grant_access_to') %}\n {% for grant_target_dict in config.get('grant_access_to') %}\n {% do adapter.grant_access_to(this, 'view', None, grant_target_dict) %}\n {% endfor %}\n {% endif %}\n\n {% do return(to_return) %}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_or_replace_view", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.993036, "supported_languages": ["sql"]}, "macro.dbt_bigquery.materialization_table_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_table_bigquery", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "name": "materialization_table_bigquery", "macro_sql": "{% materialization table, adapter='bigquery', supported_languages=['sql', 'python']-%}\n\n {%- set language = model['language'] -%}\n {%- set identifier = model['alias'] -%}\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_not_as_table = (old_relation is not none and not old_relation.is_table) -%}\n {%- set target_relation = api.Relation.create(database=database, schema=schema, identifier=identifier, type='table') -%}\n\n -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\n\n {{ run_hooks(pre_hooks) }}\n\n {#\n We only need to drop this thing if it is not a table.\n If it _is_ already a table, then we can overwrite it without downtime\n Unlike table -> view, no need for `--full-refresh`: dropping a view is no big deal\n #}\n {%- if exists_not_as_table -%}\n {{ adapter.drop_relation(old_relation) }}\n {%- endif -%}\n\n -- build model\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set partition_by = adapter.parse_partition_by(raw_partition_by) -%}\n {%- set cluster_by = config.get('cluster_by', none) -%}\n {% if not adapter.is_replaceable(old_relation, partition_by, cluster_by) %}\n {% do log(\"Hard refreshing \" ~ old_relation ~ \" because it is not replaceable\") %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n\n -- build model\n {%- call statement('main', language=language) -%}\n {{ create_table_as(False, target_relation, compiled_code, language) }}\n {%- endcall -%}\n\n {{ run_hooks(post_hooks) }}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.996345, "supported_languages": ["sql", "python"]}, "macro.dbt_bigquery.py_write_table": {"unique_id": "macro.dbt_bigquery.py_write_table", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "name": "py_write_table", "macro_sql": "{% macro py_write_table(compiled_code, target_relation) %}\nfrom pyspark.sql import SparkSession\n\nspark = SparkSession.builder.appName('smallTest').getOrCreate()\n\nspark.conf.set(\"viewsEnabled\",\"true\")\nspark.conf.set(\"temporaryGcsBucket\",\"{{target.gcs_bucket}}\")\n\n{{ compiled_code }}\ndbt = dbtObj(spark.read.format(\"bigquery\").load)\ndf = model(dbt, spark)\n\n# COMMAND ----------\n# this is materialization code dbt generated, please do not modify\n\nimport pyspark\n# make sure pandas exists before using it\ntry:\n import pandas\n pandas_available = True\nexcept ImportError:\n pandas_available = False\n\n# make sure pyspark.pandas exists before using it\ntry:\n import pyspark.pandas\n pyspark_pandas_api_available = True\nexcept ImportError:\n pyspark_pandas_api_available = False\n\n# make sure databricks.koalas exists before using it\ntry:\n import databricks.koalas\n koalas_available = True\nexcept ImportError:\n koalas_available = False\n\n# preferentially convert pandas DataFrames to pandas-on-Spark or Koalas DataFrames first\n# since they know how to convert pandas DataFrames better than `spark.createDataFrame(df)`\n# and converting from pandas-on-Spark to Spark DataFrame has no overhead\nif pyspark_pandas_api_available and pandas_available and isinstance(df, pandas.core.frame.DataFrame):\n df = pyspark.pandas.frame.DataFrame(df)\nelif koalas_available and pandas_available and isinstance(df, pandas.core.frame.DataFrame):\n df = databricks.koalas.frame.DataFrame(df)\n\n# convert to pyspark.sql.dataframe.DataFrame\nif isinstance(df, pyspark.sql.dataframe.DataFrame):\n pass # since it is already a Spark DataFrame\nelif pyspark_pandas_api_available and isinstance(df, pyspark.pandas.frame.DataFrame):\n df = df.to_spark()\nelif koalas_available and isinstance(df, databricks.koalas.frame.DataFrame):\n df = df.to_spark()\nelif pandas_available and isinstance(df, pandas.core.frame.DataFrame):\n df = spark.createDataFrame(df)\nelse:\n msg = f\"{type(df)} is not a supported type for dbt Python materialization\"\n raise Exception(msg)\n\ndf.write \\\n .mode(\"overwrite\") \\\n .format(\"bigquery\") \\\n .option(\"writeMethod\", \"direct\").option(\"writeDisposition\", 'WRITE_TRUNCATE') \\\n .save(\"{{target_relation}}\")\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.9967098, "supported_languages": null}, "macro.dbt_bigquery.materialization_copy_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_copy_bigquery", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/copy.sql", "original_file_path": "macros/materializations/copy.sql", "name": "materialization_copy_bigquery", "macro_sql": "{% materialization copy, adapter='bigquery' -%}\n\n {# Setup #}\n {{ run_hooks(pre_hooks) }}\n\n {% set destination = this.incorporate(type='table') %}\n\n {# there can be several ref() or source() according to BQ copy API docs #}\n {# cycle over ref() and source() to create source tables array #}\n {% set source_array = [] %}\n {% for ref_table in model.refs %}\n {{ source_array.append(ref(*ref_table)) }}\n {% endfor %}\n\n {% for src_table in model.sources %}\n {{ source_array.append(source(*src_table)) }}\n {% endfor %}\n\n {# Call adapter copy_table function #}\n {%- set result_str = adapter.copy_table(\n source_array,\n destination,\n config.get('copy_materialization', default = 'table')) -%}\n\n {{ store_result('main', response=result_str) }}\n\n {# Clean up #}\n {{ run_hooks(post_hooks) }}\n {%- do apply_grants(target_relation, grant_config) -%}\n {{ adapter.commit() }}\n\n {{ return({'relations': [destination]}) }}\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263066.997969, "supported_languages": ["sql"]}, "macro.dbt_bigquery.declare_dbt_max_partition": {"unique_id": "macro.dbt_bigquery.declare_dbt_max_partition", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "declare_dbt_max_partition", "macro_sql": "{% macro declare_dbt_max_partition(relation, partition_by, complied_code, language='sql') %}\n\n {#-- TODO: revisit partitioning with python models --#}\n {%- if '_dbt_max_partition' in complied_code and language == 'sql' -%}\n\n declare _dbt_max_partition {{ partition_by.data_type }} default (\n select max({{ partition_by.field }}) from {{ this }}\n where {{ partition_by.field }} is not null\n );\n\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0002549, "supported_languages": null}, "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy": {"unique_id": "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "dbt_bigquery_validate_get_incremental_strategy", "macro_sql": "{% macro dbt_bigquery_validate_get_incremental_strategy(config) %}\n {#-- Find and validate the incremental strategy #}\n {%- set strategy = config.get(\"incremental_strategy\") or '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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.000704, "supported_languages": null}, "macro.dbt_bigquery.bq_insert_overwrite": {"unique_id": "macro.dbt_bigquery.bq_insert_overwrite", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "bq_insert_overwrite", "macro_sql": "{% macro bq_insert_overwrite(\n tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n) %}\n\n {% if partitions is not none and partitions != [] %} {# static #}\n\n {% set predicate -%}\n {{ partition_by.render(alias='DBT_INTERNAL_DEST') }} in (\n {{ partitions | join (', ') }}\n )\n {%- endset %}\n\n {%- set source_sql -%}\n (\n {{sql}}\n )\n {%- endset -%}\n\n {#-- Because we're putting the model SQL _directly_ into the MERGE statement,\n we need to prepend the MERGE statement with the user-configured sql_header,\n which may be needed to resolve that model SQL (e.g. referencing a variable or UDF in the header)\n in the \"dynamic\" case, we save the model SQL result as a temp table first, wherein the\n sql_header is included by the create_table_as macro.\n #}\n {{ get_insert_overwrite_merge_sql(target_relation, source_sql, dest_columns, [predicate], include_sql_header=true) }}\n\n {% else %} {# dynamic #}\n\n {% set predicate -%}\n {{ partition_by.render(alias='DBT_INTERNAL_DEST') }} in unnest(dbt_partitions_for_replacement)\n {%- endset %}\n\n {%- set source_sql -%}\n (\n select * from {{ tmp_relation }}\n )\n {%- endset -%}\n\n -- generated script to merge partitions into {{ target_relation }}\n declare dbt_partitions_for_replacement array<{{ partition_by.data_type }}>;\n\n {# have we already created the temp table to check for schema changes? #}\n {% if not tmp_relation_exists %}\n {{ declare_dbt_max_partition(this, partition_by, sql) }}\n\n -- 1. create a temp table\n {{ create_table_as(True, tmp_relation, compiled_code) }}\n {% else %}\n -- 1. temp table already exists, we used it to check for schema changes\n {% endif %}\n\n -- 2. define partitions to update\n set (dbt_partitions_for_replacement) = (\n select as struct\n array_agg(distinct {{ partition_by.render() }})\n from {{ tmp_relation }}\n );\n\n -- 3. run the merge statement\n {{ get_insert_overwrite_merge_sql(target_relation, source_sql, dest_columns, [predicate]) }};\n\n -- 4. clean up the temp table\n drop table if exists {{ tmp_relation }}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql", "macro.dbt_bigquery.declare_dbt_max_partition", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.00194, "supported_languages": null}, "macro.dbt_bigquery.bq_generate_incremental_build_sql": {"unique_id": "macro.dbt_bigquery.bq_generate_incremental_build_sql", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "bq_generate_incremental_build_sql", "macro_sql": "{% macro bq_generate_incremental_build_sql(\n strategy, tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n) %}\n {#-- if partitioned, use BQ scripting to get the range of partition values to be updated --#}\n {% if strategy == 'insert_overwrite' %}\n\n {% set missing_partition_msg -%}\n The 'insert_overwrite' strategy requires the `partition_by` config.\n {%- endset %}\n {% if partition_by is none %}\n {% do exceptions.raise_compiler_error(missing_partition_msg) %}\n {% endif %}\n\n {% set build_sql = bq_insert_overwrite(\n tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n ) %}\n\n {% else %} {# strategy == 'merge' #}\n {%- set source_sql -%}\n {%- if tmp_relation_exists -%}\n (\n select * from {{ tmp_relation }}\n )\n {%- else -%} {#-- wrap sql in parens to make it a subquery --#}\n (\n {{sql}}\n )\n {%- endif -%}\n {%- endset -%}\n\n {% set build_sql = get_merge_sql(target_relation, source_sql, unique_key, dest_columns) %}\n\n {% endif %}\n\n {{ return(build_sql) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bq_insert_overwrite", "macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.002802, "supported_languages": null}, "macro.dbt_bigquery.materialization_incremental_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_incremental_bigquery", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "materialization_incremental_bigquery", "macro_sql": "{% materialization incremental, adapter='bigquery', supported_languages=['sql', 'python'] -%}\n\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n {%- set language = model['language'] %}\n\n {%- set target_relation = this %}\n {%- set existing_relation = load_relation(this) %}\n {%- set tmp_relation = make_temp_relation(this) %}\n\n {#-- Validate early so we don't run SQL if the strategy is invalid --#}\n {% set strategy = dbt_bigquery_validate_get_incremental_strategy(config) -%}\n\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set partition_by = adapter.parse_partition_by(raw_partition_by) -%}\n {%- set partitions = config.get('partitions', none) -%}\n {%- set cluster_by = config.get('cluster_by', none) -%}\n\n {% set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') %}\n\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n {% if existing_relation is none %}\n {%- call statement('main', language=language) -%}\n {{ create_table_as(False, target_relation, compiled_code, language) }}\n {%- endcall -%}\n\n {% elif existing_relation.is_view %}\n {#-- There's no way to atomically replace a view with a table on BQ --#}\n {{ adapter.drop_relation(existing_relation) }}\n {%- call statement('main', language=language) -%}\n {{ create_table_as(False, target_relation, compiled_code, language) }}\n {%- endcall -%}\n\n {% elif full_refresh_mode %}\n {#-- If the partition/cluster config has changed, then we must drop and recreate --#}\n {% if not adapter.is_replaceable(existing_relation, partition_by, cluster_by) %}\n {% do log(\"Hard refreshing \" ~ existing_relation ~ \" because it is not replaceable\") %}\n {{ adapter.drop_relation(existing_relation) }}\n {% endif %}\n {%- call statement('main', language=language) -%}\n {{ create_table_as(False, target_relation, compiled_code, language) }}\n {%- endcall -%}\n\n {% else %}\n {%- if language == 'python' and strategy == 'insert_overwrite' -%}\n {#-- This lets us move forward assuming no python will be directly templated into a query --#}\n {%- set python_unsupported_msg -%}\n The 'insert_overwrite' strategy is not yet supported for python models.\n {%- endset %}\n {% do exceptions.raise_compiler_error(python_unsupported_msg) %}\n {%- endif -%}\n\n {% set tmp_relation_exists = false %}\n {% if on_schema_change != 'ignore' or language == 'python' %}\n {#-- Check first, since otherwise we may not build a temp table --#}\n {#-- Python always needs to create a temp table --#}\n {%- call statement('create_tmp_relation', language=language) -%}\n {{ declare_dbt_max_partition(this, partition_by, compiled_code, language) +\n create_table_as(True, tmp_relation, compiled_code, language)\n }}\n {%- endcall -%}\n {% set tmp_relation_exists = true %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, tmp_relation, existing_relation) %}\n {% endif %}\n\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n {% set build_sql = bq_generate_incremental_build_sql(\n strategy, tmp_relation, target_relation, compiled_code, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n ) %}\n\n {%- call statement('main') -%}\n {{ build_sql }}\n {% endcall %}\n\n {%- if language == 'python' and tmp_relation -%}\n {{ adapter.drop_relation(tmp_relation) }}\n {%- endif -%}\n\n {% endif %}\n\n {{ run_hooks(post_hooks) }}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.load_relation", "macro.dbt.make_temp_relation", "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt_bigquery.declare_dbt_max_partition", "macro.dbt.process_schema_changes", "macro.dbt_bigquery.bq_generate_incremental_build_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0062878, "supported_languages": ["sql", "python"]}, "macro.dbt_bigquery.bigquery__snapshot_hash_arguments": {"unique_id": "macro.dbt_bigquery.bigquery__snapshot_hash_arguments", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__snapshot_hash_arguments", "macro_sql": "{% macro bigquery__snapshot_hash_arguments(args) -%}\n to_hex(md5(concat({%- for arg in args -%}\n coalesce(cast({{ arg }} as string), ''){% if not loop.last %}, '|',{% endif -%}\n {%- endfor -%}\n )))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.00677, "supported_languages": null}, "macro.dbt_bigquery.bigquery__create_columns": {"unique_id": "macro.dbt_bigquery.bigquery__create_columns", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__create_columns", "macro_sql": "{% macro bigquery__create_columns(relation, columns) %}\n {{ adapter.alter_table_add_columns(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.006926, "supported_languages": null}, "macro.dbt_bigquery.bigquery__post_snapshot": {"unique_id": "macro.dbt_bigquery.bigquery__post_snapshot", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__post_snapshot", "macro_sql": "{% macro bigquery__post_snapshot(staging_relation) %}\n -- Clean up the snapshot temp table\n {% do drop_relation(staging_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0070531, "supported_languages": null}, "macro.dbt_bigquery.bigquery__except": {"unique_id": "macro.dbt_bigquery.bigquery__except", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "name": "bigquery__except", "macro_sql": "{% macro bigquery__except() %}\n\n except distinct\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.007231, "supported_languages": null}, "macro.dbt_bigquery.bigquery__dateadd": {"unique_id": "macro.dbt_bigquery.bigquery__dateadd", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "name": "bigquery__dateadd", "macro_sql": "{% macro bigquery__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n datetime_add(\n cast( {{ from_date_or_timestamp }} as datetime),\n interval {{ interval }} {{ datepart }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.007524, "supported_languages": null}, "macro.dbt_bigquery.bigquery__current_timestamp": {"unique_id": "macro.dbt_bigquery.bigquery__current_timestamp", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/timestamps.sql", "original_file_path": "macros/utils/timestamps.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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0077498, "supported_languages": null}, "macro.dbt_bigquery.bigquery__snapshot_string_as_time": {"unique_id": "macro.dbt_bigquery.bigquery__snapshot_string_as_time", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/timestamps.sql", "original_file_path": "macros/utils/timestamps.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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.00793, "supported_languages": null}, "macro.dbt_bigquery.bigquery__current_timestamp_backcompat": {"unique_id": "macro.dbt_bigquery.bigquery__current_timestamp_backcompat", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/timestamps.sql", "original_file_path": "macros/utils/timestamps.sql", "name": "bigquery__current_timestamp_backcompat", "macro_sql": "{% macro bigquery__current_timestamp_backcompat() -%}\n current_timestamp\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0080152, "supported_languages": null}, "macro.dbt_bigquery.bigquery__intersect": {"unique_id": "macro.dbt_bigquery.bigquery__intersect", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "name": "bigquery__intersect", "macro_sql": "{% macro bigquery__intersect() %}\n\n intersect distinct\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.008184, "supported_languages": null}, "macro.dbt_bigquery.bigquery__escape_single_quotes": {"unique_id": "macro.dbt_bigquery.bigquery__escape_single_quotes", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "name": "bigquery__escape_single_quotes", "macro_sql": "{% macro bigquery__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\", \"\\\\'\") }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.008449, "supported_languages": null}, "macro.dbt_bigquery.bigquery__right": {"unique_id": "macro.dbt_bigquery.bigquery__right", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "name": "bigquery__right", "macro_sql": "{% macro bigquery__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0\n then ''\n else\n substr(\n {{ string_text }},\n -1 * ({{ length_expression }})\n )\n end\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0087428, "supported_languages": null}, "macro.dbt_bigquery.bigquery__listagg": {"unique_id": "macro.dbt_bigquery.bigquery__listagg", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "name": "bigquery__listagg", "macro_sql": "{% macro bigquery__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n string_agg(\n {{ measure }},\n {{ delimiter_text }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n {% if limit_num -%}\n limit {{ limit_num }}\n {%- endif %}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.009192, "supported_languages": null}, "macro.dbt_bigquery.bigquery__datediff": {"unique_id": "macro.dbt_bigquery.bigquery__datediff", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "name": "bigquery__datediff", "macro_sql": "{% macro bigquery__datediff(first_date, second_date, datepart) -%}\n\n {% if dbt_version[0] == 1 and dbt_version[2] >= 2 %}\n {{ return(dbt.datediff(first_date, second_date, datepart)) }}\n {% else %}\n\n datetime_diff(\n cast({{second_date}} as datetime),\n cast({{first_date}} as datetime),\n {{datepart}}\n )\n\n {% endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.009749, "supported_languages": null}, "macro.dbt_bigquery.bigquery__safe_cast": {"unique_id": "macro.dbt_bigquery.bigquery__safe_cast", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "name": "bigquery__safe_cast", "macro_sql": "{% macro bigquery__safe_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.009981, "supported_languages": null}, "macro.dbt_bigquery.bigquery__hash": {"unique_id": "macro.dbt_bigquery.bigquery__hash", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "name": "bigquery__hash", "macro_sql": "{% macro bigquery__hash(field) -%}\n to_hex({{dbt.default__hash(field)}})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.010207, "supported_languages": null}, "macro.dbt_bigquery.bigquery__position": {"unique_id": "macro.dbt_bigquery.bigquery__position", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "name": "bigquery__position", "macro_sql": "{% macro bigquery__position(substring_text, string_text) %}\n\n strpos(\n {{ string_text }},\n {{ substring_text }}\n\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.010453, "supported_languages": null}, "macro.dbt_bigquery.bigquery__array_concat": {"unique_id": "macro.dbt_bigquery.bigquery__array_concat", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "name": "bigquery__array_concat", "macro_sql": "{% macro bigquery__array_concat(array_1, array_2) -%}\n array_concat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.010726, "supported_languages": null}, "macro.dbt_bigquery.bigquery__bool_or": {"unique_id": "macro.dbt_bigquery.bigquery__bool_or", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "name": "bigquery__bool_or", "macro_sql": "{% macro bigquery__bool_or(expression) -%}\n\n logical_or({{ expression }})\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.011035, "supported_languages": null}, "macro.dbt_bigquery.bigquery__split_part": {"unique_id": "macro.dbt_bigquery.bigquery__split_part", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "name": "bigquery__split_part", "macro_sql": "{% macro bigquery__split_part(string_text, delimiter_text, part_number) %}\n\n {% if part_number >= 0 %}\n split(\n {{ string_text }},\n {{ delimiter_text }}\n )[safe_offset({{ part_number - 1 }})]\n {% else %}\n split(\n {{ string_text }},\n {{ delimiter_text }}\n )[safe_offset(\n length({{ string_text }})\n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 1\n )]\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.011776, "supported_languages": null}, "macro.dbt_bigquery.bigquery__date_trunc": {"unique_id": "macro.dbt_bigquery.bigquery__date_trunc", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "name": "bigquery__date_trunc", "macro_sql": "{% macro bigquery__date_trunc(datepart, date) -%}\n timestamp_trunc(\n cast({{date}} as timestamp),\n {{datepart}}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0120409, "supported_languages": null}, "macro.dbt_bigquery.bigquery__array_construct": {"unique_id": "macro.dbt_bigquery.bigquery__array_construct", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "name": "bigquery__array_construct", "macro_sql": "{% macro bigquery__array_construct(inputs, data_type) -%}\n {% if inputs|length > 0 %}\n [ {{ inputs|join(' , ') }} ]\n {% else %}\n ARRAY<{{data_type}}>[]\n {% endif %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.012434, "supported_languages": null}, "macro.dbt_bigquery.bigquery__array_append": {"unique_id": "macro.dbt_bigquery.bigquery__array_append", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "name": "bigquery__array_append", "macro_sql": "{% macro bigquery__array_append(array, new_element) -%}\n {{ array_concat(array, array_construct([new_element])) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.array_concat", "macro.dbt.array_construct"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.01272, "supported_languages": null}, "macro.dbt_bigquery.bigquery__get_show_grant_sql": {"unique_id": "macro.dbt_bigquery.bigquery__get_show_grant_sql", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "bigquery__get_show_grant_sql", "macro_sql": "{% macro bigquery__get_show_grant_sql(relation) %}\n {% set location = adapter.get_dataset_location(relation) %}\n {% set relation = relation.incorporate(location=location) %}\n\n select privilege_type, grantee\n from {{ relation.information_schema(\"OBJECT_PRIVILEGES\") }}\n where object_schema = \"{{ relation.dataset }}\"\n and object_name = \"{{ relation.identifier }}\"\n -- filter out current user\n and split(grantee, ':')[offset(1)] != session_user()\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.013428, "supported_languages": null}, "macro.dbt_bigquery.bigquery__get_grant_sql": {"unique_id": "macro.dbt_bigquery.bigquery__get_grant_sql", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "bigquery__get_grant_sql", "macro_sql": "\n\n\n{%- macro bigquery__get_grant_sql(relation, privilege, grantee) -%}\n grant `{{ privilege }}` on {{ relation.type }} {{ relation }} to {{ '\\\"' + grantee|join('\\\", \\\"') + '\\\"' }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.013675, "supported_languages": null}, "macro.dbt_bigquery.bigquery__get_revoke_sql": {"unique_id": "macro.dbt_bigquery.bigquery__get_revoke_sql", "package_name": "dbt_bigquery", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "bigquery__get_revoke_sql", "macro_sql": "{%- macro bigquery__get_revoke_sql(relation, privilege, grantee) -%}\n revoke `{{ privilege }}` on {{ relation.type }} {{ relation }} from {{ '\\\"' + grantee|join('\\\", \\\"') + '\\\"' }}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.013916, "supported_languages": null}, "macro.dbt.run_hooks": {"unique_id": "macro.dbt.run_hooks", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.015054, "supported_languages": null}, "macro.dbt.make_hook_config": {"unique_id": "macro.dbt.make_hook_config", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.015254, "supported_languages": null}, "macro.dbt.before_begin": {"unique_id": "macro.dbt.before_begin", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.015397, "supported_languages": null}, "macro.dbt.in_transaction": {"unique_id": "macro.dbt.in_transaction", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.015539, "supported_languages": null}, "macro.dbt.after_commit": {"unique_id": "macro.dbt.after_commit", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0156858, "supported_languages": null}, "macro.dbt.set_sql_header": {"unique_id": "macro.dbt.set_sql_header", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.016122, "supported_languages": null}, "macro.dbt.should_full_refresh": {"unique_id": "macro.dbt.should_full_refresh", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0164218, "supported_languages": null}, "macro.dbt.should_store_failures": {"unique_id": "macro.dbt.should_store_failures", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0167282, "supported_languages": null}, "macro.dbt.snapshot_merge_sql": {"unique_id": "macro.dbt.snapshot_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "name": "snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.017227, "supported_languages": null}, "macro.dbt.default__snapshot_merge_sql": {"unique_id": "macro.dbt.default__snapshot_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "name": "default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.dbt_scd_id = DBT_INTERNAL_DEST.dbt_scd_id\n\n when matched\n and DBT_INTERNAL_DEST.dbt_valid_to is null\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0175, "supported_languages": null}, "macro.dbt.strategy_dispatch": {"unique_id": "macro.dbt.strategy_dispatch", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "strategy_dispatch", "macro_sql": "{% macro strategy_dispatch(name) -%}\n{% set original_name = name %}\n {% if '.' in name %}\n {% set package_name, name = name.split(\".\", 1) %}\n {% else %}\n {% set package_name = none %}\n {% endif %}\n\n {% if package_name is none %}\n {% set package_context = context %}\n {% elif package_name in context %}\n {% set package_context = context[package_name] %}\n {% else %}\n {% set error_msg %}\n Could not find package '{{package_name}}', called with '{{original_name}}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n\n {%- set search_name = 'snapshot_' ~ name ~ '_strategy' -%}\n\n {% if search_name not in package_context %}\n {% set error_msg %}\n The specified strategy macro '{{name}}' was not found in package '{{ package_name }}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n {{ return(package_context[search_name]) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0209012, "supported_languages": null}, "macro.dbt.snapshot_hash_arguments": {"unique_id": "macro.dbt.snapshot_hash_arguments", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments', 'dbt')(args) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0210738, "supported_languages": null}, "macro.dbt.default__snapshot_hash_arguments": {"unique_id": "macro.dbt.default__snapshot_hash_arguments", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "default__snapshot_hash_arguments", "macro_sql": "{% macro default__snapshot_hash_arguments(args) -%}\n md5({%- for arg in args -%}\n coalesce(cast({{ arg }} as varchar ), '')\n {% if not loop.last %} || '|' || {% endif %}\n {%- endfor -%})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.02129, "supported_languages": null}, "macro.dbt.snapshot_timestamp_strategy": {"unique_id": "macro.dbt.snapshot_timestamp_strategy", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_timestamp_strategy", "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set primary_key = config['unique_key'] %}\n {% set updated_at = config['updated_at'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/dbt-labs/dbt-core/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.dbt_valid_from < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.022007, "supported_languages": null}, "macro.dbt.snapshot_string_as_time": {"unique_id": "macro.dbt.snapshot_string_as_time", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time', 'dbt')(timestamp) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.022169, "supported_languages": null}, "macro.dbt.default__snapshot_string_as_time": {"unique_id": "macro.dbt.default__snapshot_string_as_time", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "default__snapshot_string_as_time", "macro_sql": "{% macro default__snapshot_string_as_time(timestamp) %}\n {% do exceptions.raise_not_implemented(\n 'snapshot_string_as_time macro not implemented for adapter '+adapter.type()\n ) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0223382, "supported_languages": null}, "macro.dbt.snapshot_check_all_get_existing_columns": {"unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) -%}\n {%- if not target_exists -%}\n {#-- no table yet -> return whatever the query does --#}\n {{ return((false, query_columns)) }}\n {%- endif -%}\n\n {#-- handle any schema changes --#}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=node.alias) -%}\n\n {% if check_cols_config == 'all' %}\n {%- set query_columns = get_columns_in_query(node['compiled_code']) -%}\n\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {#-- query for proper casing/quoting, to support comparison below --#}\n {%- set select_check_cols_from_target -%}\n select {{ check_cols_config | join(', ') }} from ({{ node['compiled_code'] }}) subq\n {%- endset -%}\n {% set query_columns = get_columns_in_query(select_check_cols_from_target) %}\n\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set existing_cols = adapter.get_columns_in_relation(target_relation) | map(attribute = 'name') | list -%}\n {%- set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(adapter.quote(col)) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return((ns.column_added, intersection)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.023722, "supported_languages": null}, "macro.dbt.snapshot_check_strategy": {"unique_id": "macro.dbt.snapshot_check_strategy", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set check_cols_config = config['check_cols'] %}\n {% set primary_key = config['unique_key'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n {% set updated_at = config.get('updated_at', snapshot_get_time()) %}\n\n {% set column_added = false %}\n\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n {{ get_true_sql() }}\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.get_true_sql", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.025077, "supported_languages": null}, "macro.dbt.create_columns": {"unique_id": "macro.dbt.create_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns', 'dbt')(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.028824, "supported_languages": null}, "macro.dbt.default__create_columns": {"unique_id": "macro.dbt.default__create_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation }} add column \"{{ column.name }}\" {{ column.data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.029109, "supported_languages": null}, "macro.dbt.post_snapshot": {"unique_id": "macro.dbt.post_snapshot", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.029279, "supported_languages": null}, "macro.dbt.default__post_snapshot": {"unique_id": "macro.dbt.default__post_snapshot", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.029365, "supported_languages": null}, "macro.dbt.get_true_sql": {"unique_id": "macro.dbt.get_true_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "get_true_sql", "macro_sql": "{% macro get_true_sql() %}\n {{ adapter.dispatch('get_true_sql', 'dbt')() }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_true_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.029509, "supported_languages": null}, "macro.dbt.default__get_true_sql": {"unique_id": "macro.dbt.default__get_true_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__get_true_sql", "macro_sql": "{% macro default__get_true_sql() %}\n {{ return('TRUE') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.029622, "supported_languages": null}, "macro.dbt.snapshot_staging_table": {"unique_id": "macro.dbt.snapshot_staging_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "snapshot_staging_table", "macro_sql": "{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {{ adapter.dispatch('snapshot_staging_table', 'dbt')(strategy, source_sql, target_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_staging_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.029823, "supported_languages": null}, "macro.dbt.default__snapshot_staging_table": {"unique_id": "macro.dbt.default__snapshot_staging_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__snapshot_staging_table", "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *,\n {{ strategy.unique_key }} as dbt_unique_key\n\n from {{ target_relation }}\n where dbt_valid_to is null\n\n ),\n\n insertions_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to,\n {{ strategy.scd_id }} as dbt_scd_id\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n {{ strategy.updated_at }} as dbt_valid_to\n\n from snapshot_query\n ),\n\n {%- if strategy.invalidate_hard_deletes %}\n\n deletes_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from insertions_source_data as source_data\n left outer join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_unique_key is null\n or (\n snapshotted_data.dbt_unique_key is not null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.dbt_scd_id\n\n from updates_source_data as source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where (\n {{ strategy.row_changed }}\n )\n )\n\n {%- if strategy.invalidate_hard_deletes -%}\n ,\n\n deletes as (\n\n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as dbt_valid_from,\n {{ snapshot_get_time() }} as dbt_updated_at,\n {{ snapshot_get_time() }} as dbt_valid_to,\n snapshotted_data.dbt_scd_id\n\n from snapshotted_data\n left join deletes_source_data as source_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where source_data.dbt_unique_key is null\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.invalidate_hard_deletes %}\n union all\n select * from deletes\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.030698, "supported_languages": null}, "macro.dbt.build_snapshot_table": {"unique_id": "macro.dbt.build_snapshot_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) -%}\n {{ adapter.dispatch('build_snapshot_table', 'dbt')(strategy, sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__build_snapshot_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.030894, "supported_languages": null}, "macro.dbt.default__build_snapshot_table": {"unique_id": "macro.dbt.default__build_snapshot_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__build_snapshot_table", "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.03115, "supported_languages": null}, "macro.dbt.build_snapshot_staging_table": {"unique_id": "macro.dbt.build_snapshot_staging_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set temp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, temp_relation, select) }}\n {% endcall %}\n\n {% do return(temp_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.031615, "supported_languages": null}, "macro.dbt.materialization_snapshot_default": {"unique_id": "macro.dbt.materialization_snapshot_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot.sql", "original_file_path": "macros/materializations/snapshots/snapshot.sql", "name": "materialization_snapshot_default", "macro_sql": "{% materialization snapshot, default %}\n {%- set config = model['config'] -%}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\n\n {% set target_relation_exists, target_relation = get_or_create_relation(\n database=model.database,\n schema=model.schema,\n identifier=target_table,\n type='table') -%}\n\n {%- if not target_relation.is_table -%}\n {% do exceptions.relation_wrong_type(target_relation, 'table') %}\n {%- endif -%}\n\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set strategy_macro = strategy_dispatch(strategy_name) %}\n {% set strategy = strategy_macro(model, \"snapshotted_data\", \"source_data\", config, target_relation_exists) %}\n\n {% if not target_relation_exists %}\n\n {% set build_sql = build_snapshot_table(strategy, model['compiled_code']) %}\n {% set final_sql = create_table_as(False, target_relation, build_sql) %}\n\n {% else %}\n\n {{ adapter.valid_snapshot_target(target_relation) }}\n\n {% set staging_table = build_snapshot_staging_table(strategy, sql, target_relation) %}\n\n -- this may no-op if the database does not require column expansion\n {% do adapter.expand_target_column_types(from_relation=staging_table,\n to_relation=target_relation) %}\n\n {% set missing_columns = adapter.get_missing_columns(staging_table, target_relation)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% do create_columns(target_relation, missing_columns) %}\n\n {% set source_columns = adapter.get_columns_in_relation(staging_table)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% set quoted_source_columns = [] %}\n {% for column in source_columns %}\n {% do quoted_source_columns.append(adapter.quote(column.name)) %}\n {% endfor %}\n\n {% set final_sql = snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n %}\n\n {% endif %}\n\n {% call statement('main') %}\n {{ final_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(target_relation_exists, full_refresh_mode=False) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if not target_relation_exists %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if staging_table is defined %}\n {% do post_snapshot(staging_table) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_or_create_relation", "macro.dbt.run_hooks", "macro.dbt.strategy_dispatch", "macro.dbt.build_snapshot_table", "macro.dbt.create_table_as", "macro.dbt.build_snapshot_staging_table", "macro.dbt.create_columns", "macro.dbt.snapshot_merge_sql", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes", "macro.dbt.post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.037518, "supported_languages": ["sql"]}, "macro.dbt.materialization_test_default": {"unique_id": "macro.dbt.materialization_test_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/test.sql", "original_file_path": "macros/materializations/tests/test.sql", "name": "materialization_test_default", "macro_sql": "{%- materialization test, default -%}\n\n {% set relations = [] %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type='table') -%} %}\n\n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n\n {% call statement(auto_begin=True) %}\n {{ create_table_as(False, target_relation, sql) }}\n {% endcall %}\n\n {% do relations.append(target_relation) %}\n\n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n\n {{ adapter.commit() }}\n\n {% else %}\n\n {% set main_sql = sql %}\n\n {% endif %}\n\n {% set limit = config.get('limit') %}\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit)}}\n\n {%- endcall %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0396092, "supported_languages": ["sql"]}, "macro.dbt.get_test_sql": {"unique_id": "macro.dbt.get_test_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "name": "get_test_sql", "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql', 'dbt')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.040134, "supported_languages": null}, "macro.dbt.default__get_test_sql": {"unique_id": "macro.dbt.default__get_test_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "name": "default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.040452, "supported_languages": null}, "macro.dbt.get_where_subquery": {"unique_id": "macro.dbt.get_where_subquery", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "name": "get_where_subquery", "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_where_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.040892, "supported_languages": null}, "macro.dbt.default__get_where_subquery": {"unique_id": "macro.dbt.default__get_where_subquery", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "name": "default__get_where_subquery", "macro_sql": "{% macro default__get_where_subquery(relation) -%}\n {% set where = config.get('where', '') %}\n {% if where %}\n {%- set filtered -%}\n (select * from {{ relation }} where {{ where }}) dbt_subquery\n {%- endset -%}\n {% do return(filtered) %}\n {%- else -%}\n {% do return(relation) %}\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0412722, "supported_languages": null}, "macro.dbt.get_quoted_csv": {"unique_id": "macro.dbt.get_quoted_csv", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\n\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.04285, "supported_languages": null}, "macro.dbt.diff_columns": {"unique_id": "macro.dbt.diff_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "diff_columns", "macro_sql": "{% macro diff_columns(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% set source_names = source_columns | map(attribute = 'column') | list %}\n {% set target_names = target_columns | map(attribute = 'column') | list %}\n\n {# --check whether the name attribute exists in the target - this does not perform a data type check #}\n {% for sc in source_columns %}\n {% if sc.name not in target_names %}\n {{ result.append(sc) }}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0433972, "supported_languages": null}, "macro.dbt.diff_column_data_types": {"unique_id": "macro.dbt.diff_column_data_types", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "diff_column_data_types", "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.data_type != tc.data_type and not sc.can_expand_to(other_column=tc) %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.data_type } ) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.044063, "supported_languages": null}, "macro.dbt.get_merge_update_columns": {"unique_id": "macro.dbt.get_merge_update_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "get_merge_update_columns", "macro_sql": "{% macro get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {{ return(adapter.dispatch('get_merge_update_columns', 'dbt')(merge_update_columns, merge_exclude_columns, dest_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0443, "supported_languages": null}, "macro.dbt.default__get_merge_update_columns": {"unique_id": "macro.dbt.default__get_merge_update_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "default__get_merge_update_columns", "macro_sql": "{% macro default__get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {%- set default_cols = dest_columns | map(attribute=\"quoted\") | list -%}\n\n {%- if merge_update_columns and merge_exclude_columns -%}\n {{ exceptions.raise_compiler_error(\n 'Model cannot specify merge_update_columns and merge_exclude_columns. Please update model to use only one config'\n )}}\n {%- elif merge_update_columns -%}\n {%- set update_columns = merge_update_columns -%}\n {%- elif merge_exclude_columns -%}\n {%- set update_columns = [] -%}\n {%- for column in dest_columns -%}\n {% if column.column | lower not in merge_exclude_columns | map(\"lower\") | list %}\n {%- do update_columns.append(column.quoted) -%}\n {% endif %}\n {%- endfor -%}\n {%- else -%}\n {%- set update_columns = default_cols -%}\n {%- endif -%}\n\n {{ return(update_columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.045009, "supported_languages": null}, "macro.dbt.get_merge_sql": {"unique_id": "macro.dbt.get_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, predicates=none) -%}\n {{ adapter.dispatch('get_merge_sql', 'dbt')(target, source, unique_key, dest_columns, predicates) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.049258, "supported_languages": null}, "macro.dbt.default__get_merge_sql": {"unique_id": "macro.dbt.default__get_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, predicates) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set merge_update_columns = config.get('merge_update_columns') -%}\n {%- set merge_exclude_columns = config.get('merge_exclude_columns') -%}\n {%- set update_columns = get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not mapping and unique_key is not string %}\n {% for key in unique_key %}\n {% set this_key_match %}\n DBT_INTERNAL_SOURCE.{{ key }} = DBT_INTERNAL_DEST.{{ key }}\n {% endset %}\n {% do predicates.append(this_key_match) %}\n {% endfor %}\n {% else %}\n {% set unique_key_match %}\n DBT_INTERNAL_SOURCE.{{ unique_key }} = DBT_INTERNAL_DEST.{{ unique_key }}\n {% endset %}\n {% do predicates.append(unique_key_match) %}\n {% endif %}\n {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\n\n {{ sql_header if sql_header is not none }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on {{ predicates | join(' and ') }}\n\n {% if unique_key %}\n when matched then update set\n {% for column_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv", "macro.dbt.get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.050903, "supported_languages": null}, "macro.dbt.get_delete_insert_merge_sql": {"unique_id": "macro.dbt.get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql', 'dbt')(target, source, unique_key, dest_columns) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.051156, "supported_languages": null}, "macro.dbt.default__get_delete_insert_merge_sql": {"unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not string %}\n delete from {{target }}\n using {{ source }}\n where (\n {% for key in unique_key %}\n {{ source }}.{{ key }} = {{ target }}.{{ key }}\n {{ \"and \" if not loop.last }}\n {% endfor %}\n );\n {% else %}\n delete from {{ target }}\n where (\n {{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n );\n\n {% endif %}\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.051918, "supported_languages": null}, "macro.dbt.get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql', 'dbt')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.052194, "supported_languages": null}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {#-- The only time include_sql_header is True: --#}\n {#-- BigQuery + insert_overwrite strategy + \"static\" partitions config --#}\n {#-- We should consider including the sql header at the materialization level instead --#}\n\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.052886, "supported_languages": null}, "macro.dbt.is_incremental": {"unique_id": "macro.dbt.is_incremental", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/is_incremental.sql", "original_file_path": "macros/materializations/models/incremental/is_incremental.sql", "name": "is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.053714, "supported_languages": null}, "macro.dbt.get_incremental_append_sql": {"unique_id": "macro.dbt.get_incremental_append_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_append_sql", "macro_sql": "{% macro get_incremental_append_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_append_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0546088, "supported_languages": null}, "macro.dbt.default__get_incremental_append_sql": {"unique_id": "macro.dbt.default__get_incremental_append_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_append_sql", "macro_sql": "{% macro default__get_incremental_append_sql(arg_dict) %}\n\n {% do return(get_insert_into_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_insert_into_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.054852, "supported_languages": null}, "macro.dbt.get_incremental_delete_insert_sql": {"unique_id": "macro.dbt.get_incremental_delete_insert_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_delete_insert_sql", "macro_sql": "{% macro get_incremental_delete_insert_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_delete_insert_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_delete_insert_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.055037, "supported_languages": null}, "macro.dbt.default__get_incremental_delete_insert_sql": {"unique_id": "macro.dbt.default__get_incremental_delete_insert_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_delete_insert_sql", "macro_sql": "{% macro default__get_incremental_delete_insert_sql(arg_dict) %}\n\n {% do return(get_delete_insert_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.055299, "supported_languages": null}, "macro.dbt.get_incremental_merge_sql": {"unique_id": "macro.dbt.get_incremental_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_merge_sql", "macro_sql": "{% macro get_incremental_merge_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.055501, "supported_languages": null}, "macro.dbt.default__get_incremental_merge_sql": {"unique_id": "macro.dbt.default__get_incremental_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_merge_sql", "macro_sql": "{% macro default__get_incremental_merge_sql(arg_dict) %}\n\n {% do return(get_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.055763, "supported_languages": null}, "macro.dbt.get_incremental_insert_overwrite_sql": {"unique_id": "macro.dbt.get_incremental_insert_overwrite_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_insert_overwrite_sql", "macro_sql": "{% macro get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_insert_overwrite_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_insert_overwrite_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0559502, "supported_languages": null}, "macro.dbt.default__get_incremental_insert_overwrite_sql": {"unique_id": "macro.dbt.default__get_incremental_insert_overwrite_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_insert_overwrite_sql", "macro_sql": "{% macro default__get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {% do return(get_insert_overwrite_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"], arg_dict[\"predicates\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.056229, "supported_languages": null}, "macro.dbt.get_incremental_default_sql": {"unique_id": "macro.dbt.get_incremental_default_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_default_sql", "macro_sql": "{% macro get_incremental_default_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_default_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_default_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.056422, "supported_languages": null}, "macro.dbt.default__get_incremental_default_sql": {"unique_id": "macro.dbt.default__get_incremental_default_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_default_sql", "macro_sql": "{% macro default__get_incremental_default_sql(arg_dict) %}\n\n {% do return(get_incremental_append_sql(arg_dict)) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.056573, "supported_languages": null}, "macro.dbt.get_insert_into_sql": {"unique_id": "macro.dbt.get_insert_into_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_insert_into_sql", "macro_sql": "{% macro get_insert_into_sql(target_relation, temp_relation, dest_columns) %}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ temp_relation }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.056847, "supported_languages": null}, "macro.dbt.materialization_incremental_default": {"unique_id": "macro.dbt.materialization_incremental_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/incremental.sql", "original_file_path": "macros/materializations/models/incremental/incremental.sql", "name": "materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% if existing_relation is none %}\n {% set build_sql = get_create_table_as_sql(False, target_relation, sql) %}\n {% elif full_refresh_mode %}\n {% set build_sql = get_create_table_as_sql(False, intermediate_relation, sql) %}\n {% set need_swap = true %}\n {% else %}\n {% do run_query(get_create_table_as_sql(True, temp_relation, sql)) %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set incremental_predicates = config.get('incremental_predicates', none) %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.get_create_table_as_sql", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0617669, "supported_languages": ["sql"]}, "macro.dbt.incremental_validate_on_schema_change": {"unique_id": "macro.dbt.incremental_validate_on_schema_change", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "incremental_validate_on_schema_change", "macro_sql": "{% macro incremental_validate_on_schema_change(on_schema_change, default='ignore') %}\n\n {% if on_schema_change not in ['sync_all_columns', 'append_new_columns', 'fail', 'ignore'] %}\n\n {% set log_message = 'Invalid value for on_schema_change (%s) specified. Setting default value of %s.' % (on_schema_change, default) %}\n {% do log(log_message) %}\n\n {{ return(default) }}\n\n {% else %}\n\n {{ return(on_schema_change) }}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.066952, "supported_languages": null}, "macro.dbt.check_for_schema_changes": {"unique_id": "macro.dbt.check_for_schema_changes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "check_for_schema_changes", "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n\n {% set schema_changed = False %}\n\n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n\n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n\n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.diff_columns", "macro.dbt.diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.068183, "supported_languages": null}, "macro.dbt.sync_column_schemas": {"unique_id": "macro.dbt.sync_column_schemas", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "sync_column_schemas", "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n\n {% elif on_schema_change == 'sync_all_columns' %}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n\n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n\n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n\n {% do log(schema_change_message) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.alter_relation_add_remove_columns", "macro.dbt.alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.069373, "supported_languages": null}, "macro.dbt.process_schema_changes": {"unique_id": "macro.dbt.process_schema_changes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "process_schema_changes", "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n\n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n\n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n\n {% if schema_changes_dict['schema_changed'] %}\n\n {% if on_schema_change == 'fail' %}\n\n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways:\n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n\n Additional troubleshooting context:\n Source columns not in target: {{ schema_changes_dict['source_not_in_target'] }}\n Target columns not in source: {{ schema_changes_dict['target_not_in_source'] }}\n New column types: {{ schema_changes_dict['new_target_types'] }}\n {% endset %}\n\n {% do exceptions.raise_compiler_error(fail_msg) %}\n\n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n\n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {% endif %}\n\n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0702279, "supported_languages": null}, "macro.dbt.materialization_table_default": {"unique_id": "macro.dbt.materialization_table_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/table.sql", "original_file_path": "macros/materializations/models/table/table.sql", "name": "materialization_table_default", "macro_sql": "{% materialization table, default %}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do create_indexes(target_relation) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.get_create_table_as_sql", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.072852, "supported_languages": ["sql"]}, "macro.dbt.get_create_table_as_sql": {"unique_id": "macro.dbt.get_create_table_as_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "get_create_table_as_sql", "macro_sql": "{% macro get_create_table_as_sql(temporary, relation, sql) -%}\n {{ adapter.dispatch('get_create_table_as_sql', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_table_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.07342, "supported_languages": null}, "macro.dbt.default__get_create_table_as_sql": {"unique_id": "macro.dbt.default__get_create_table_as_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "default__get_create_table_as_sql", "macro_sql": "{% macro default__get_create_table_as_sql(temporary, relation, sql) -%}\n {{ return(create_table_as(temporary, relation, sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.073607, "supported_languages": null}, "macro.dbt.create_table_as": {"unique_id": "macro.dbt.create_table_as", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {# backward compatibility for create_table_as that does not support language #}\n {% if language == \"sql\" %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code)}}\n {% else %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code, language) }}\n {% endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.074036, "supported_languages": null}, "macro.dbt.default__create_table_as": {"unique_id": "macro.dbt.default__create_table_as", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.074445, "supported_languages": null}, "macro.dbt.materialization_view_default": {"unique_id": "macro.dbt.materialization_view_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/view.sql", "original_file_path": "macros/materializations/models/view/view.sql", "name": "materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='view') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n This relation (probably) doesn't exist yet. If it does exist, it's a leftover from\n a previous run, and we're going to try to drop it immediately. At the end of this\n materialization, we're going to rename the \"existing_relation\" to this identifier,\n and then we're going to drop it. In order to make sure we run the correct one of:\n - drop view ...\n - drop table ...\n\n We need to set the type of this relation to be the type of the existing_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the existing_relation does not\n exist, then there is nothing to move out of the way and subsequentally drop. In that case,\n this relation will be effectively unused.\n */\n {%- set backup_relation_type = 'view' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0770109, "supported_languages": ["sql"]}, "macro.dbt.handle_existing_table": {"unique_id": "macro.dbt.handle_existing_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/helpers.sql", "original_file_path": "macros/materializations/models/view/helpers.sql", "name": "handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.077375, "supported_languages": null}, "macro.dbt.default__handle_existing_table": {"unique_id": "macro.dbt.default__handle_existing_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/helpers.sql", "original_file_path": "macros/materializations/models/view/helpers.sql", "name": "default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0775979, "supported_languages": null}, "macro.dbt.create_or_replace_view": {"unique_id": "macro.dbt.create_or_replace_view", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/models/view/create_or_replace_view.sql", "name": "create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {% set should_revoke = should_revoke(exists_as_view, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=True) %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0791302, "supported_languages": null}, "macro.dbt.get_create_view_as_sql": {"unique_id": "macro.dbt.get_create_view_as_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "get_create_view_as_sql", "macro_sql": "{% macro get_create_view_as_sql(relation, sql) -%}\n {{ adapter.dispatch('get_create_view_as_sql', 'dbt')(relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0795572, "supported_languages": null}, "macro.dbt.default__get_create_view_as_sql": {"unique_id": "macro.dbt.default__get_create_view_as_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "default__get_create_view_as_sql", "macro_sql": "{% macro default__get_create_view_as_sql(relation, sql) -%}\n {{ return(create_view_as(relation, sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0797162, "supported_languages": null}, "macro.dbt.create_view_as": {"unique_id": "macro.dbt.create_view_as", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0799072, "supported_languages": null}, "macro.dbt.default__create_view_as": {"unique_id": "macro.dbt.default__create_view_as", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation }} as (\n {{ sql }}\n );\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0801668, "supported_languages": null}, "macro.dbt.materialization_seed_default": {"unique_id": "macro.dbt.materialization_seed_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/seed.sql", "original_file_path": "macros/materializations/seeds/seed.sql", "name": "materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set grant_config = config.get('grants') -%}\n {%- set agate_table = load_agate_table() -%}\n -- grab current tables grants config for comparision later on\n\n {%- do store_result('agate_table', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation)) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', code ~ ' ' ~ rows_affected, code, rows_affected) %}\n {{ get_csv_sql(create_table_sql, sql) }};\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if full_refresh_mode or not exists_as_table %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.run_hooks", "macro.dbt.reset_csv_table", "macro.dbt.create_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.noop_statement", "macro.dbt.get_csv_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.083461, "supported_languages": ["sql"]}, "macro.dbt.create_csv_table": {"unique_id": "macro.dbt.create_csv_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.088067, "supported_languages": null}, "macro.dbt.default__create_csv_table": {"unique_id": "macro.dbt.default__create_csv_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.088973, "supported_languages": null}, "macro.dbt.reset_csv_table": {"unique_id": "macro.dbt.reset_csv_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table', 'dbt')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.089211, "supported_languages": null}, "macro.dbt.default__reset_csv_table": {"unique_id": "macro.dbt.default__reset_csv_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.089685, "supported_languages": null}, "macro.dbt.get_csv_sql": {"unique_id": "macro.dbt.get_csv_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_csv_sql", "macro_sql": "{% macro get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ adapter.dispatch('get_csv_sql', 'dbt')(create_or_truncate_sql, insert_sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_csv_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.089875, "supported_languages": null}, "macro.dbt.default__get_csv_sql": {"unique_id": "macro.dbt.default__get_csv_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_csv_sql", "macro_sql": "{% macro default__get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ create_or_truncate_sql }};\n -- dbt seed --\n {{ insert_sql }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.090005, "supported_languages": null}, "macro.dbt.get_binding_char": {"unique_id": "macro.dbt.get_binding_char", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_binding_char", "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.090144, "supported_languages": null}, "macro.dbt.default__get_binding_char": {"unique_id": "macro.dbt.default__get_binding_char", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_binding_char", "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.090255, "supported_languages": null}, "macro.dbt.get_batch_size": {"unique_id": "macro.dbt.get_batch_size", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_batch_size", "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_batch_size"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.090414, "supported_languages": null}, "macro.dbt.default__get_batch_size": {"unique_id": "macro.dbt.default__get_batch_size", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_batch_size", "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0905259, "supported_languages": null}, "macro.dbt.get_seed_column_quoted_csv": {"unique_id": "macro.dbt.get_seed_column_quoted_csv", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0909991, "supported_languages": null}, "macro.dbt.load_csv_rows": {"unique_id": "macro.dbt.load_csv_rows", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0911841, "supported_languages": null}, "macro.dbt.default__load_csv_rows": {"unique_id": "macro.dbt.default__load_csv_rows", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n\n {% set batch_size = get_batch_size() %}\n\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.092461, "supported_languages": null}, "macro.dbt.generate_alias_name": {"unique_id": "macro.dbt.generate_alias_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "name": "generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_alias_name', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_alias_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.092959, "supported_languages": null}, "macro.dbt.default__generate_alias_name": {"unique_id": "macro.dbt.default__generate_alias_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "name": "default__generate_alias_name", "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name is none -%}\n\n {{ node.name }}\n\n {%- else -%}\n\n {{ custom_alias_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.093191, "supported_languages": null}, "macro.dbt.generate_schema_name": {"unique_id": "macro.dbt.generate_schema_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name=none, node=none) -%}\n {{ return(adapter.dispatch('generate_schema_name', 'dbt')(custom_schema_name, node)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.093767, "supported_languages": null}, "macro.dbt.default__generate_schema_name": {"unique_id": "macro.dbt.default__generate_schema_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.094024, "supported_languages": null}, "macro.dbt.generate_schema_name_for_env": {"unique_id": "macro.dbt.generate_schema_name_for_env", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.094309, "supported_languages": null}, "macro.dbt.generate_database_name": {"unique_id": "macro.dbt.generate_database_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "name": "generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name', 'dbt')(custom_database_name, node)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0947552, "supported_languages": null}, "macro.dbt.default__generate_database_name": {"unique_id": "macro.dbt.default__generate_database_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "name": "default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.095005, "supported_languages": null}, "macro.dbt.default__test_relationships": {"unique_id": "macro.dbt.default__test_relationships", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/relationships.sql", "original_file_path": "macros/generic_test_sql/relationships.sql", "name": "default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.095413, "supported_languages": null}, "macro.dbt.default__test_not_null": {"unique_id": "macro.dbt.default__test_not_null", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/not_null.sql", "original_file_path": "macros/generic_test_sql/not_null.sql", "name": "default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else column_name %}\n\nselect {{ column_list }}\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.095766, "supported_languages": null}, "macro.dbt.default__test_unique": {"unique_id": "macro.dbt.default__test_unique", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/unique.sql", "original_file_path": "macros/generic_test_sql/unique.sql", "name": "default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0960681, "supported_languages": null}, "macro.dbt.default__test_accepted_values": {"unique_id": "macro.dbt.default__test_accepted_values", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/accepted_values.sql", "original_file_path": "macros/generic_test_sql/accepted_values.sql", "name": "default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by {{ column_name }}\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.096673, "supported_languages": null}, "macro.dbt.statement": {"unique_id": "macro.dbt.statement", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "statement", "macro_sql": "\n{%- macro statement(name=None, fetch_result=False, auto_begin=True, language='sql') -%}\n {%- if execute: -%}\n {%- set compiled_code = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime {} for node \"{}\"'.format(language, model['unique_id'])) }}\n {{ write(compiled_code) }}\n {%- endif -%}\n {%- if language == 'sql'-%}\n {%- set res, table = adapter.execute(compiled_code, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- elif language == 'python' -%}\n {%- set res = submit_python_job(model, compiled_code) -%}\n {#-- TODO: What should table be for python models? --#}\n {%- set table = None -%}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"statement macro didn't get supported language\") %}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.0981781, "supported_languages": null}, "macro.dbt.noop_statement": {"unique_id": "macro.dbt.noop_statement", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.099005, "supported_languages": null}, "macro.dbt.run_query": {"unique_id": "macro.dbt.run_query", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.099298, "supported_languages": null}, "macro.dbt.convert_datetime": {"unique_id": "macro.dbt.convert_datetime", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "convert_datetime", "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.101067, "supported_languages": null}, "macro.dbt.dates_in_range": {"unique_id": "macro.dbt.dates_in_range", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "dates_in_range", "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n Partiton start date is after the end date ({{ start_date }}, {{ end_date }})\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg, model) }}\n {% endif %}\n\n {% set date_list = [] %}\n {% for i in range(0, day_count + 1) %}\n {% set the_date = (modules.datetime.timedelta(days=i) + start_date) %}\n {% if not out_fmt %}\n {% set _ = date_list.append(the_date) %}\n {% else %}\n {% set _ = date_list.append(the_date.strftime(out_fmt)) %}\n {% endif %}\n {% endfor %}\n\n {{ return(date_list) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1022441, "supported_languages": null}, "macro.dbt.partition_range": {"unique_id": "macro.dbt.partition_range", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "partition_range", "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.102987, "supported_languages": null}, "macro.dbt.py_current_timestring": {"unique_id": "macro.dbt.py_current_timestring", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "py_current_timestring", "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.103219, "supported_languages": null}, "macro.dbt.except": {"unique_id": "macro.dbt.except", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "name": "except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1035311, "supported_languages": null}, "macro.dbt.default__except": {"unique_id": "macro.dbt.default__except", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "name": "default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.103606, "supported_languages": null}, "macro.dbt.replace": {"unique_id": "macro.dbt.replace", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "name": "replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt') (field, old_chars, new_chars)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.103992, "supported_languages": null}, "macro.dbt.default__replace": {"unique_id": "macro.dbt.default__replace", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "name": "default__replace", "macro_sql": "{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.104156, "supported_languages": null}, "macro.dbt.concat": {"unique_id": "macro.dbt.concat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "name": "concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt')(fields)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.104463, "supported_languages": null}, "macro.dbt.default__concat": {"unique_id": "macro.dbt.default__concat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "name": "default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n {{ fields|join(' || ') }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.104588, "supported_languages": null}, "macro.dbt.length": {"unique_id": "macro.dbt.length", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "name": "length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__length"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.104896, "supported_languages": null}, "macro.dbt.default__length": {"unique_id": "macro.dbt.default__length", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "name": "default__length", "macro_sql": "{% macro default__length(expression) %}\n\n length(\n {{ expression }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.105003, "supported_languages": null}, "macro.dbt.dateadd": {"unique_id": "macro.dbt.dateadd", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "name": "dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1053922, "supported_languages": null}, "macro.dbt.default__dateadd": {"unique_id": "macro.dbt.default__dateadd", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "name": "default__dateadd", "macro_sql": "{% macro default__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_date_or_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.105552, "supported_languages": null}, "macro.dbt.intersect": {"unique_id": "macro.dbt.intersect", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "name": "intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__intersect"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.105834, "supported_languages": null}, "macro.dbt.default__intersect": {"unique_id": "macro.dbt.default__intersect", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "name": "default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.105912, "supported_languages": null}, "macro.dbt.escape_single_quotes": {"unique_id": "macro.dbt.escape_single_quotes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "name": "escape_single_quotes", "macro_sql": "{% macro escape_single_quotes(expression) %}\n {{ return(adapter.dispatch('escape_single_quotes', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__escape_single_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.106264, "supported_languages": null}, "macro.dbt.default__escape_single_quotes": {"unique_id": "macro.dbt.default__escape_single_quotes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "name": "default__escape_single_quotes", "macro_sql": "{% macro default__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\",\"''\") }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.106403, "supported_languages": null}, "macro.dbt.right": {"unique_id": "macro.dbt.right", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "name": "right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt') (string_text, length_expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__right"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.106755, "supported_languages": null}, "macro.dbt.default__right": {"unique_id": "macro.dbt.default__right", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "name": "default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.10697, "supported_languages": null}, "macro.dbt.listagg": {"unique_id": "macro.dbt.listagg", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "name": "listagg", "macro_sql": "{% macro listagg(measure, delimiter_text=\"','\", order_by_clause=none, limit_num=none) -%}\n {{ return(adapter.dispatch('listagg', 'dbt') (measure, delimiter_text, order_by_clause, limit_num)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__listagg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1076438, "supported_languages": null}, "macro.dbt.default__listagg": {"unique_id": "macro.dbt.default__listagg", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "name": "default__listagg", "macro_sql": "{% macro default__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n array_slice(\n array_agg(\n {{ measure }}\n ){% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n ,0\n ,{{ limit_num }}\n ),\n {{ delimiter_text }}\n )\n {%- else %}\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1080441, "supported_languages": null}, "macro.dbt.datediff": {"unique_id": "macro.dbt.datediff", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "name": "datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt')(first_date, second_date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1084318, "supported_languages": null}, "macro.dbt.default__datediff": {"unique_id": "macro.dbt.default__datediff", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "name": "default__datediff", "macro_sql": "{% macro default__datediff(first_date, second_date, datepart) -%}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.108594, "supported_languages": null}, "macro.dbt.safe_cast": {"unique_id": "macro.dbt.safe_cast", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "name": "safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt') (field, type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.108938, "supported_languages": null}, "macro.dbt.default__safe_cast": {"unique_id": "macro.dbt.default__safe_cast", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "name": "default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1090748, "supported_languages": null}, "macro.dbt.hash": {"unique_id": "macro.dbt.hash", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "name": "hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt') (field)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.109387, "supported_languages": null}, "macro.dbt.default__hash": {"unique_id": "macro.dbt.default__hash", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "name": "default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{ field }} as {{ api.Column.translate_type('string') }}))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.109544, "supported_languages": null}, "macro.dbt.cast_bool_to_text": {"unique_id": "macro.dbt.cast_bool_to_text", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "name": "cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', 'dbt') (field) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.109851, "supported_languages": null}, "macro.dbt.default__cast_bool_to_text": {"unique_id": "macro.dbt.default__cast_bool_to_text", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "name": "default__cast_bool_to_text", "macro_sql": "{% macro default__cast_bool_to_text(field) %}\n cast({{ field }} as {{ api.Column.translate_type('string') }})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.110018, "supported_languages": null}, "macro.dbt.any_value": {"unique_id": "macro.dbt.any_value", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "name": "any_value", "macro_sql": "{% macro any_value(expression) -%}\n {{ return(adapter.dispatch('any_value', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__any_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.11034, "supported_languages": null}, "macro.dbt.default__any_value": {"unique_id": "macro.dbt.default__any_value", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "name": "default__any_value", "macro_sql": "{% macro default__any_value(expression) -%}\n\n any_value({{ expression }})\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1104488, "supported_languages": null}, "macro.dbt.position": {"unique_id": "macro.dbt.position", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "name": "position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt') (substring_text, string_text)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__position"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1107981, "supported_languages": null}, "macro.dbt.default__position": {"unique_id": "macro.dbt.default__position", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "name": "default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.110938, "supported_languages": null}, "macro.dbt.string_literal": {"unique_id": "macro.dbt.string_literal", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "name": "string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt') (value)) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1112409, "supported_languages": null}, "macro.dbt.default__string_literal": {"unique_id": "macro.dbt.default__string_literal", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "name": "default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1113422, "supported_languages": null}, "macro.dbt.type_string": {"unique_id": "macro.dbt.type_string", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.112293, "supported_languages": null}, "macro.dbt.default__type_string": {"unique_id": "macro.dbt.default__type_string", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_string", "macro_sql": "{% macro default__type_string() %}\n {{ return(api.Column.translate_type(\"string\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.112458, "supported_languages": null}, "macro.dbt.type_timestamp": {"unique_id": "macro.dbt.type_timestamp", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.112695, "supported_languages": null}, "macro.dbt.default__type_timestamp": {"unique_id": "macro.dbt.default__type_timestamp", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n {{ return(api.Column.translate_type(\"timestamp\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.112849, "supported_languages": null}, "macro.dbt.type_float": {"unique_id": "macro.dbt.type_float", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.113012, "supported_languages": null}, "macro.dbt.default__type_float": {"unique_id": "macro.dbt.default__type_float", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_float", "macro_sql": "{% macro default__type_float() %}\n {{ return(api.Column.translate_type(\"float\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.113162, "supported_languages": null}, "macro.dbt.type_numeric": {"unique_id": "macro.dbt.type_numeric", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.113321, "supported_languages": null}, "macro.dbt.default__type_numeric": {"unique_id": "macro.dbt.default__type_numeric", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n {{ return(api.Column.numeric_type(\"numeric\", 28, 6)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.113497, "supported_languages": null}, "macro.dbt.type_bigint": {"unique_id": "macro.dbt.type_bigint", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.113656, "supported_languages": null}, "macro.dbt.default__type_bigint": {"unique_id": "macro.dbt.default__type_bigint", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n {{ return(api.Column.translate_type(\"bigint\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.113806, "supported_languages": null}, "macro.dbt.type_int": {"unique_id": "macro.dbt.type_int", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.113974, "supported_languages": null}, "macro.dbt.default__type_int": {"unique_id": "macro.dbt.default__type_int", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_int", "macro_sql": "{%- macro default__type_int() -%}\n {{ return(api.Column.translate_type(\"integer\")) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1141179, "supported_languages": null}, "macro.dbt.type_boolean": {"unique_id": "macro.dbt.type_boolean", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_boolean", "macro_sql": "\n\n{%- macro type_boolean() -%}\n {{ return(adapter.dispatch('type_boolean', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_boolean"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1142762, "supported_languages": null}, "macro.dbt.default__type_boolean": {"unique_id": "macro.dbt.default__type_boolean", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_boolean", "macro_sql": "{%- macro default__type_boolean() -%}\n {{ return(api.Column.translate_type(\"boolean\")) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.114421, "supported_languages": null}, "macro.dbt.array_concat": {"unique_id": "macro.dbt.array_concat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "name": "array_concat", "macro_sql": "{% macro array_concat(array_1, array_2) -%}\n {{ return(adapter.dispatch('array_concat', 'dbt')(array_1, array_2)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__array_concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.114771, "supported_languages": null}, "macro.dbt.default__array_concat": {"unique_id": "macro.dbt.default__array_concat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "name": "default__array_concat", "macro_sql": "{% macro default__array_concat(array_1, array_2) -%}\n array_cat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.114905, "supported_languages": null}, "macro.dbt.bool_or": {"unique_id": "macro.dbt.bool_or", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "name": "bool_or", "macro_sql": "{% macro bool_or(expression) -%}\n {{ return(adapter.dispatch('bool_or', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__bool_or"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.115211, "supported_languages": null}, "macro.dbt.default__bool_or": {"unique_id": "macro.dbt.default__bool_or", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "name": "default__bool_or", "macro_sql": "{% macro default__bool_or(expression) -%}\n\n bool_or({{ expression }})\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.115315, "supported_languages": null}, "macro.dbt.last_day": {"unique_id": "macro.dbt.last_day", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "name": "last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt') (date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.115701, "supported_languages": null}, "macro.dbt.default_last_day": {"unique_id": "macro.dbt.default_last_day", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "name": "default_last_day", "macro_sql": "\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd(datepart, '1', dbt.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.115971, "supported_languages": null}, "macro.dbt.default__last_day": {"unique_id": "macro.dbt.default__last_day", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "name": "default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt.default_last_day(date, datepart)}}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1161191, "supported_languages": null}, "macro.dbt.split_part": {"unique_id": "macro.dbt.split_part", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "name": "split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ return(adapter.dispatch('split_part', 'dbt') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.11668, "supported_languages": null}, "macro.dbt.default__split_part": {"unique_id": "macro.dbt.default__split_part", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "name": "default__split_part", "macro_sql": "{% macro default__split_part(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n {{ part_number }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.116841, "supported_languages": null}, "macro.dbt._split_part_negative": {"unique_id": "macro.dbt._split_part_negative", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "name": "_split_part_negative", "macro_sql": "{% macro _split_part_negative(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n length({{ string_text }})\n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 2 {{ part_number }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.117135, "supported_languages": null}, "macro.dbt.date_trunc": {"unique_id": "macro.dbt.date_trunc", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "name": "date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt') (datepart, date)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.117465, "supported_languages": null}, "macro.dbt.default__date_trunc": {"unique_id": "macro.dbt.default__date_trunc", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "name": "default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) -%}\n date_trunc('{{datepart}}', {{date}})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.117596, "supported_languages": null}, "macro.dbt.array_construct": {"unique_id": "macro.dbt.array_construct", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "name": "array_construct", "macro_sql": "{% macro array_construct(inputs=[], data_type=api.Column.translate_type('integer')) -%}\n {{ return(adapter.dispatch('array_construct', 'dbt')(inputs, data_type)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__array_construct"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.118021, "supported_languages": null}, "macro.dbt.default__array_construct": {"unique_id": "macro.dbt.default__array_construct", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "name": "default__array_construct", "macro_sql": "{% macro default__array_construct(inputs, data_type) -%}\n {% if inputs|length > 0 %}\n array[ {{ inputs|join(' , ') }} ]\n {% else %}\n array[]::{{data_type}}[]\n {% endif %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1182709, "supported_languages": null}, "macro.dbt.array_append": {"unique_id": "macro.dbt.array_append", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "name": "array_append", "macro_sql": "{% macro array_append(array, new_element) -%}\n {{ return(adapter.dispatch('array_append', 'dbt')(array, new_element)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__array_append"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.11861, "supported_languages": null}, "macro.dbt.default__array_append": {"unique_id": "macro.dbt.default__array_append", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "name": "default__array_append", "macro_sql": "{% macro default__array_append(array, new_element) -%}\n array_append({{ array }}, {{ new_element }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.118743, "supported_languages": null}, "macro.dbt.create_schema": {"unique_id": "macro.dbt.create_schema", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema', 'dbt')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.119167, "supported_languages": null}, "macro.dbt.default__create_schema": {"unique_id": "macro.dbt.default__create_schema", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.11935, "supported_languages": null}, "macro.dbt.drop_schema": {"unique_id": "macro.dbt.drop_schema", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.119512, "supported_languages": null}, "macro.dbt.default__drop_schema": {"unique_id": "macro.dbt.default__drop_schema", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.119694, "supported_languages": null}, "macro.dbt.current_timestamp": {"unique_id": "macro.dbt.current_timestamp", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "current_timestamp", "macro_sql": "{%- macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.12021, "supported_languages": null}, "macro.dbt.default__current_timestamp": {"unique_id": "macro.dbt.default__current_timestamp", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter ' + adapter.type()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.120359, "supported_languages": null}, "macro.dbt.snapshot_get_time": {"unique_id": "macro.dbt.snapshot_get_time", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "snapshot_get_time", "macro_sql": "\n\n{%- macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.120497, "supported_languages": null}, "macro.dbt.default__snapshot_get_time": {"unique_id": "macro.dbt.default__snapshot_get_time", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() %}\n {{ current_timestamp() }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.120598, "supported_languages": null}, "macro.dbt.current_timestamp_backcompat": {"unique_id": "macro.dbt.current_timestamp_backcompat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "current_timestamp_backcompat", "macro_sql": "{% macro current_timestamp_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.120766, "supported_languages": null}, "macro.dbt.default__current_timestamp_backcompat": {"unique_id": "macro.dbt.default__current_timestamp_backcompat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "default__current_timestamp_backcompat", "macro_sql": "{% macro default__current_timestamp_backcompat() %}\n current_timestamp::timestamp\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.120842, "supported_languages": null}, "macro.dbt.current_timestamp_in_utc_backcompat": {"unique_id": "macro.dbt.current_timestamp_in_utc_backcompat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "current_timestamp_in_utc_backcompat", "macro_sql": "{% macro current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_in_utc_backcompat', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__current_timestamp_in_utc_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1210098, "supported_languages": null}, "macro.dbt.default__current_timestamp_in_utc_backcompat": {"unique_id": "macro.dbt.default__current_timestamp_in_utc_backcompat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "default__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro default__current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt_bigquery.bigquery__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.121172, "supported_languages": null}, "macro.dbt.get_create_index_sql": {"unique_id": "macro.dbt.get_create_index_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.121669, "supported_languages": null}, "macro.dbt.default__get_create_index_sql": {"unique_id": "macro.dbt.default__get_create_index_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.121871, "supported_languages": null}, "macro.dbt.create_indexes": {"unique_id": "macro.dbt.create_indexes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes', 'dbt')(relation) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.122029, "supported_languages": null}, "macro.dbt.default__create_indexes": {"unique_id": "macro.dbt.default__create_indexes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.122426, "supported_languages": null}, "macro.dbt.make_intermediate_relation": {"unique_id": "macro.dbt.make_intermediate_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "make_intermediate_relation", "macro_sql": "{% macro make_intermediate_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_intermediate_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_intermediate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.125529, "supported_languages": null}, "macro.dbt.default__make_intermediate_relation": {"unique_id": "macro.dbt.default__make_intermediate_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__make_intermediate_relation", "macro_sql": "{% macro default__make_intermediate_relation(base_relation, suffix) %}\n {{ return(default__make_temp_relation(base_relation, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.125699, "supported_languages": null}, "macro.dbt.make_temp_relation": {"unique_id": "macro.dbt.make_temp_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.125918, "supported_languages": null}, "macro.dbt.default__make_temp_relation": {"unique_id": "macro.dbt.default__make_temp_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {%- set temp_identifier = base_relation.identifier ~ suffix -%}\n {%- set temp_relation = base_relation.incorporate(\n path={\"identifier\": temp_identifier}) -%}\n\n {{ return(temp_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.126215, "supported_languages": null}, "macro.dbt.make_backup_relation": {"unique_id": "macro.dbt.make_backup_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "make_backup_relation", "macro_sql": "{% macro make_backup_relation(base_relation, backup_relation_type, suffix='__dbt_backup') %}\n {{ return(adapter.dispatch('make_backup_relation', 'dbt')(base_relation, backup_relation_type, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_backup_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.126464, "supported_languages": null}, "macro.dbt.default__make_backup_relation": {"unique_id": "macro.dbt.default__make_backup_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__make_backup_relation", "macro_sql": "{% macro default__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {%- set backup_identifier = base_relation.identifier ~ suffix -%}\n {%- set backup_relation = base_relation.incorporate(\n path={\"identifier\": backup_identifier},\n type=backup_relation_type\n ) -%}\n {{ return(backup_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1267982, "supported_languages": null}, "macro.dbt.drop_relation": {"unique_id": "macro.dbt.drop_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.126982, "supported_languages": null}, "macro.dbt.default__drop_relation": {"unique_id": "macro.dbt.default__drop_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__drop_relation", "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.127193, "supported_languages": null}, "macro.dbt.truncate_relation": {"unique_id": "macro.dbt.truncate_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1273768, "supported_languages": null}, "macro.dbt.default__truncate_relation": {"unique_id": "macro.dbt.default__truncate_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.127535, "supported_languages": null}, "macro.dbt.rename_relation": {"unique_id": "macro.dbt.rename_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.127754, "supported_languages": null}, "macro.dbt.default__rename_relation": {"unique_id": "macro.dbt.default__rename_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.128028, "supported_languages": null}, "macro.dbt.get_or_create_relation": {"unique_id": "macro.dbt.get_or_create_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) -%}\n {{ return(adapter.dispatch('get_or_create_relation', 'dbt')(database, schema, identifier, type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_or_create_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.128281, "supported_languages": null}, "macro.dbt.default__get_or_create_relation": {"unique_id": "macro.dbt.default__get_or_create_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__get_or_create_relation", "macro_sql": "{% macro default__get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.12884, "supported_languages": null}, "macro.dbt.load_cached_relation": {"unique_id": "macro.dbt.load_cached_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "load_cached_relation", "macro_sql": "{% macro load_cached_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1291342, "supported_languages": null}, "macro.dbt.load_relation": {"unique_id": "macro.dbt.load_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {{ return(load_cached_relation(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.129277, "supported_languages": null}, "macro.dbt.drop_relation_if_exists": {"unique_id": "macro.dbt.drop_relation_if_exists", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1294699, "supported_languages": null}, "macro.dbt.collect_freshness": {"unique_id": "macro.dbt.collect_freshness", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness', 'dbt')(source, loaded_at_field, filter))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1299992, "supported_languages": null}, "macro.dbt.default__collect_freshness": {"unique_id": "macro.dbt.default__collect_freshness", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.130422, "supported_languages": null}, "macro.dbt.copy_grants": {"unique_id": "macro.dbt.copy_grants", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "copy_grants", "macro_sql": "{% macro copy_grants() %}\n {{ return(adapter.dispatch('copy_grants', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.132066, "supported_languages": null}, "macro.dbt.default__copy_grants": {"unique_id": "macro.dbt.default__copy_grants", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__copy_grants", "macro_sql": "{% macro default__copy_grants() %}\n {{ return(True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.132181, "supported_languages": null}, "macro.dbt.support_multiple_grantees_per_dcl_statement": {"unique_id": "macro.dbt.support_multiple_grantees_per_dcl_statement", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "support_multiple_grantees_per_dcl_statement", "macro_sql": "{% macro support_multiple_grantees_per_dcl_statement() %}\n {{ return(adapter.dispatch('support_multiple_grantees_per_dcl_statement', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.13235, "supported_languages": null}, "macro.dbt.default__support_multiple_grantees_per_dcl_statement": {"unique_id": "macro.dbt.default__support_multiple_grantees_per_dcl_statement", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__support_multiple_grantees_per_dcl_statement", "macro_sql": "\n\n{%- macro default__support_multiple_grantees_per_dcl_statement() -%}\n {{ return(True) }}\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.13246, "supported_languages": null}, "macro.dbt.should_revoke": {"unique_id": "macro.dbt.should_revoke", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "should_revoke", "macro_sql": "{% macro should_revoke(existing_relation, full_refresh_mode=True) %}\n\n {% if not existing_relation %}\n {#-- The table doesn't already exist, so no grants to copy over --#}\n {{ return(False) }}\n {% elif full_refresh_mode %}\n {#-- The object is being REPLACED -- whether grants are copied over depends on the value of user config --#}\n {{ return(copy_grants()) }}\n {% else %}\n {#-- The table is being merged/upserted/inserted -- grants will be carried over --#}\n {{ return(True) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1328099, "supported_languages": null}, "macro.dbt.get_show_grant_sql": {"unique_id": "macro.dbt.get_show_grant_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_show_grant_sql", "macro_sql": "{% macro get_show_grant_sql(relation) %}\n {{ return(adapter.dispatch(\"get_show_grant_sql\", \"dbt\")(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_show_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.132997, "supported_languages": null}, "macro.dbt.default__get_show_grant_sql": {"unique_id": "macro.dbt.default__get_show_grant_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_show_grant_sql", "macro_sql": "{% macro default__get_show_grant_sql(relation) %}\n show grants on {{ relation }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.133096, "supported_languages": null}, "macro.dbt.get_grant_sql": {"unique_id": "macro.dbt.get_grant_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_grant_sql", "macro_sql": "{% macro get_grant_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_grant_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.133316, "supported_languages": null}, "macro.dbt.default__get_grant_sql": {"unique_id": "macro.dbt.default__get_grant_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_grant_sql", "macro_sql": "\n\n{%- macro default__get_grant_sql(relation, privilege, grantees) -%}\n grant {{ privilege }} on {{ relation }} to {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.133504, "supported_languages": null}, "macro.dbt.get_revoke_sql": {"unique_id": "macro.dbt.get_revoke_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_revoke_sql", "macro_sql": "{% macro get_revoke_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_revoke_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_revoke_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.133727, "supported_languages": null}, "macro.dbt.default__get_revoke_sql": {"unique_id": "macro.dbt.default__get_revoke_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_revoke_sql", "macro_sql": "\n\n{%- macro default__get_revoke_sql(relation, privilege, grantees) -%}\n revoke {{ privilege }} on {{ relation }} from {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.133914, "supported_languages": null}, "macro.dbt.get_dcl_statement_list": {"unique_id": "macro.dbt.get_dcl_statement_list", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_dcl_statement_list", "macro_sql": "{% macro get_dcl_statement_list(relation, grant_config, get_dcl_macro) %}\n {{ return(adapter.dispatch('get_dcl_statement_list', 'dbt')(relation, grant_config, get_dcl_macro)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_dcl_statement_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1341372, "supported_languages": null}, "macro.dbt.default__get_dcl_statement_list": {"unique_id": "macro.dbt.default__get_dcl_statement_list", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_dcl_statement_list", "macro_sql": "\n\n{%- macro default__get_dcl_statement_list(relation, grant_config, get_dcl_macro) -%}\n {#\n -- Unpack grant_config into specific privileges and the set of users who need them granted/revoked.\n -- Depending on whether this database supports multiple grantees per statement, pass in the list of\n -- all grantees per privilege, or (if not) template one statement per privilege-grantee pair.\n -- `get_dcl_macro` will be either `get_grant_sql` or `get_revoke_sql`\n #}\n {%- set dcl_statements = [] -%}\n {%- for privilege, grantees in grant_config.items() %}\n {%- if support_multiple_grantees_per_dcl_statement() and grantees -%}\n {%- set dcl = get_dcl_macro(relation, privilege, grantees) -%}\n {%- do dcl_statements.append(dcl) -%}\n {%- else -%}\n {%- for grantee in grantees -%}\n {% set dcl = get_dcl_macro(relation, privilege, [grantee]) %}\n {%- do dcl_statements.append(dcl) -%}\n {% endfor -%}\n {%- endif -%}\n {%- endfor -%}\n {{ return(dcl_statements) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.134822, "supported_languages": null}, "macro.dbt.call_dcl_statements": {"unique_id": "macro.dbt.call_dcl_statements", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "call_dcl_statements", "macro_sql": "{% macro call_dcl_statements(dcl_statement_list) %}\n {{ return(adapter.dispatch(\"call_dcl_statements\", \"dbt\")(dcl_statement_list)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.135085, "supported_languages": null}, "macro.dbt.default__call_dcl_statements": {"unique_id": "macro.dbt.default__call_dcl_statements", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__call_dcl_statements", "macro_sql": "{% macro default__call_dcl_statements(dcl_statement_list) %}\n {#\n -- By default, supply all grant + revoke statements in a single semicolon-separated block,\n -- so that they're all processed together.\n\n -- Some databases do not support this. Those adapters will need to override this macro\n -- to run each statement individually.\n #}\n {% call statement('grants') %}\n {% for dcl_statement in dcl_statement_list %}\n {{ dcl_statement }};\n {% endfor %}\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.135329, "supported_languages": null}, "macro.dbt.apply_grants": {"unique_id": "macro.dbt.apply_grants", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "apply_grants", "macro_sql": "{% macro apply_grants(relation, grant_config, should_revoke) %}\n {{ return(adapter.dispatch(\"apply_grants\", \"dbt\")(relation, grant_config, should_revoke)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1355588, "supported_languages": null}, "macro.dbt.default__apply_grants": {"unique_id": "macro.dbt.default__apply_grants", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__apply_grants", "macro_sql": "{% macro default__apply_grants(relation, grant_config, should_revoke=True) %}\n {#-- If grant_config is {} or None, this is a no-op --#}\n {% if grant_config %}\n {% if should_revoke %}\n {#-- We think previous grants may have carried over --#}\n {#-- Show current grants and calculate diffs --#}\n {% set current_grants_table = run_query(get_show_grant_sql(relation)) %}\n {% set current_grants_dict = adapter.standardize_grants_dict(current_grants_table) %}\n {% set needs_granting = diff_of_two_dicts(grant_config, current_grants_dict) %}\n {% set needs_revoking = diff_of_two_dicts(current_grants_dict, grant_config) %}\n {% if not (needs_granting or needs_revoking) %}\n {{ log('On ' ~ relation ~': All grants are in place, no revocation or granting needed.')}}\n {% endif %}\n {% else %}\n {#-- We don't think there's any chance of previous grants having carried over. --#}\n {#-- Jump straight to granting what the user has configured. --#}\n {% set needs_revoking = {} %}\n {% set needs_granting = grant_config %}\n {% endif %}\n {% if needs_granting or needs_revoking %}\n {% set revoke_statement_list = get_dcl_statement_list(relation, needs_revoking, get_revoke_sql) %}\n {% set grant_statement_list = get_dcl_statement_list(relation, needs_granting, get_grant_sql) %}\n {% set dcl_statement_list = revoke_statement_list + grant_statement_list %}\n {% if dcl_statement_list %}\n {{ call_dcl_statements(dcl_statement_list) }}\n {% endif %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_grant_sql", "macro.dbt.get_dcl_statement_list", "macro.dbt.call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.136693, "supported_languages": null}, "macro.dbt.alter_column_comment": {"unique_id": "macro.dbt.alter_column_comment", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment', 'dbt')(relation, column_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.137441, "supported_languages": null}, "macro.dbt.default__alter_column_comment": {"unique_id": "macro.dbt.default__alter_column_comment", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.137613, "supported_languages": null}, "macro.dbt.alter_relation_comment": {"unique_id": "macro.dbt.alter_relation_comment", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment', 'dbt')(relation, relation_comment)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1378188, "supported_languages": null}, "macro.dbt.default__alter_relation_comment": {"unique_id": "macro.dbt.default__alter_relation_comment", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.137985, "supported_languages": null}, "macro.dbt.persist_docs": {"unique_id": "macro.dbt.persist_docs", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs', 'dbt')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1382499, "supported_languages": null}, "macro.dbt.default__persist_docs": {"unique_id": "macro.dbt.default__persist_docs", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do run_query(alter_column_comment(relation, model.columns)) %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.138732, "supported_languages": null}, "macro.dbt.get_catalog": {"unique_id": "macro.dbt.get_catalog", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.140179, "supported_languages": null}, "macro.dbt.default__get_catalog": {"unique_id": "macro.dbt.default__get_catalog", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1404421, "supported_languages": null}, "macro.dbt.information_schema_name": {"unique_id": "macro.dbt.information_schema_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.140627, "supported_languages": null}, "macro.dbt.default__information_schema_name": {"unique_id": "macro.dbt.default__information_schema_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.140784, "supported_languages": null}, "macro.dbt.list_schemas": {"unique_id": "macro.dbt.list_schemas", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.14096, "supported_languages": null}, "macro.dbt.default__list_schemas": {"unique_id": "macro.dbt.default__list_schemas", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1412039, "supported_languages": null}, "macro.dbt.check_schema_exists": {"unique_id": "macro.dbt.check_schema_exists", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists', 'dbt')(information_schema, schema)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.141411, "supported_languages": null}, "macro.dbt.default__check_schema_exists": {"unique_id": "macro.dbt.default__check_schema_exists", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.141707, "supported_languages": null}, "macro.dbt.list_relations_without_caching": {"unique_id": "macro.dbt.list_relations_without_caching", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1418948, "supported_languages": null}, "macro.dbt.default__list_relations_without_caching": {"unique_id": "macro.dbt.default__list_relations_without_caching", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.142058, "supported_languages": null}, "macro.dbt.get_columns_in_relation": {"unique_id": "macro.dbt.get_columns_in_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1437042, "supported_languages": null}, "macro.dbt.default__get_columns_in_relation": {"unique_id": "macro.dbt.default__get_columns_in_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1439412, "supported_languages": null}, "macro.dbt.sql_convert_columns_in_relation": {"unique_id": "macro.dbt.sql_convert_columns_in_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.144257, "supported_languages": null}, "macro.dbt.get_columns_in_query": {"unique_id": "macro.dbt.get_columns_in_query", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1444402, "supported_languages": null}, "macro.dbt.default__get_columns_in_query": {"unique_id": "macro.dbt.default__get_columns_in_query", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.14478, "supported_languages": null}, "macro.dbt.alter_column_type": {"unique_id": "macro.dbt.alter_column_type", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type', 'dbt')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1450171, "supported_languages": null}, "macro.dbt.default__alter_column_type": {"unique_id": "macro.dbt.default__alter_column_type", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.145612, "supported_languages": null}, "macro.dbt.alter_relation_add_remove_columns": {"unique_id": "macro.dbt.alter_relation_add_remove_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "alter_relation_add_remove_columns", "macro_sql": "{% macro alter_relation_add_remove_columns(relation, add_columns = none, remove_columns = none) -%}\n {{ return(adapter.dispatch('alter_relation_add_remove_columns', 'dbt')(relation, add_columns, remove_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__alter_relation_add_remove_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1458712, "supported_languages": null}, "macro.dbt.default__alter_relation_add_remove_columns": {"unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__alter_relation_add_remove_columns", "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation }}\n\n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n\n {% for column in remove_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.14665, "supported_languages": null}, "macro.dbt.build_ref_function": {"unique_id": "macro.dbt.build_ref_function", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "build_ref_function", "macro_sql": "{% macro build_ref_function(model) %}\n\n {%- set ref_dict = {} -%}\n {%- for _ref in model.refs -%}\n {%- set resolved = ref(*_ref) -%}\n {%- do ref_dict.update({_ref | join(\".\"): resolved.quote(database=False, schema=False, identifier=False) | string}) -%}\n {%- endfor -%}\n\ndef ref(*args,dbt_load_df_function):\n refs = {{ ref_dict | tojson }}\n key = \".\".join(args)\n return dbt_load_df_function(refs[key])\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1481369, "supported_languages": null}, "macro.dbt.build_source_function": {"unique_id": "macro.dbt.build_source_function", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "build_source_function", "macro_sql": "{% macro build_source_function(model) %}\n\n {%- set source_dict = {} -%}\n {%- for _source in model.sources -%}\n {%- set resolved = source(*_source) -%}\n {%- do source_dict.update({_source | join(\".\"): resolved.quote(database=False, schema=False, identifier=False) | string}) -%}\n {%- endfor -%}\n\ndef source(*args, dbt_load_df_function):\n sources = {{ source_dict | tojson }}\n key = \".\".join(args)\n return dbt_load_df_function(sources[key])\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.148617, "supported_languages": null}, "macro.dbt.build_config_dict": {"unique_id": "macro.dbt.build_config_dict", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "build_config_dict", "macro_sql": "{% macro build_config_dict(model) %}\n {%- set config_dict = {} -%}\n {%- for key in model.config.config_keys_used -%}\n {# weird type testing with enum, would be much easier to write this logic in Python! #}\n {%- if key == 'language' -%}\n {%- set value = 'python' -%}\n {%- endif -%}\n {%- set value = model.config[key] -%}\n {%- do config_dict.update({key: value}) -%}\n {%- endfor -%}\nconfig_dict = {{ config_dict }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1490712, "supported_languages": null}, "macro.dbt.py_script_postfix": {"unique_id": "macro.dbt.py_script_postfix", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "py_script_postfix", "macro_sql": "{% macro py_script_postfix(model) %}\n# This part is user provided model code\n# you will need to copy the next section to run the code\n# COMMAND ----------\n# this part is dbt logic for get ref work, do not modify\n\n{{ build_ref_function(model ) }}\n{{ build_source_function(model ) }}\n{{ build_config_dict(model) }}\n\nclass config:\n def __init__(self, *args, **kwargs):\n pass\n\n @staticmethod\n def get(key, default=None):\n return config_dict.get(key, default)\n\nclass this:\n \"\"\"dbt.this() or dbt.this.identifier\"\"\"\n database = '{{ this.database }}'\n schema = '{{ this.schema }}'\n identifier = '{{ this.identifier }}'\n def __repr__(self):\n return '{{ this }}'\n\n\nclass dbtObj:\n def __init__(self, load_df_function) -> None:\n self.source = lambda *args: source(*args, dbt_load_df_function=load_df_function)\n self.ref = lambda *args: ref(*args, dbt_load_df_function=load_df_function)\n self.config = config\n self.this = this()\n self.is_incremental = {{ is_incremental() }}\n\n# COMMAND ----------\n{{py_script_comment()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.build_ref_function", "macro.dbt.build_source_function", "macro.dbt.build_config_dict", "macro.dbt.is_incremental", "macro.dbt.py_script_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1494799, "supported_languages": null}, "macro.dbt.py_script_comment": {"unique_id": "macro.dbt.py_script_comment", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "py_script_comment", "macro_sql": "{%macro py_script_comment()%}\n{%endmacro%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.149552, "supported_languages": null}, "macro.dbt.test_unique": {"unique_id": "macro.dbt.test_unique", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1501281, "supported_languages": null}, "macro.dbt.test_not_null": {"unique_id": "macro.dbt.test_not_null", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.150362, "supported_languages": null}, "macro.dbt.test_accepted_values": {"unique_id": "macro.dbt.test_accepted_values", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values', 'dbt') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.150649, "supported_languages": null}, "macro.dbt.test_relationships": {"unique_id": "macro.dbt.test_relationships", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships', 'dbt') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.150931, "supported_languages": null}, "macro.dbt_utils.xdb_deprecation_warning_without_replacement": {"unique_id": "macro.dbt_utils.xdb_deprecation_warning_without_replacement", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/deprecated/xdb_deprecation_warning.sql", "original_file_path": "macros/cross_db_utils/deprecated/xdb_deprecation_warning.sql", "name": "xdb_deprecation_warning_without_replacement", "macro_sql": "{% macro xdb_deprecation_warning_without_replacement(macro, package, model) %}\n {%- set error_message = \"Warning: the `\" ~ macro ~\"` macro is deprecated and will be removed in a future version of the package, once equivalent functionality is implemented in dbt Core. The \" ~ package ~ \".\" ~ model ~ \" model triggered this warning.\" -%}\n {%- do exceptions.warn(error_message) -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.151318, "supported_languages": null}, "macro.dbt_utils.get_url_host": {"unique_id": "macro.dbt_utils.get_url_host", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "name": "get_url_host", "macro_sql": "{% macro get_url_host(field) -%}\n {{ return(adapter.dispatch('get_url_host', 'dbt_utils')(field)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_host"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.151712, "supported_languages": null}, "macro.dbt_utils.default__get_url_host": {"unique_id": "macro.dbt_utils.default__get_url_host", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "name": "default__get_url_host", "macro_sql": "{% macro default__get_url_host(field) -%}\n\n{%- set parsed =\n split_part(\n split_part(\n replace(\n replace(\n replace(field, \"'android-app://'\", \"''\"\n ), \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n\n-%}\n\n\n {{ dbt.safe_cast(\n parsed,\n type_string()\n )}}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.split_part", "macro.dbt.replace", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.152228, "supported_languages": null}, "macro.dbt_utils.get_url_path": {"unique_id": "macro.dbt_utils.get_url_path", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "name": "get_url_path", "macro_sql": "{% macro get_url_path(field) -%}\n {{ return(adapter.dispatch('get_url_path', 'dbt_utils')(field)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_path"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1527371, "supported_languages": null}, "macro.dbt_utils.default__get_url_path": {"unique_id": "macro.dbt_utils.default__get_url_path", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "name": "default__get_url_path", "macro_sql": "{% macro default__get_url_path(field) -%}\n\n {%- set stripped_url =\n replace(\n replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{ position(\"'/'\", stripped_url) }}, 0),\n {{ position(\"'?'\", stripped_url) }} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n split_part(\n right(\n stripped_url,\n length(stripped_url) ~ \"-\" ~ first_slash_pos\n ),\n \"'?'\", 1\n )\n -%}\n\n {{ safe_cast(\n parsed_path,\n type_string()\n )}}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.position", "macro.dbt.split_part", "macro.dbt.right", "macro.dbt.length", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.153323, "supported_languages": null}, "macro.dbt_utils.get_url_parameter": {"unique_id": "macro.dbt_utils.get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "name": "get_url_parameter", "macro_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n {{ return(adapter.dispatch('get_url_parameter', 'dbt_utils')(field, url_parameter)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1536891, "supported_languages": null}, "macro.dbt_utils.default__get_url_parameter": {"unique_id": "macro.dbt_utils.default__get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "name": "default__get_url_parameter", "macro_sql": "{% macro default__get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = split_part(split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1539998, "supported_languages": null}, "macro.dbt_utils.test_fewer_rows_than": {"unique_id": "macro.dbt_utils.test_fewer_rows_than", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "name": "test_fewer_rows_than", "macro_sql": "{% test fewer_rows_than(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_fewer_rows_than', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_fewer_rows_than"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1550772, "supported_languages": null}, "macro.dbt_utils.default__test_fewer_rows_than": {"unique_id": "macro.dbt_utils.default__test_fewer_rows_than", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "name": "default__test_fewer_rows_than", "macro_sql": "{% macro default__test_fewer_rows_than(model, compare_model, group_by_columns) %}\n\n{{ config(fail_calc = 'sum(coalesce(row_count_delta, 0))') }}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in equal_rowcount. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_fewer_rows_than'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_our_model \n from {{ model }}\n {{ groupby_gb_cols }}\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_comparison_model \n from {{ compare_model }}\n {{ groupby_gb_cols }}\n\n),\ncounts as (\n\n select\n\n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_our_model,\n count_comparison_model\n from a\n full join b on \n a.id_dbtutils_test_fewer_rows_than = b.id_dbtutils_test_fewer_rows_than\n {{ join_gb_cols }}\n\n),\nfinal as (\n\n select *,\n case\n -- fail the test if we have more rows than the reference model and return the row count delta\n when count_our_model > count_comparison_model then (count_our_model - count_comparison_model)\n -- fail the test if they are the same number\n when count_our_model = count_comparison_model then 1\n -- pass the test if the delta is positive (i.e. return the number 0)\n else 0\n end as row_count_delta\n from counts\n\n)\n\nselect * from final\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1561038, "supported_languages": null}, "macro.dbt_utils.test_equal_rowcount": {"unique_id": "macro.dbt_utils.test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "name": "test_equal_rowcount", "macro_sql": "{% test equal_rowcount(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_equal_rowcount', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_equal_rowcount"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.156995, "supported_languages": null}, "macro.dbt_utils.default__test_equal_rowcount": {"unique_id": "macro.dbt_utils.default__test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "name": "default__test_equal_rowcount", "macro_sql": "{% macro default__test_equal_rowcount(model, compare_model, group_by_columns) %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = 'sum(coalesce(diff_count, 0))') }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(', ') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in fewer_rows_than. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_equal_rowcount'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_a \n from {{ model }}\n {{groupby_gb_cols}}\n\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_b \n from {{ compare_model }}\n {{groupby_gb_cols}}\n\n),\nfinal as (\n\n select\n \n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_a,\n count_b,\n abs(count_a - count_b) as diff_count\n\n from a\n full join b\n on\n a.id_dbtutils_test_equal_rowcount = b.id_dbtutils_test_equal_rowcount\n {{join_gb_cols}}\n\n\n)\n\nselect * from final\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1580749, "supported_languages": null}, "macro.dbt_utils.test_relationships_where": {"unique_id": "macro.dbt_utils.test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "name": "test_relationships_where", "macro_sql": "{% test relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n {{ return(adapter.dispatch('test_relationships_where', 'dbt_utils')(model, column_name, to, field, from_condition, to_condition)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_relationships_where"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.158984, "supported_languages": null}, "macro.dbt_utils.default__test_relationships_where": {"unique_id": "macro.dbt_utils.default__test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "name": "default__test_relationships_where", "macro_sql": "{% macro default__test_relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n\nwith left_table as (\n\n select\n {{column_name}} as id\n\n from {{model}}\n\n where {{column_name}} is not null\n and {{from_condition}}\n\n),\n\nright_table as (\n\n select\n {{field}} as id\n\n from {{to}}\n\n where {{field}} is not null\n and {{to_condition}}\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1593652, "supported_languages": null}, "macro.dbt_utils.test_recency": {"unique_id": "macro.dbt_utils.test_recency", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "name": "test_recency", "macro_sql": "{% test recency(model, field, datepart, interval, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_recency', 'dbt_utils')(model, field, datepart, interval, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_recency"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.160099, "supported_languages": null}, "macro.dbt_utils.default__test_recency": {"unique_id": "macro.dbt_utils.default__test_recency", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "name": "default__test_recency", "macro_sql": "{% macro default__test_recency(model, field, datepart, interval, group_by_columns) %}\n\n{% set threshold = dateadd(datepart, interval * -1, current_timestamp_backcompat()) %}\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nwith recency as (\n\n select \n\n {{ select_gb_cols }}\n max({{field}}) as most_recent\n\n from {{ model }}\n\n {{ groupby_gb_cols }}\n\n)\n\nselect\n\n {{ select_gb_cols }}\n most_recent,\n {{ threshold }} as threshold\n\nfrom recency\nwhere most_recent < {{ threshold }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.160778, "supported_languages": null}, "macro.dbt_utils.test_not_constant": {"unique_id": "macro.dbt_utils.test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "name": "test_not_constant", "macro_sql": "{% test not_constant(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_constant', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_constant"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.161331, "supported_languages": null}, "macro.dbt_utils.default__test_not_constant": {"unique_id": "macro.dbt_utils.default__test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "name": "default__test_not_constant", "macro_sql": "{% macro default__test_not_constant(model, column_name, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nselect\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count(distinct {{ column_name }}) as filler_column\n\nfrom {{ model }}\n\n {{groupby_gb_cols}}\n\nhaving count(distinct {{ column_name }}) = 1\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.161815, "supported_languages": null}, "macro.dbt_utils.test_accepted_range": {"unique_id": "macro.dbt_utils.test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "name": "test_accepted_range", "macro_sql": "{% test accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n {{ return(adapter.dispatch('test_accepted_range', 'dbt_utils')(model, column_name, min_value, max_value, inclusive)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_accepted_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.162514, "supported_languages": null}, "macro.dbt_utils.default__test_accepted_range": {"unique_id": "macro.dbt_utils.default__test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "name": "default__test_accepted_range", "macro_sql": "{% macro default__test_accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n\nwith meet_condition as(\n select *\n from {{ model }}\n),\n\nvalidation_errors as (\n select *\n from meet_condition\n where\n -- never true, defaults to an empty result set. Exists to ensure any combo of the `or` clauses below succeeds\n 1 = 2\n\n {%- if min_value is not none %}\n -- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} > {{- \"=\" if inclusive }} {{ min_value }}\n {%- endif %}\n\n {%- if max_value is not none %}\n -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} < {{- \"=\" if inclusive }} {{ max_value }}\n {%- endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.163003, "supported_languages": null}, "macro.dbt_utils.test_not_accepted_values": {"unique_id": "macro.dbt_utils.test_not_accepted_values", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "name": "test_not_accepted_values", "macro_sql": "{% test not_accepted_values(model, column_name, values, quote=True) %}\n {{ return(adapter.dispatch('test_not_accepted_values', 'dbt_utils')(model, column_name, values, quote)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1636212, "supported_languages": null}, "macro.dbt_utils.default__test_not_accepted_values": {"unique_id": "macro.dbt_utils.default__test_not_accepted_values", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "name": "default__test_not_accepted_values", "macro_sql": "{% macro default__test_not_accepted_values(model, column_name, values, quote=True) %}\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1641119, "supported_languages": null}, "macro.dbt_utils.test_at_least_one": {"unique_id": "macro.dbt_utils.test_at_least_one", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "name": "test_at_least_one", "macro_sql": "{% test at_least_one(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_at_least_one', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_at_least_one"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1646469, "supported_languages": null}, "macro.dbt_utils.default__test_at_least_one": {"unique_id": "macro.dbt_utils.default__test_at_least_one", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "name": "default__test_at_least_one", "macro_sql": "{% macro default__test_at_least_one(model, column_name, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nselect *\nfrom (\n select\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count({{ column_name }}) as filler_column\n\n from {{ model }}\n\n {{groupby_gb_cols}}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.165138, "supported_languages": null}, "macro.dbt_utils.test_unique_combination_of_columns": {"unique_id": "macro.dbt_utils.test_unique_combination_of_columns", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "name": "test_unique_combination_of_columns", "macro_sql": "{% test unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n {{ return(adapter.dispatch('test_unique_combination_of_columns', 'dbt_utils')(model, combination_of_columns, quote_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_combination_of_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.16583, "supported_languages": null}, "macro.dbt_utils.default__test_unique_combination_of_columns": {"unique_id": "macro.dbt_utils.default__test_unique_combination_of_columns", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "name": "default__test_unique_combination_of_columns", "macro_sql": "{% macro default__test_unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n\n{% if not quote_columns %}\n {%- set column_list=combination_of_columns %}\n{% elif quote_columns %}\n {%- set column_list=[] %}\n {% for column in combination_of_columns -%}\n {% set column_list = column_list.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set columns_csv=column_list | join(', ') %}\n\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.166495, "supported_languages": null}, "macro.dbt_utils.test_cardinality_equality": {"unique_id": "macro.dbt_utils.test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "name": "test_cardinality_equality", "macro_sql": "{% test cardinality_equality(model, column_name, to, field) %}\n {{ return(adapter.dispatch('test_cardinality_equality', 'dbt_utils')(model, column_name, to, field)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_cardinality_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.167118, "supported_languages": null}, "macro.dbt_utils.default__test_cardinality_equality": {"unique_id": "macro.dbt_utils.default__test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "name": "default__test_cardinality_equality", "macro_sql": "{% macro default__test_cardinality_equality(model, column_name, to, field) %}\n\n{# T-SQL does not let you use numbers as aliases for columns #}\n{# Thus, no \"GROUP BY 1\" #}\n\nwith table_a as (\nselect\n {{ column_name }},\n count(*) as num_rows\nfrom {{ model }}\ngroup by {{ column_name }}\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by {{ field }}\n),\n\nexcept_a as (\n select *\n from table_a\n {{ except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ except() }}\n select *\n from table_a\n),\n\nunioned as (\n select *\n from except_a\n union all\n select *\n from except_b\n)\n\nselect *\nfrom unioned\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1674619, "supported_languages": null}, "macro.dbt_utils.test_expression_is_true": {"unique_id": "macro.dbt_utils.test_expression_is_true", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "name": "test_expression_is_true", "macro_sql": "{% test expression_is_true(model, expression, column_name=None, condition='1=1') %}\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n {{ return(adapter.dispatch('test_expression_is_true', 'dbt_utils')(model, expression, column_name, condition)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.168035, "supported_languages": null}, "macro.dbt_utils.default__test_expression_is_true": {"unique_id": "macro.dbt_utils.default__test_expression_is_true", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "name": "default__test_expression_is_true", "macro_sql": "{% macro default__test_expression_is_true(model, expression, column_name, condition) %}\n\n{% set column_list = '*' if should_store_failures() else \"1\" %}\n\nwith meet_condition as (\n select * from {{ model }} where {{ condition }}\n)\n\nselect\n {{ column_list }}\nfrom meet_condition\n{% if column_name is none %}\nwhere not({{ expression }})\n{%- else %}\nwhere not({{ column_name }} {{ expression }})\n{%- endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1684291, "supported_languages": null}, "macro.dbt_utils.test_not_null_proportion": {"unique_id": "macro.dbt_utils.test_not_null_proportion", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "name": "test_not_null_proportion", "macro_sql": "{% macro test_not_null_proportion(model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_null_proportion', 'dbt_utils')(model, group_by_columns, **kwargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_proportion"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1691442, "supported_languages": null}, "macro.dbt_utils.default__test_not_null_proportion": {"unique_id": "macro.dbt_utils.default__test_not_null_proportion", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "name": "default__test_not_null_proportion", "macro_sql": "{% macro default__test_not_null_proportion(model, group_by_columns) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n{% set at_least = kwargs.get('at_least', kwargs.get('arg')) %}\n{% set at_most = kwargs.get('at_most', kwargs.get('arg', 1)) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith validation as (\n select\n {{select_gb_cols}}\n sum(case when {{ column_name }} is null then 0 else 1 end) / cast(count(*) as numeric) as not_null_proportion\n from {{ model }}\n {{groupby_gb_cols}}\n),\nvalidation_errors as (\n select\n {{select_gb_cols}}\n not_null_proportion\n from validation\n where not_null_proportion < {{ at_least }} or not_null_proportion > {{ at_most }}\n)\nselect\n *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.170003, "supported_languages": null}, "macro.dbt_utils.test_sequential_values": {"unique_id": "macro.dbt_utils.test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "name": "test_sequential_values", "macro_sql": "{% test sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n {{ return(adapter.dispatch('test_sequential_values', 'dbt_utils')(model, column_name, interval, datepart, group_by_columns)) }}\n\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_sequential_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.171021, "supported_languages": null}, "macro.dbt_utils.default__test_sequential_values": {"unique_id": "macro.dbt_utils.default__test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "name": "default__test_sequential_values", "macro_sql": "{% macro default__test_sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n{% set previous_column_name = \"previous_\" ~ dbt_utils.slugify(column_name) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(',') + ', ' %}\n {% set partition_gb_cols = 'partition by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith windowed as (\n\n select\n {{ select_gb_cols }}\n {{ column_name }},\n lag({{ column_name }}) over (\n {{partition_gb_cols}}\n order by {{ column_name }}\n ) as {{ previous_column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ type_timestamp() }})= cast({{ dateadd(datepart, interval, previous_column_name) }} as {{ type_timestamp() }}))\n {% else %}\n where not({{ column_name }} = {{ previous_column_name }} + {{ interval }})\n {% endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.slugify", "macro.dbt.type_timestamp", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.171902, "supported_languages": null}, "macro.dbt_utils.test_equality": {"unique_id": "macro.dbt_utils.test_equality", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "name": "test_equality", "macro_sql": "{% test equality(model, compare_model, compare_columns=None) %}\n {{ return(adapter.dispatch('test_equality', 'dbt_utils')(model, compare_model, compare_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1727118, "supported_languages": null}, "macro.dbt_utils.default__test_equality": {"unique_id": "macro.dbt_utils.default__test_equality", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "name": "default__test_equality", "macro_sql": "{% macro default__test_equality(model, compare_model, compare_columns=None) %}\n\n{% set set_diff %}\n count(*) + coalesce(abs(\n sum(case when which_diff = 'a_minus_b' then 1 else 0 end) -\n sum(case when which_diff = 'b_minus_a' then 1 else 0 end)\n ), 0)\n{% endset %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = set_diff) }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n-- setup\n{%- do dbt_utils._is_relation(model, 'test_equality') -%}\n\n{#-\nIf the compare_cols arg is provided, we can run this test without querying the\ninformation schema\u00a0\u2014 this allows the model to be an ephemeral model\n-#}\n\n{%- if not compare_columns -%}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set compare_columns = adapter.get_columns_in_relation(model) | map(attribute='quoted') -%}\n{%- endif -%}\n\n{% set compare_cols_csv = compare_columns | join(', ') %}\n\nwith a as (\n\n select * from {{ model }}\n\n),\n\nb as (\n\n select * from {{ compare_model }}\n\n),\n\na_minus_b as (\n\n select {{compare_cols_csv}} from a\n {{ except() }}\n select {{compare_cols_csv}} from b\n\n),\n\nb_minus_a as (\n\n select {{compare_cols_csv}} from b\n {{ except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select 'a_minus_b' as which_diff, a_minus_b.* from a_minus_b\n union all\n select 'b_minus_a' as which_diff, b_minus_a.* from b_minus_a\n\n)\n\nselect * from unioned\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.173575, "supported_languages": null}, "macro.dbt_utils.test_not_empty_string": {"unique_id": "macro.dbt_utils.test_not_empty_string", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "name": "test_not_empty_string", "macro_sql": "{% test not_empty_string(model, column_name, trim_whitespace=true) %}\n\n {{ return(adapter.dispatch('test_not_empty_string', 'dbt_utils')(model, column_name, trim_whitespace)) }}\n\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_empty_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.174117, "supported_languages": null}, "macro.dbt_utils.default__test_not_empty_string": {"unique_id": "macro.dbt_utils.default__test_not_empty_string", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "name": "default__test_not_empty_string", "macro_sql": "{% macro default__test_not_empty_string(model, column_name, trim_whitespace=true) %}\n\n with\n \n all_values as (\n\n select \n\n\n {% if trim_whitespace == true -%}\n\n trim({{ column_name }}) as {{ column_name }}\n\n {%- else -%}\n\n {{ column_name }}\n\n {%- endif %}\n \n from {{ model }}\n\n ),\n\n errors as (\n\n select * from all_values\n where {{ column_name }} = ''\n\n )\n\n select * from errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.174412, "supported_languages": null}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "name": "test_mutually_exclusive_ranges", "macro_sql": "{% test mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', 'dbt_utils')(model, lower_bound_column, upper_bound_column, partition_by, gaps, zero_length_range_allowed)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_mutually_exclusive_ranges"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.177548, "supported_languages": null}, "macro.dbt_utils.default__test_mutually_exclusive_ranges": {"unique_id": "macro.dbt_utils.default__test_mutually_exclusive_ranges", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "name": "default__test_mutually_exclusive_ranges", "macro_sql": "{% macro default__test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n{% if gaps == 'not_allowed' %}\n {% set allow_gaps_operator='=' %}\n {% set allow_gaps_operator_in_words='equal_to' %}\n{% elif gaps == 'allowed' %}\n {% set allow_gaps_operator='<=' %}\n {% set allow_gaps_operator_in_words='less_than_or_equal_to' %}\n{% elif gaps == 'required' %}\n {% set allow_gaps_operator='<' %}\n {% set allow_gaps_operator_in_words='less_than' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '\" ~ gaps ~\"'.'\"\n ) }}\n{% endif %}\n{% if not zero_length_range_allowed %}\n {% set allow_zero_length_operator='<' %}\n {% set allow_zero_length_operator_in_words='less_than' %}\n{% elif zero_length_range_allowed %}\n {% set allow_zero_length_operator='<=' %}\n {% set allow_zero_length_operator_in_words='less_than_or_equal_to' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`zero_length_range_allowed` argument for mutually_exclusive_ranges test must be one of [true, false] Got: '\" ~ zero_length_range_allowed ~\"'.'\"\n ) }}\n{% endif %}\n\n{% set partition_clause=\"partition by \" ~ partition_by if partition_by else '' %}\n\nwith window_functions as (\n\n select\n {% if partition_by %}\n {{ partition_by }} as partition_by_col,\n {% endif %}\n {{ lower_bound_column }} as lower_bound,\n {{ upper_bound_column }} as upper_bound,\n\n lead({{ lower_bound_column }}) over (\n {{ partition_clause }}\n order by {{ lower_bound_column }}, {{ upper_bound_column }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_bound_column }} desc, {{ upper_bound_column }} desc\n ) = 1 as is_last_record\n\n from {{ model }}\n\n),\n\ncalc as (\n -- We want to return records where one of our assumptions fails, so we'll use\n -- the `not` function with `and` statements so we can write our assumptions more cleanly\n select\n *,\n\n -- For each record: lower_bound should be < upper_bound.\n -- Coalesce it to return an error on the null case (implicit assumption\n -- these columns are not_null)\n coalesce(\n lower_bound {{ allow_zero_length_operator }} upper_bound,\n false\n ) as lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect * from validation_errors\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.179147, "supported_languages": null}, "macro.dbt_utils.pretty_log_format": {"unique_id": "macro.dbt_utils.pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "name": "pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n {{ return(adapter.dispatch('pretty_log_format', 'dbt_utils')(message)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.179472, "supported_languages": null}, "macro.dbt_utils.default__pretty_log_format": {"unique_id": "macro.dbt_utils.default__pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "name": "default__pretty_log_format", "macro_sql": "{% macro default__pretty_log_format(message) %}\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.179637, "supported_languages": null}, "macro.dbt_utils._is_relation": {"unique_id": "macro.dbt_utils._is_relation", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/_is_relation.sql", "original_file_path": "macros/jinja_helpers/_is_relation.sql", "name": "_is_relation", "macro_sql": "{% macro _is_relation(obj, macro) %}\n {%- if not (obj is mapping and obj.get('metadata', {}).get('type', '').endswith('Relation')) -%}\n {%- do exceptions.raise_compiler_error(\"Macro \" ~ macro ~ \" expected a Relation but received the value: \" ~ obj) -%}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.180128, "supported_languages": null}, "macro.dbt_utils.pretty_time": {"unique_id": "macro.dbt_utils.pretty_time", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "name": "pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n {{ return(adapter.dispatch('pretty_time', 'dbt_utils')(format)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1804612, "supported_languages": null}, "macro.dbt_utils.default__pretty_time": {"unique_id": "macro.dbt_utils.default__pretty_time", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "name": "default__pretty_time", "macro_sql": "{% macro default__pretty_time(format='%H:%M:%S') %}\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.180655, "supported_languages": null}, "macro.dbt_utils.log_info": {"unique_id": "macro.dbt_utils.log_info", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "name": "log_info", "macro_sql": "{% macro log_info(message) %}\n {{ return(adapter.dispatch('log_info', 'dbt_utils')(message)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__log_info"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.180958, "supported_languages": null}, "macro.dbt_utils.default__log_info": {"unique_id": "macro.dbt_utils.default__log_info", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "name": "default__log_info", "macro_sql": "{% macro default__log_info(message) %}\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1811259, "supported_languages": null}, "macro.dbt_utils.slugify": {"unique_id": "macro.dbt_utils.slugify", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/slugify.sql", "original_file_path": "macros/jinja_helpers/slugify.sql", "name": "slugify", "macro_sql": "{% macro slugify(string) %}\n\n{#- Lower case the string -#}\n{% set string = string | lower %}\n{#- Replace spaces and dashes with underscores -#}\n{% set string = modules.re.sub('[ -]+', '_', string) %}\n{#- Only take letters, numbers, and underscores -#}\n{% set string = modules.re.sub('[^a-z0-9_]+', '', string) %}\n\n{{ return(string) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.181626, "supported_languages": null}, "macro.dbt_utils._is_ephemeral": {"unique_id": "macro.dbt_utils._is_ephemeral", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/_is_ephemeral.sql", "original_file_path": "macros/jinja_helpers/_is_ephemeral.sql", "name": "_is_ephemeral", "macro_sql": "{% macro _is_ephemeral(obj, macro) %}\n {%- if obj.is_cte -%}\n {% set ephemeral_prefix = api.Relation.add_ephemeral_prefix('') %}\n {% if obj.name.startswith(ephemeral_prefix) %}\n {% set model_name = obj.name[(ephemeral_prefix|length):] %}\n {% else %}\n {% set model_name = obj.name %}\n {%- endif -%}\n {% set error_message %}\nThe `{{ macro }}` macro cannot be used with ephemeral models, as it relies on the information schema.\n\n`{{ model_name }}` is an ephemeral model. Consider making it a view or table instead.\n {% endset %}\n {%- do exceptions.raise_compiler_error(error_message) -%}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.182512, "supported_languages": null}, "macro.dbt_utils.get_intervals_between": {"unique_id": "macro.dbt_utils.get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_utils')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1832142, "supported_languages": null}, "macro.dbt_utils.default__get_intervals_between": {"unique_id": "macro.dbt_utils.default__get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.183789, "supported_languages": null}, "macro.dbt_utils.date_spine": {"unique_id": "macro.dbt_utils.date_spine", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_utils')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.184017, "supported_languages": null}, "macro.dbt_utils.default__date_spine": {"unique_id": "macro.dbt_utils.default__date_spine", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{dbt_utils.generate_series(\n dbt_utils.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n),\n\nall_periods as (\n\n select (\n {{\n dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.generate_series", "macro.dbt_utils.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.184354, "supported_languages": null}, "macro.dbt_utils.nullcheck_table": {"unique_id": "macro.dbt_utils.nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "name": "nullcheck_table", "macro_sql": "{% macro nullcheck_table(relation) %}\n {{ return(adapter.dispatch('nullcheck_table', 'dbt_utils')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.184706, "supported_languages": null}, "macro.dbt_utils.default__nullcheck_table": {"unique_id": "macro.dbt_utils.default__nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "name": "default__nullcheck_table", "macro_sql": "{% macro default__nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(relation, 'nullcheck_table') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'nullcheck_table') -%}\n {% set cols = adapter.get_columns_in_relation(relation) %}\n\n select {{ dbt_utils.nullcheck(cols) }}\n from {{relation}}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.185035, "supported_languages": null}, "macro.dbt_utils.get_relations_by_pattern": {"unique_id": "macro.dbt_utils.get_relations_by_pattern", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "name": "get_relations_by_pattern", "macro_sql": "{% macro get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_pattern', 'dbt_utils')(schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.185719, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_pattern": {"unique_id": "macro.dbt_utils.default__get_relations_by_pattern", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "name": "default__get_relations_by_pattern", "macro_sql": "{% macro default__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.186622, "supported_languages": null}, "macro.dbt_utils.get_powers_of_two": {"unique_id": "macro.dbt_utils.get_powers_of_two", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.187464, "supported_languages": null}, "macro.dbt_utils.default__get_powers_of_two": {"unique_id": "macro.dbt_utils.default__get_powers_of_two", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.187871, "supported_languages": null}, "macro.dbt_utils.generate_series": {"unique_id": "macro.dbt_utils.generate_series", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.188053, "supported_languages": null}, "macro.dbt_utils.default__generate_series": {"unique_id": "macro.dbt_utils.default__generate_series", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_utils.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.188551, "supported_languages": null}, "macro.dbt_utils.get_relations_by_prefix": {"unique_id": "macro.dbt_utils.get_relations_by_prefix", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "name": "get_relations_by_prefix", "macro_sql": "{% macro get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_prefix', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.189257, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_prefix": {"unique_id": "macro.dbt_utils.default__get_relations_by_prefix", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "name": "default__get_relations_by_prefix", "macro_sql": "{% macro default__get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_prefix_sql(schema, prefix, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.190091, "supported_languages": null}, "macro.dbt_utils.get_tables_by_prefix_sql": {"unique_id": "macro.dbt_utils.get_tables_by_prefix_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "name": "get_tables_by_prefix_sql", "macro_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_prefix_sql', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.190552, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_prefix_sql": {"unique_id": "macro.dbt_utils.default__get_tables_by_prefix_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "name": "default__get_tables_by_prefix_sql", "macro_sql": "{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(\n schema_pattern = schema,\n table_pattern = prefix ~ '%',\n exclude = exclude,\n database = database\n ) }}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.190829, "supported_languages": null}, "macro.dbt_utils.star": {"unique_id": "macro.dbt_utils.star", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "name": "star", "macro_sql": "{% macro star(from, relation_alias=False, except=[], prefix='', suffix='') -%}\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, prefix, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.191534, "supported_languages": null}, "macro.dbt_utils.default__star": {"unique_id": "macro.dbt_utils.default__star", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "name": "default__star", "macro_sql": "{% macro default__star(from, relation_alias=False, except=[], prefix='', suffix='') -%}\n {%- do dbt_utils._is_relation(from, 'star') -%}\n {%- do dbt_utils._is_ephemeral(from, 'star') -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return('*') }}\n {%- endif -%}\n\n {% set cols = dbt_utils.get_filtered_columns_in_relation(from, except) %}\n\n {%- if cols|length <= 0 -%}\n {{- return('*') -}}\n {%- else -%}\n {%- for col in cols %}\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}{{ adapter.quote(col)|trim }} {%- if prefix!='' or suffix!='' %} as {{ adapter.quote(prefix ~ col ~ suffix)|trim }} {%- endif -%}\n {%- if not loop.last %},{{ '\\n ' }}{% endif %}\n {%- endfor -%}\n {% endif %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.192488, "supported_languages": null}, "macro.dbt_utils.unpivot": {"unique_id": "macro.dbt_utils.unpivot", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "name": "unpivot", "macro_sql": "{% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value') -%}\n {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.1937559, "supported_languages": null}, "macro.dbt_utils.default__unpivot": {"unique_id": "macro.dbt_utils.default__unpivot", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "name": "default__unpivot", "macro_sql": "{% macro default__unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value') -%}\n\n {% if not relation %}\n {{ exceptions.raise_compiler_error(\"Error: argument `relation` is required for `unpivot` macro.\") }}\n {% endif %}\n\n {%- set exclude = exclude if exclude is not none else [] %}\n {%- set remove = remove if remove is not none else [] %}\n\n {%- set include_cols = [] %}\n\n {%- set table_columns = {} %}\n\n {%- do table_columns.update({relation: []}) %}\n\n {%- do dbt_utils._is_relation(relation, 'unpivot') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'unpivot') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) %}\n\n {%- for col in cols -%}\n {%- if col.column.lower() not in remove|map('lower') and col.column.lower() not in exclude|map('lower') -%}\n {% do include_cols.append(col) %}\n {%- endif %}\n {%- endfor %}\n\n\n {%- for col in include_cols -%}\n select\n {%- for exclude_col in exclude %}\n {{ exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ type_string() }}) as {{ field_name }},\n cast( {% if col.data_type == 'boolean' %}\n {{ cast_bool_to_text(col.column) }}\n {% else %}\n {{ col.column }}\n {% endif %}\n as {{ cast_to }}) as {{ value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_string", "macro.dbt.cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.195541, "supported_languages": null}, "macro.dbt_utils.union_relations": {"unique_id": "macro.dbt_utils.union_relations", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "name": "union_relations", "macro_sql": "{%- macro union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n {{ return(adapter.dispatch('union_relations', 'dbt_utils')(relations, column_override, include, exclude, source_column_name, where)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.198436, "supported_languages": null}, "macro.dbt_utils.default__union_relations": {"unique_id": "macro.dbt_utils.default__union_relations", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "name": "default__union_relations", "macro_sql": "\n\n{%- macro default__union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n cast({{ string_literal(relation) }} as {{ type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ relation }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2017632, "supported_languages": null}, "macro.dbt_utils.group_by": {"unique_id": "macro.dbt_utils.group_by", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "name": "group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_utils')(n)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2021172, "supported_languages": null}, "macro.dbt_utils.default__group_by": {"unique_id": "macro.dbt_utils.default__group_by", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "name": "default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }} \n {%- endfor -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.202362, "supported_languages": null}, "macro.dbt_utils.deduplicate": {"unique_id": "macro.dbt_utils.deduplicate", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "deduplicate", "macro_sql": "{%- macro deduplicate(relation, partition_by, order_by) -%}\n {{ return(adapter.dispatch('deduplicate', 'dbt_utils')(relation, partition_by, order_by)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.203114, "supported_languages": null}, "macro.dbt_utils.default__deduplicate": {"unique_id": "macro.dbt_utils.default__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "default__deduplicate", "macro_sql": "\n\n{%- macro default__deduplicate(relation, partition_by, order_by) -%}\n\n with row_numbered as (\n select\n _inner.*,\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) as rn\n from {{ relation }} as _inner\n )\n\n select\n distinct data.*\n from {{ relation }} as data\n {#\n -- Not all DBs will support natural joins but the ones that do include:\n -- Oracle, MySQL, SQLite, Redshift, Teradata, Materialize, Databricks\n -- Apache Spark, SingleStore, Vertica\n -- Those that do not appear to support natural joins include:\n -- SQLServer, Trino, Presto, Rockset, Athena\n #}\n natural join row_numbered\n where row_numbered.rn = 1\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.203328, "supported_languages": null}, "macro.dbt_utils.redshift__deduplicate": {"unique_id": "macro.dbt_utils.redshift__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "redshift__deduplicate", "macro_sql": "{% macro redshift__deduplicate(relation, partition_by, order_by) -%}\n\n {{ return(dbt_utils.default__deduplicate(relation, partition_by, order_by=order_by)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2035232, "supported_languages": null}, "macro.dbt_utils.postgres__deduplicate": {"unique_id": "macro.dbt_utils.postgres__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "postgres__deduplicate", "macro_sql": "\n{%- macro postgres__deduplicate(relation, partition_by, order_by) -%}\n\n select\n distinct on ({{ partition_by }}) *\n from {{ relation }}\n order by {{ partition_by }}{{ ',' ~ order_by }}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.203709, "supported_languages": null}, "macro.dbt_utils.snowflake__deduplicate": {"unique_id": "macro.dbt_utils.snowflake__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "snowflake__deduplicate", "macro_sql": "\n{%- macro snowflake__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.203865, "supported_languages": null}, "macro.dbt_utils.bigquery__deduplicate": {"unique_id": "macro.dbt_utils.bigquery__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "bigquery__deduplicate", "macro_sql": "\n{%- macro bigquery__deduplicate(relation, partition_by, order_by) -%}\n\n select unique.*\n from (\n select\n array_agg (\n original\n order by {{ order_by }}\n limit 1\n )[offset(0)] unique\n from {{ relation }} original\n group by {{ partition_by }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2040288, "supported_languages": null}, "macro.dbt_utils.surrogate_key": {"unique_id": "macro.dbt_utils.surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "name": "surrogate_key", "macro_sql": "{%- macro surrogate_key(field_list) -%}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('surrogate_key', 'dbt_utils')(field_list, *varargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.204457, "supported_languages": null}, "macro.dbt_utils.default__surrogate_key": {"unique_id": "macro.dbt_utils.default__surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "name": "default__surrogate_key", "macro_sql": "\n\n{%- macro default__surrogate_key(field_list) -%}\n\n{%- set error_message = '\nWarning: `dbt_utils.surrogate_key` has been replaced by \\\n`dbt_utils.generate_surrogate_key`. The new macro treats null values \\\ndifferently to empty strings. To restore the behaviour of the original \\\nmacro, add a variable scoped to the dbt_utils package called \\\n`surrogate_key_treat_nulls_as_empty_strings` to your \\\ndbt_project.yml file with a value of True. \\\nThe {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.204685, "supported_languages": null}, "macro.dbt_utils.safe_add": {"unique_id": "macro.dbt_utils.safe_add", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "name": "safe_add", "macro_sql": "{%- macro safe_add(field_list) -%}\n {{ return(adapter.dispatch('safe_add', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__safe_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.205096, "supported_languages": null}, "macro.dbt_utils.default__safe_add": {"unique_id": "macro.dbt_utils.default__safe_add", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "name": "default__safe_add", "macro_sql": "\n\n{%- macro default__safe_add(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_add` macro now takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.warn(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.205625, "supported_languages": null}, "macro.dbt_utils.nullcheck": {"unique_id": "macro.dbt_utils.nullcheck", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "name": "nullcheck", "macro_sql": "{% macro nullcheck(cols) %}\n {{ return(adapter.dispatch('nullcheck', 'dbt_utils')(cols)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.206004, "supported_languages": null}, "macro.dbt_utils.default__nullcheck": {"unique_id": "macro.dbt_utils.default__nullcheck", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "name": "default__nullcheck", "macro_sql": "{% macro default__nullcheck(cols) %}\n{%- for col in cols %}\n\n {% if col.is_string() -%}\n\n nullif({{col.name}},'') as {{col.name}}\n\n {%- else -%}\n\n {{col.name}}\n\n {%- endif -%}\n\n{%- if not loop.last -%} , {%- endif -%}\n\n{%- endfor -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.206326, "supported_languages": null}, "macro.dbt_utils.get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "get_tables_by_pattern_sql", "macro_sql": "{% macro get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_pattern_sql', 'dbt_utils')\n (schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.207904, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.default__get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "default__get_tables_by_pattern_sql", "macro_sql": "{% macro default__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.208252, "supported_languages": null}, "macro.dbt_utils.bigquery__get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.bigquery__get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "bigquery__get_tables_by_pattern_sql", "macro_sql": "{% macro bigquery__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% if '%' in schema_pattern %}\n {% set schemata=dbt_utils._bigquery__get_matching_schemata(schema_pattern, database) %}\n {% else %}\n {% set schemata=[schema_pattern] %}\n {% endif %}\n\n {% set sql %}\n {% for schema in schemata %}\n select distinct\n table_schema,\n table_name,\n {{ dbt_utils.get_table_types_sql() }}\n\n from {{ adapter.quote(database) }}.{{ schema }}.INFORMATION_SCHEMA.TABLES\n where lower(table_name) like lower ('{{ table_pattern }}')\n and lower(table_name) not like lower ('{{ exclude }}')\n\n {% if not loop.last %} union all {% endif %}\n\n {% endfor %}\n {% endset %}\n\n {{ return(sql) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._bigquery__get_matching_schemata", "macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2090151, "supported_languages": null}, "macro.dbt_utils._bigquery__get_matching_schemata": {"unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "_bigquery__get_matching_schemata", "macro_sql": "{% macro _bigquery__get_matching_schemata(schema_pattern, database) %}\n {% if execute %}\n\n {% set sql %}\n select schema_name from {{ adapter.quote(database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like lower('{{ schema_pattern }}')\n {% endset %}\n\n {% set results=run_query(sql) %}\n\n {% set schemata=results.columns['schema_name'].values() %}\n\n {{ return(schemata) }}\n\n {% else %}\n\n {{ return([]) }}\n\n {% endif %}\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.209503, "supported_languages": null}, "macro.dbt_utils.get_column_values": {"unique_id": "macro.dbt_utils.get_column_values", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "name": "get_column_values", "macro_sql": "{% macro get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {{ return(adapter.dispatch('get_column_values', 'dbt_utils')(table, column, order_by, max_records, default, where)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_column_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.210594, "supported_languages": null}, "macro.dbt_utils.default__get_column_values": {"unique_id": "macro.dbt_utils.default__get_column_values", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "name": "default__get_column_values", "macro_sql": "{% macro default__get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {% set default = [] if not default %}\n {{ return(default) }}\n {% endif %}\n\n {%- do dbt_utils._is_ephemeral(table, 'get_column_values') -%}\n\n {# Not all relations are tables. Renaming for internal clarity without breaking functionality for anyone using named arguments #}\n {# TODO: Change the method signature in a future 0.x.0 release #}\n {%- set target_relation = table -%}\n\n {# adapter.load_relation is a convenience wrapper to avoid building a Relation when we already have one #}\n {% set relation_exists = (load_relation(target_relation)) is not none %}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not relation_exists and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ target_relation ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not relation_exists and default is not none -%}\n\n {{ log(\"Relation \" ~ target_relation ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n\n {% if where is not none %}\n where {{ where }}\n {% endif %}\n\n group by {{ column }}\n order by {{ order_by }}\n\n {% if max_records is not none %}\n limit {{ max_records }}\n {% endif %}\n\n {% endif %}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_column_values') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values) }}\n {%- else -%}\n {{ return(default) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_ephemeral", "macro.dbt.load_relation", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.212062, "supported_languages": null}, "macro.dbt_utils.pivot": {"unique_id": "macro.dbt_utils.pivot", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "name": "pivot", "macro_sql": "{% macro pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {{ return(adapter.dispatch('pivot', 'dbt_utils')(column, values, alias, agg, cmp, prefix, suffix, then_value, else_value, quote_identifiers, distinct)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.213105, "supported_languages": null}, "macro.dbt_utils.default__pivot": {"unique_id": "macro.dbt_utils.default__pivot", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "name": "default__pivot", "macro_sql": "{% macro default__pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {% for value in values %}\n {{ agg }}(\n {% if distinct %} distinct {% endif %}\n case\n when {{ column }} {{ cmp }} '{{ escape_single_quotes(value) }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ value ~ suffix) }}\n {% else %}\n as {{ dbt_utils.slugify(prefix ~ value ~ suffix) }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.escape_single_quotes", "macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.213917, "supported_languages": null}, "macro.dbt_utils.get_filtered_columns_in_relation": {"unique_id": "macro.dbt_utils.get_filtered_columns_in_relation", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "name": "get_filtered_columns_in_relation", "macro_sql": "{% macro get_filtered_columns_in_relation(from, except=[]) -%}\n {{ return(adapter.dispatch('get_filtered_columns_in_relation', 'dbt_utils')(from, except)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2144158, "supported_languages": null}, "macro.dbt_utils.default__get_filtered_columns_in_relation": {"unique_id": "macro.dbt_utils.default__get_filtered_columns_in_relation", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "name": "default__get_filtered_columns_in_relation", "macro_sql": "{% macro default__get_filtered_columns_in_relation(from, except=[]) -%}\n {%- do dbt_utils._is_relation(from, 'get_filtered_columns_in_relation') -%}\n {%- do dbt_utils._is_ephemeral(from, 'get_filtered_columns_in_relation') -%}\n\n {# -- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return('') }}\n {% endif %}\n\n {%- set include_cols = [] %}\n {%- set cols = adapter.get_columns_in_relation(from) -%}\n {%- set except = except | map(\"lower\") | list %}\n {%- for col in cols -%}\n {%- if col.column|lower not in except -%}\n {% do include_cols.append(col.column) %}\n {%- endif %}\n {%- endfor %}\n\n {{ return(include_cols) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.215127, "supported_languages": null}, "macro.dbt_utils.width_bucket": {"unique_id": "macro.dbt_utils.width_bucket", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "name": "width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ return(adapter.dispatch('width_bucket', 'dbt_utils') (expr, min_value, max_value, num_buckets)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__width_bucket"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.216487, "supported_languages": null}, "macro.dbt_utils.default__width_bucket": {"unique_id": "macro.dbt_utils.default__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "name": "default__width_bucket", "macro_sql": "{% macro default__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is eaxtly at the bucket egde\n case\n when\n mod(\n {{ dbt.safe_cast(expr, type_numeric() ) }},\n {{ dbt.safe_cast(bin_size, type_numeric() ) }}\n ) = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.216917, "supported_languages": null}, "macro.dbt_utils.redshift__width_bucket": {"unique_id": "macro.dbt_utils.redshift__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "name": "redshift__width_bucket", "macro_sql": "{% macro redshift__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is exactly at the bucket edge\n case\n when\n {{ dbt.safe_cast(expr, type_numeric() ) }} %\n {{ dbt.safe_cast(bin_size, type_numeric() ) }}\n = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.217348, "supported_languages": null}, "macro.dbt_utils.snowflake__width_bucket": {"unique_id": "macro.dbt_utils.snowflake__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "name": "snowflake__width_bucket", "macro_sql": "{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.217536, "supported_languages": null}, "macro.dbt_utils.get_query_results_as_dict": {"unique_id": "macro.dbt_utils.get_query_results_as_dict", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "name": "get_query_results_as_dict", "macro_sql": "{% macro get_query_results_as_dict(query) %}\n {{ return(adapter.dispatch('get_query_results_as_dict', 'dbt_utils')(query)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_query_results_as_dict"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.21796, "supported_languages": null}, "macro.dbt_utils.default__get_query_results_as_dict": {"unique_id": "macro.dbt_utils.default__get_query_results_as_dict", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "name": "default__get_query_results_as_dict", "macro_sql": "{% macro default__get_query_results_as_dict(query) %}\n\n{# This macro returns a dictionary of the form {column_name: (tuple_of_results)} #}\n\n {%- call statement('get_query_results', fetch_result=True,auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {% set sql_results={} %}\n\n {%- if execute -%}\n {% set sql_results_table = load_result('get_query_results').table.columns %}\n {% for column_name, column in sql_results_table.items() %}\n {% do sql_results.update({column_name: column.values()}) %}\n {% endfor %}\n {%- endif -%}\n\n {{ return(sql_results) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.218543, "supported_languages": null}, "macro.dbt_utils.generate_surrogate_key": {"unique_id": "macro.dbt_utils.generate_surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "name": "generate_surrogate_key", "macro_sql": "{%- macro generate_surrogate_key(field_list) -%}\n {{ return(adapter.dispatch('generate_surrogate_key', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__generate_surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.219029, "supported_languages": null}, "macro.dbt_utils.default__generate_surrogate_key": {"unique_id": "macro.dbt_utils.default__generate_surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "name": "default__generate_surrogate_key", "macro_sql": "\n\n{%- macro default__generate_surrogate_key(field_list) -%}\n\n{% if var('surrogate_key_treat_nulls_as_empty_strings', False) %}\n {% set default_null_value = \"\" %}\n{% else %}\n {% set default_null_value = '_dbt_utils_surrogate_key_null_'%}\n{% endif %}\n\n{%- set fields = [] -%}\n\n{%- for field in field_list -%}\n\n {%- do fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ type_string() ~ \"), '\" ~ default_null_value ~\"')\"\n ) -%}\n\n {%- if not loop.last %}\n {%- do fields.append(\"'-'\") -%}\n {%- endif -%}\n\n{%- endfor -%}\n\n{{ hash(concat(fields)) }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.hash", "macro.dbt.concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.219638, "supported_languages": null}, "macro.dbt_utils.get_table_types_sql": {"unique_id": "macro.dbt_utils.get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "name": "get_table_types_sql", "macro_sql": "{%- macro get_table_types_sql() -%}\n {{ return(adapter.dispatch('get_table_types_sql', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.220063, "supported_languages": null}, "macro.dbt_utils.default__get_table_types_sql": {"unique_id": "macro.dbt_utils.default__get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "name": "default__get_table_types_sql", "macro_sql": "{% macro default__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.220201, "supported_languages": null}, "macro.dbt_utils.postgres__get_table_types_sql": {"unique_id": "macro.dbt_utils.postgres__get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "name": "postgres__get_table_types_sql", "macro_sql": "{% macro postgres__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'FOREIGN' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.220337, "supported_languages": null}, "macro.dbt_utils.degrees_to_radians": {"unique_id": "macro.dbt_utils.degrees_to_radians", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "degrees_to_radians", "macro_sql": "{% macro degrees_to_radians(degrees) -%}\n acos(-1) * {{degrees}} / 180\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.221357, "supported_languages": null}, "macro.dbt_utils.haversine_distance": {"unique_id": "macro.dbt_utils.haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "haversine_distance", "macro_sql": "{% macro haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n {{ return(adapter.dispatch('haversine_distance', 'dbt_utils')(lat1,lon1,lat2,lon2,unit)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.221693, "supported_languages": null}, "macro.dbt_utils.default__haversine_distance": {"unique_id": "macro.dbt_utils.default__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n\n 2 * 3961 * asin(sqrt(power((sin(radians(({{ lat2 }} - {{ lat1 }}) / 2))), 2) +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n power((sin(radians(({{ lon2 }} - {{ lon1 }}) / 2))), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2222521, "supported_languages": null}, "macro.dbt_utils.bigquery__haversine_distance": {"unique_id": "macro.dbt_utils.bigquery__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "bigquery__haversine_distance", "macro_sql": "{% macro bigquery__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{% set radians_lat1 = dbt_utils.degrees_to_radians(lat1) %}\n{% set radians_lat2 = dbt_utils.degrees_to_radians(lat2) %}\n{% set radians_lon1 = dbt_utils.degrees_to_radians(lon1) %}\n{% set radians_lon2 = dbt_utils.degrees_to_radians(lon2) %}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n 2 * 3961 * asin(sqrt(power(sin(({{ radians_lat2 }} - {{ radians_lat1 }}) / 2), 2) +\n cos({{ radians_lat1 }}) * cos({{ radians_lat2 }}) *\n power(sin(({{ radians_lon2 }} - {{ radians_lon1 }}) / 2), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.degrees_to_radians"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.22304, "supported_languages": null}, "macro.fivetran_utils.enabled_vars": {"unique_id": "macro.fivetran_utils.enabled_vars", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/enabled_vars.sql", "original_file_path": "macros/enabled_vars.sql", "name": "enabled_vars", "macro_sql": "{% macro enabled_vars(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, True) == False %}\n {{ return(False) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(True) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.223495, "supported_languages": null}, "macro.fivetran_utils.percentile": {"unique_id": "macro.fivetran_utils.percentile", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "percentile", "macro_sql": "{% macro percentile(percentile_field, partition_field, percent) -%}\n\n{{ adapter.dispatch('percentile', 'fivetran_utils') (percentile_field, partition_field, percent) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__percentile"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.224407, "supported_languages": null}, "macro.fivetran_utils.default__percentile": {"unique_id": "macro.fivetran_utils.default__percentile", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "default__percentile", "macro_sql": "{% macro default__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.22457, "supported_languages": null}, "macro.fivetran_utils.redshift__percentile": {"unique_id": "macro.fivetran_utils.redshift__percentile", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "redshift__percentile", "macro_sql": "{% macro redshift__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.224724, "supported_languages": null}, "macro.fivetran_utils.bigquery__percentile": {"unique_id": "macro.fivetran_utils.bigquery__percentile", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "bigquery__percentile", "macro_sql": "{% macro bigquery__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.224877, "supported_languages": null}, "macro.fivetran_utils.postgres__percentile": {"unique_id": "macro.fivetran_utils.postgres__percentile", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "postgres__percentile", "macro_sql": "{% macro postgres__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n /* have to group by partition field */\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.225015, "supported_languages": null}, "macro.fivetran_utils.spark__percentile": {"unique_id": "macro.fivetran_utils.spark__percentile", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "spark__percentile", "macro_sql": "{% macro spark__percentile(percentile_field, partition_field, percent) %}\n\n percentile( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.225166, "supported_languages": null}, "macro.fivetran_utils.pivot_json_extract": {"unique_id": "macro.fivetran_utils.pivot_json_extract", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/pivot_json_extract.sql", "original_file_path": "macros/pivot_json_extract.sql", "name": "pivot_json_extract", "macro_sql": "{% macro pivot_json_extract(string, list_of_properties) %}\n\n{%- for property in list_of_properties -%}\n\nreplace( {{ fivetran_utils.json_extract(string, property) }}, '\"', '') as {{ property | replace(' ', '_') | lower }}\n\n{%- if not loop.last -%},{%- endif %}\n{% endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.225632, "supported_languages": null}, "macro.fivetran_utils.persist_pass_through_columns": {"unique_id": "macro.fivetran_utils.persist_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/persist_pass_through_columns.sql", "original_file_path": "macros/persist_pass_through_columns.sql", "name": "persist_pass_through_columns", "macro_sql": "{% macro persist_pass_through_columns(pass_through_variable, identifier=none, transform='') %}\n\n{% if var(pass_through_variable, none) %}\n {% for field in var(pass_through_variable) %}\n , {{ transform ~ '(' ~ (identifier ~ '.' if identifier else '') ~ (field.alias if field.alias else field.name) ~ ')' }} as {{ field.alias if field.alias else field.name }}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.226304, "supported_languages": null}, "macro.fivetran_utils.json_parse": {"unique_id": "macro.fivetran_utils.json_parse", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "json_parse", "macro_sql": "{% macro json_parse(string, string_path) -%}\n\n{{ adapter.dispatch('json_parse', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__json_parse"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2273579, "supported_languages": null}, "macro.fivetran_utils.default__json_parse": {"unique_id": "macro.fivetran_utils.default__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "default__json_parse", "macro_sql": "{% macro default__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.227596, "supported_languages": null}, "macro.fivetran_utils.redshift__json_parse": {"unique_id": "macro.fivetran_utils.redshift__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "redshift__json_parse", "macro_sql": "{% macro redshift__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.227833, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_parse": {"unique_id": "macro.fivetran_utils.bigquery__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "bigquery__json_parse", "macro_sql": "{% macro bigquery__json_parse(string, string_path) %}\n\n \n json_extract_scalar({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.228064, "supported_languages": null}, "macro.fivetran_utils.postgres__json_parse": {"unique_id": "macro.fivetran_utils.postgres__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "postgres__json_parse", "macro_sql": "{% macro postgres__json_parse(string, string_path) %}\n\n {{string}}::json #>> '{ {%- for s in string_path -%}{{ s }}{%- if not loop.last -%},{%- endif -%}{%- endfor -%} }'\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.228292, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_parse": {"unique_id": "macro.fivetran_utils.snowflake__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "snowflake__json_parse", "macro_sql": "{% macro snowflake__json_parse(string, string_path) %}\n\n parse_json( {{string}} ) {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.228551, "supported_languages": null}, "macro.fivetran_utils.spark__json_parse": {"unique_id": "macro.fivetran_utils.spark__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "spark__json_parse", "macro_sql": "{% macro spark__json_parse(string, string_path) %}\n\n {{string}} : {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.228808, "supported_languages": null}, "macro.fivetran_utils.max_bool": {"unique_id": "macro.fivetran_utils.max_bool", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "max_bool", "macro_sql": "{% macro max_bool(boolean_field) -%}\n\n{{ adapter.dispatch('max_bool', 'fivetran_utils') (boolean_field) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__max_bool"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2291782, "supported_languages": null}, "macro.fivetran_utils.default__max_bool": {"unique_id": "macro.fivetran_utils.default__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "default__max_bool", "macro_sql": "{% macro default__max_bool(boolean_field) %}\n\n bool_or( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.229277, "supported_languages": null}, "macro.fivetran_utils.snowflake__max_bool": {"unique_id": "macro.fivetran_utils.snowflake__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "snowflake__max_bool", "macro_sql": "{% macro snowflake__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.229446, "supported_languages": null}, "macro.fivetran_utils.bigquery__max_bool": {"unique_id": "macro.fivetran_utils.bigquery__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "bigquery__max_bool", "macro_sql": "{% macro bigquery__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.229544, "supported_languages": null}, "macro.fivetran_utils.calculated_fields": {"unique_id": "macro.fivetran_utils.calculated_fields", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/calculated_fields.sql", "original_file_path": "macros/calculated_fields.sql", "name": "calculated_fields", "macro_sql": "{% macro calculated_fields(variable) -%}\n\n{% if var(variable, none) %}\n {% for field in var(variable) %}\n , {{ field.transform_sql }} as {{ field.name }} \n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.22996, "supported_languages": null}, "macro.fivetran_utils.seed_data_helper": {"unique_id": "macro.fivetran_utils.seed_data_helper", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/seed_data_helper.sql", "original_file_path": "macros/seed_data_helper.sql", "name": "seed_data_helper", "macro_sql": "{% macro seed_data_helper(seed_name, warehouses) %}\n\n{% if target.type in warehouses %}\n {% for w in warehouses %}\n {% if target.type == w %}\n {{ return(ref(seed_name ~ \"_\" ~ w ~ \"\")) }}\n {% endif %}\n {% endfor %}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.230571, "supported_languages": null}, "macro.fivetran_utils.fill_pass_through_columns": {"unique_id": "macro.fivetran_utils.fill_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/fill_pass_through_columns.sql", "original_file_path": "macros/fill_pass_through_columns.sql", "name": "fill_pass_through_columns", "macro_sql": "{% macro fill_pass_through_columns(pass_through_variable) %}\n\n{% if var(pass_through_variable) %}\n {% for field in var(pass_through_variable) %}\n {% if field.transform_sql %}\n , {{ field.transform_sql }} as {{ field.alias if field.alias else field.name }}\n {% else %}\n , {{ field.alias if field.alias else field.name }}\n {% endif %}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.231214, "supported_languages": null}, "macro.fivetran_utils.string_agg": {"unique_id": "macro.fivetran_utils.string_agg", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "string_agg", "macro_sql": "{% macro string_agg(field_to_agg, delimiter) -%}\n\n{{ adapter.dispatch('string_agg', 'fivetran_utils') (field_to_agg, delimiter) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__string_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.231713, "supported_languages": null}, "macro.fivetran_utils.default__string_agg": {"unique_id": "macro.fivetran_utils.default__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "default__string_agg", "macro_sql": "{% macro default__string_agg(field_to_agg, delimiter) %}\n string_agg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.231839, "supported_languages": null}, "macro.fivetran_utils.snowflake__string_agg": {"unique_id": "macro.fivetran_utils.snowflake__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "snowflake__string_agg", "macro_sql": "{% macro snowflake__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2319639, "supported_languages": null}, "macro.fivetran_utils.redshift__string_agg": {"unique_id": "macro.fivetran_utils.redshift__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "redshift__string_agg", "macro_sql": "{% macro redshift__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2320871, "supported_languages": null}, "macro.fivetran_utils.spark__string_agg": {"unique_id": "macro.fivetran_utils.spark__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "spark__string_agg", "macro_sql": "{% macro spark__string_agg(field_to_agg, delimiter) %}\n -- collect set will remove duplicates\n replace(replace(replace(cast( collect_set({{ field_to_agg }}) as string), '[', ''), ']', ''), ', ', {{ delimiter }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.232213, "supported_languages": null}, "macro.fivetran_utils.timestamp_diff": {"unique_id": "macro.fivetran_utils.timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "timestamp_diff", "macro_sql": "{% macro timestamp_diff(first_date, second_date, datepart) %}\n {{ adapter.dispatch('timestamp_diff', 'fivetran_utils')(first_date, second_date, datepart) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__timestamp_diff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.23489, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_diff": {"unique_id": "macro.fivetran_utils.default__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "default__timestamp_diff", "macro_sql": "{% macro default__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2350478, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_diff": {"unique_id": "macro.fivetran_utils.redshift__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "redshift__timestamp_diff", "macro_sql": "{% macro redshift__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2352, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_diff": {"unique_id": "macro.fivetran_utils.bigquery__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "bigquery__timestamp_diff", "macro_sql": "{% macro bigquery__timestamp_diff(first_date, second_date, datepart) %}\n\n timestamp_diff(\n {{second_date}},\n {{first_date}},\n {{datepart}}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2353542, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_diff": {"unique_id": "macro.fivetran_utils.postgres__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "postgres__timestamp_diff", "macro_sql": "{% macro postgres__timestamp_diff(first_date, second_date, datepart) %}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ dbt.datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.23706, "supported_languages": null}, "macro.fivetran_utils.try_cast": {"unique_id": "macro.fivetran_utils.try_cast", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "try_cast", "macro_sql": "{% macro try_cast(field, type) %}\n {{ adapter.dispatch('try_cast', 'fivetran_utils') (field, type) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__try_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2379022, "supported_languages": null}, "macro.fivetran_utils.default__safe_cast": {"unique_id": "macro.fivetran_utils.default__safe_cast", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.238039, "supported_languages": null}, "macro.fivetran_utils.redshift__try_cast": {"unique_id": "macro.fivetran_utils.redshift__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "redshift__try_cast", "macro_sql": "{% macro redshift__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when trim({{field}}) ~ '^(0|[1-9][0-9]*)$' then trim({{field}})\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2383082, "supported_languages": null}, "macro.fivetran_utils.postgres__try_cast": {"unique_id": "macro.fivetran_utils.postgres__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "postgres__try_cast", "macro_sql": "{% macro postgres__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar)) ~ '^(0|[1-9][0-9]*)$' \n then replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar))\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.238584, "supported_languages": null}, "macro.fivetran_utils.snowflake__try_cast": {"unique_id": "macro.fivetran_utils.snowflake__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "snowflake__try_cast", "macro_sql": "{% macro snowflake__try_cast(field, type) %}\n try_cast(cast({{field}} as varchar) as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2387142, "supported_languages": null}, "macro.fivetran_utils.bigquery__try_cast": {"unique_id": "macro.fivetran_utils.bigquery__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "bigquery__try_cast", "macro_sql": "{% macro bigquery__try_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2388349, "supported_languages": null}, "macro.fivetran_utils.spark__try_cast": {"unique_id": "macro.fivetran_utils.spark__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "spark__try_cast", "macro_sql": "{% macro spark__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.238955, "supported_languages": null}, "macro.fivetran_utils.source_relation": {"unique_id": "macro.fivetran_utils.source_relation", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "name": "source_relation", "macro_sql": "{% macro source_relation(union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('source_relation', 'fivetran_utils') (union_schema_variable, union_database_variable) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2394729, "supported_languages": null}, "macro.fivetran_utils.default__source_relation": {"unique_id": "macro.fivetran_utils.default__source_relation", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "name": "default__source_relation", "macro_sql": "{% macro default__source_relation(union_schema_variable, union_database_variable) %}\n\n{% if var(union_schema_variable, none) %}\n, case\n {% for schema in var(union_schema_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%.{{ schema|lower }}.%' then '{{ schema|lower }}'\n {% endfor %}\n end as source_relation\n{% elif var(union_database_variable, none) %}\n, case\n {% for database in var(union_database_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%{{ database|lower }}.%' then '{{ database|lower }}'\n {% endfor %}\n end as source_relation\n{% else %}\n, cast('' as {{ dbt.type_string() }}) as source_relation\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2400389, "supported_languages": null}, "macro.fivetran_utils.first_value": {"unique_id": "macro.fivetran_utils.first_value", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "first_value", "macro_sql": "{% macro first_value(first_value_field, partition_field, order_by_field, order=\"asc\") -%}\n\n{{ adapter.dispatch('first_value', 'fivetran_utils') (first_value_field, partition_field, order_by_field, order) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__first_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.240567, "supported_languages": null}, "macro.fivetran_utils.default__first_value": {"unique_id": "macro.fivetran_utils.default__first_value", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "default__first_value", "macro_sql": "{% macro default__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.240761, "supported_languages": null}, "macro.fivetran_utils.redshift__first_value": {"unique_id": "macro.fivetran_utils.redshift__first_value", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "redshift__first_value", "macro_sql": "{% macro redshift__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} , {{ partition_field }} rows unbounded preceding )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.240972, "supported_languages": null}, "macro.fivetran_utils.add_dbt_source_relation": {"unique_id": "macro.fivetran_utils.add_dbt_source_relation", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/add_dbt_source_relation.sql", "original_file_path": "macros/add_dbt_source_relation.sql", "name": "add_dbt_source_relation", "macro_sql": "{% macro add_dbt_source_relation() %}\n\n{% if var('union_schemas', none) or var('union_databases', none) %}\n, _dbt_source_relation\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.241279, "supported_languages": null}, "macro.fivetran_utils.add_pass_through_columns": {"unique_id": "macro.fivetran_utils.add_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/add_pass_through_columns.sql", "original_file_path": "macros/add_pass_through_columns.sql", "name": "add_pass_through_columns", "macro_sql": "{% macro add_pass_through_columns(base_columns, pass_through_var) %}\n\n {% if pass_through_var %}\n\n {% for column in pass_through_var %}\n\n {% if column.alias %}\n\n {% do base_columns.append({ \"name\": column.name, \"alias\": column.alias, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column.name, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n \n {% endif %}\n\n {% endfor %}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.242126, "supported_languages": null}, "macro.fivetran_utils.union_relations": {"unique_id": "macro.fivetran_utils.union_relations", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "name": "union_relations", "macro_sql": "{%- macro union_relations(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n {%- set source_column_name = source_column_name if source_column_name is not none else '_dbt_source_relation' -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt_utils.string_literal(relation) }} as {{ dbt_utils.type_string() }}) as {{ source_column_name }},\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ aliases[loop.index0] if aliases else relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.245984, "supported_languages": null}, "macro.fivetran_utils.union_tables": {"unique_id": "macro.fivetran_utils.union_tables", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "name": "union_tables", "macro_sql": "{%- macro union_tables(tables, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_table') -%}\n\n {%- do exceptions.warn(\"Warning: the `union_tables` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use the `union_relations` macro instead\") -%}\n\n {{ return(dbt_utils.union_relations(tables, column_override, include, exclude, source_column_name)) }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.246339, "supported_languages": null}, "macro.fivetran_utils.snowflake_seed_data": {"unique_id": "macro.fivetran_utils.snowflake_seed_data", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/snowflake_seed_data.sql", "original_file_path": "macros/snowflake_seed_data.sql", "name": "snowflake_seed_data", "macro_sql": "{% macro snowflake_seed_data(seed_name) %}\n\n{% if target.type == 'snowflake' %}\n{{ return(ref(seed_name ~ '_snowflake')) }}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.246758, "supported_languages": null}, "macro.fivetran_utils.fill_staging_columns": {"unique_id": "macro.fivetran_utils.fill_staging_columns", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "name": "fill_staging_columns", "macro_sql": "{% macro fill_staging_columns(source_columns, staging_columns) -%}\n\n{%- set source_column_names = source_columns|map(attribute='name')|map('lower')|list -%}\n\n{%- for column in staging_columns %}\n {% if column.name|lower in source_column_names -%}\n {{ fivetran_utils.quote_column(column) }} as \n {%- if 'alias' in column %} {{ column.alias }} {% else %} {{ fivetran_utils.quote_column(column) }} {%- endif -%}\n {%- else -%}\n cast(null as {{ column.datatype }})\n {%- if 'alias' in column %} as {{ column.alias }} {% else %} as {{ fivetran_utils.quote_column(column) }} {% endif -%}\n {%- endif -%}\n {%- if not loop.last -%} , {% endif -%}\n{% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.quote_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.248277, "supported_languages": null}, "macro.fivetran_utils.quote_column": {"unique_id": "macro.fivetran_utils.quote_column", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "name": "quote_column", "macro_sql": "{% macro quote_column(column) %}\n {% if 'quote' in column %}\n {% if column.quote %}\n {% if target.type in ('bigquery', 'spark') %}\n `{{ column.name }}`\n {% elif target.type == 'snowflake' %}\n \"{{ column.name | upper }}\"\n {% else %}\n \"{{ column.name }}\"\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.248811, "supported_languages": null}, "macro.fivetran_utils.json_extract": {"unique_id": "macro.fivetran_utils.json_extract", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "json_extract", "macro_sql": "{% macro json_extract(string, string_path) -%}\n\n{{ adapter.dispatch('json_extract', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.249401, "supported_languages": null}, "macro.fivetran_utils.default__json_extract": {"unique_id": "macro.fivetran_utils.default__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "default__json_extract", "macro_sql": "{% macro default__json_extract(string, string_path) %}\n\n json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} )\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2495518, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_extract": {"unique_id": "macro.fivetran_utils.snowflake__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "snowflake__json_extract", "macro_sql": "{% macro snowflake__json_extract(string, string_path) %}\n\n json_extract_path_text(try_parse_json( {{string}} ), {{ \"'\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2497, "supported_languages": null}, "macro.fivetran_utils.redshift__json_extract": {"unique_id": "macro.fivetran_utils.redshift__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "redshift__json_extract", "macro_sql": "{% macro redshift__json_extract(string, string_path) %}\n\n case when is_valid_json( {{string}} ) then json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} ) else null end\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.249861, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_extract": {"unique_id": "macro.fivetran_utils.bigquery__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "bigquery__json_extract", "macro_sql": "{% macro bigquery__json_extract(string, string_path) %}\n\n json_extract_scalar({{string}}, {{ \"'$.\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.250009, "supported_languages": null}, "macro.fivetran_utils.postgres__json_extract": {"unique_id": "macro.fivetran_utils.postgres__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "postgres__json_extract", "macro_sql": "{% macro postgres__json_extract(string, string_path) %}\n\n {{string}}::json->>{{\"'\" ~ string_path ~ \"'\" }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.25015, "supported_languages": null}, "macro.fivetran_utils.collect_freshness": {"unique_id": "macro.fivetran_utils.collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "name": "collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness')(source, loaded_at_field, filter))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.25086, "supported_languages": null}, "macro.fivetran_utils.default__collect_freshness": {"unique_id": "macro.fivetran_utils.default__collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "name": "default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n\n {%- set enabled_array = [] -%}\n {% for node in graph.sources.values() %}\n {% if node.identifier == source.identifier %}\n {% if (node.meta['is_enabled'] | default(true)) %}\n {%- do enabled_array.append(1) -%}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% set is_enabled = (enabled_array != []) %}\n\n select\n {% if is_enabled %}\n max({{ loaded_at_field }})\n {% else %} \n {{ current_timestamp() }} {% endif %} as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n\n {% if is_enabled %}\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endif %}\n\n {% endcall %}\n {{ return(load_result('collect_freshness').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2518022, "supported_languages": null}, "macro.fivetran_utils.timestamp_add": {"unique_id": "macro.fivetran_utils.timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "timestamp_add", "macro_sql": "{% macro timestamp_add(datepart, interval, from_timestamp) -%}\n\n{{ adapter.dispatch('timestamp_add', 'fivetran_utils') (datepart, interval, from_timestamp) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__timestamp_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2524989, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_add": {"unique_id": "macro.fivetran_utils.default__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "default__timestamp_add", "macro_sql": "{% macro default__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestampadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2526588, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_add": {"unique_id": "macro.fivetran_utils.bigquery__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "bigquery__timestamp_add", "macro_sql": "{% macro bigquery__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestamp_add({{ from_timestamp }}, interval {{ interval }} {{ datepart }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.25281, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_add": {"unique_id": "macro.fivetran_utils.redshift__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "redshift__timestamp_add", "macro_sql": "{% macro redshift__timestamp_add(datepart, interval, from_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2529652, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_add": {"unique_id": "macro.fivetran_utils.postgres__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "postgres__timestamp_add", "macro_sql": "{% macro postgres__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ from_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2531211, "supported_languages": null}, "macro.fivetran_utils.spark__timestamp_add": {"unique_id": "macro.fivetran_utils.spark__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "spark__timestamp_add", "macro_sql": "{% macro spark__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ dbt.dateadd(datepart, interval, from_timestamp) }}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2532952, "supported_languages": null}, "macro.fivetran_utils.ceiling": {"unique_id": "macro.fivetran_utils.ceiling", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "ceiling", "macro_sql": "{% macro ceiling(num) -%}\n\n{{ adapter.dispatch('ceiling', 'fivetran_utils') (num) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__ceiling"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2535932, "supported_languages": null}, "macro.fivetran_utils.default__ceiling": {"unique_id": "macro.fivetran_utils.default__ceiling", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "default__ceiling", "macro_sql": "{% macro default__ceiling(num) %}\n ceiling({{ num }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2536929, "supported_languages": null}, "macro.fivetran_utils.snowflake__ceiling": {"unique_id": "macro.fivetran_utils.snowflake__ceiling", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "snowflake__ceiling", "macro_sql": "{% macro snowflake__ceiling(num) %}\n ceil({{ num }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2538571, "supported_languages": null}, "macro.fivetran_utils.remove_prefix_from_columns": {"unique_id": "macro.fivetran_utils.remove_prefix_from_columns", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/remove_prefix_from_columns.sql", "original_file_path": "macros/remove_prefix_from_columns.sql", "name": "remove_prefix_from_columns", "macro_sql": "{% macro remove_prefix_from_columns(columns, prefix='', exclude=[]) %}\n\n {%- for col in columns if col.name not in exclude -%}\n {%- if col.name[:prefix|length]|lower == prefix -%}\n {{ col.name }} as {{ col.name[prefix|length:] }}\n {%- else -%}\n {{ col.name }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {% endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2545202, "supported_languages": null}, "macro.fivetran_utils.union_data": {"unique_id": "macro.fivetran_utils.union_data", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "name": "union_data", "macro_sql": "{% macro union_data(table_identifier, database_variable, schema_variable, default_database, default_schema, default_variable, union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('union_data', 'fivetran_utils') (\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__union_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2558541, "supported_languages": null}, "macro.fivetran_utils.default__union_data": {"unique_id": "macro.fivetran_utils.default__union_data", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "name": "default__union_data", "macro_sql": "{% macro default__union_data(\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) %}\n\n{% if var(union_schema_variable, none) %}\n\n {% set relations = [] %}\n \n {% if var(union_schema_variable) is string %}\n {% set trimmed = var(union_schema_variable)|trim('[')|trim(']') %}\n {% set schemas = trimmed.split(',')|map('trim',\" \")|map('trim','\"')|map('trim',\"'\") %}\n {% else %}\n {% set schemas = var(union_schema_variable) %}\n {% endif %}\n\n {% for schema in var(union_schema_variable) %}\n {% set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else var(database_variable, default_database),\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else schema,\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n \n {% set relation_exists=relation is not none %}\n\n {% if relation_exists %}\n\n {% do relations.append(relation) %}\n \n {% endif %}\n\n {% endfor %}\n\n {{ dbt_utils.union_relations(relations) }}\n\n{% elif var(union_database_variable, none) %}\n\n {% set relations = [] %}\n\n {% for database in var(union_database_variable) %}\n\n {% set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else database,\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else var(schema_variable, default_schema),\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n\n {% set relation_exists=relation is not none %}\n\n {% if relation_exists %}\n\n {% do relations.append(relation) %}\n \n {% endif %}\n\n {% endfor %}\n\n {{ dbt_utils.union_relations(relations) }}\n\n{% else %}\n\n select * \n from {{ var(default_variable) }}\n\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.258189, "supported_languages": null}, "macro.fivetran_utils.dummy_coalesce_value": {"unique_id": "macro.fivetran_utils.dummy_coalesce_value", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/dummy_coalesce_value.sql", "original_file_path": "macros/dummy_coalesce_value.sql", "name": "dummy_coalesce_value", "macro_sql": "{% macro dummy_coalesce_value(column) %}\n\n{% set coalesce_value = {\n 'STRING': \"'DUMMY_STRING'\",\n 'BOOLEAN': 'null',\n 'INT': 999999999,\n 'FLOAT': 999999999.99,\n 'TIMESTAMP': 'cast(\"2099-12-31\" as timestamp)',\n 'DATE': 'cast(\"2099-12-31\" as date)',\n} %}\n\n{% if column.is_float() %}\n{{ return(coalesce_value['FLOAT']) }}\n\n{% elif column.is_numeric() %}\n{{ return(coalesce_value['INT']) }}\n\n{% elif column.is_string() %}\n{{ return(coalesce_value['STRING']) }}\n\n{% elif column.data_type|lower == 'boolean' %}\n{{ return(coalesce_value['BOOLEAN']) }}\n\n{% elif 'timestamp' in column.data_type|lower %}\n{{ return(coalesce_value['TIMESTAMP']) }}\n\n{% elif 'date' in column.data_type|lower %}\n{{ return(coalesce_value['DATE']) }}\n\n{% elif 'int' in column.data_type|lower %}\n{{ return(coalesce_value['INT']) }}\n\n{% endif %}\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.259596, "supported_languages": null}, "macro.fivetran_utils.array_agg": {"unique_id": "macro.fivetran_utils.array_agg", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "array_agg", "macro_sql": "{% macro array_agg(field_to_agg) -%}\n\n{{ adapter.dispatch('array_agg', 'fivetran_utils') (field_to_agg) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__array_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.259916, "supported_languages": null}, "macro.fivetran_utils.default__array_agg": {"unique_id": "macro.fivetran_utils.default__array_agg", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "default__array_agg", "macro_sql": "{% macro default__array_agg(field_to_agg) %}\n array_agg({{ field_to_agg }})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2600162, "supported_languages": null}, "macro.fivetran_utils.redshift__array_agg": {"unique_id": "macro.fivetran_utils.redshift__array_agg", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "redshift__array_agg", "macro_sql": "{% macro redshift__array_agg(field_to_agg) %}\n listagg({{ field_to_agg }}, ',')\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2601101, "supported_languages": null}, "macro.fivetran_utils.empty_variable_warning": {"unique_id": "macro.fivetran_utils.empty_variable_warning", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/empty_variable_warning.sql", "original_file_path": "macros/empty_variable_warning.sql", "name": "empty_variable_warning", "macro_sql": "{% macro empty_variable_warning(variable, downstream_model) %}\n\n{% if not var(variable) %}\n{{ log(\n \"\"\"\n Warning: You have passed an empty list to the \"\"\" ~ variable ~ \"\"\".\n As a result, you won't see the history of any columns in the \"\"\" ~ downstream_model ~ \"\"\" model.\n \"\"\",\n info=True\n) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.260548, "supported_languages": null}, "macro.fivetran_utils.enabled_vars_one_true": {"unique_id": "macro.fivetran_utils.enabled_vars_one_true", "package_name": "fivetran_utils", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/enabled_vars_one_true.sql", "original_file_path": "macros/enabled_vars_one_true.sql", "name": "enabled_vars_one_true", "macro_sql": "{% macro enabled_vars_one_true(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, False) == True %}\n {{ return(True) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(False) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.260982, "supported_languages": null}, "macro.github_source.get_issue_columns": {"unique_id": "macro.github_source.get_issue_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_columns.sql", "original_file_path": "macros/get_issue_columns.sql", "name": "get_issue_columns", "macro_sql": "{% macro get_issue_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"body\", \"datatype\": dbt.type_string()},\n {\"name\": \"closed_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"locked\", \"datatype\": \"boolean\"},\n {\"name\": \"milestone_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"number\", \"datatype\": dbt.type_int()},\n {\"name\": \"pull_request\", \"datatype\": \"boolean\"},\n {\"name\": \"repository_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"state\", \"datatype\": dbt.type_string()},\n {\"name\": \"title\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"user_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.262527, "supported_languages": null}, "macro.github_source.get_issue_comment_columns": {"unique_id": "macro.github_source.get_issue_comment_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_comment_columns.sql", "original_file_path": "macros/get_issue_comment_columns.sql", "name": "get_issue_comment_columns", "macro_sql": "{% macro get_issue_comment_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"body\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"user_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2634282, "supported_languages": null}, "macro.github_source.get_repository_columns": {"unique_id": "macro.github_source.get_repository_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_repository_columns.sql", "original_file_path": "macros/get_repository_columns.sql", "name": "get_repository_columns", "macro_sql": "{% macro get_repository_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"archived\", \"datatype\": \"boolean\"},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"default_branch\", \"datatype\": dbt.type_string()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"fork\", \"datatype\": \"boolean\"},\n {\"name\": \"full_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"homepage\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"language\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"owner_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"private\", \"datatype\": \"boolean\"}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2648478, "supported_languages": null}, "macro.github_source.get_issue_merged_columns": {"unique_id": "macro.github_source.get_issue_merged_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_merged_columns.sql", "original_file_path": "macros/get_issue_merged_columns.sql", "name": "get_issue_merged_columns", "macro_sql": "{% macro get_issue_merged_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"actor_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"commit_sha\", \"datatype\": dbt.type_string()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"merged_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2655602, "supported_languages": null}, "macro.github_source.get_pull_request_review_columns": {"unique_id": "macro.github_source.get_pull_request_review_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_pull_request_review_columns.sql", "original_file_path": "macros/get_pull_request_review_columns.sql", "name": "get_pull_request_review_columns", "macro_sql": "{% macro get_pull_request_review_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"body\", \"datatype\": dbt.type_string()},\n {\"name\": \"commit_sha\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"pull_request_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"state\", \"datatype\": dbt.type_string()},\n {\"name\": \"submitted_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"user_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.266547, "supported_languages": null}, "macro.github_source.get_team_columns": {"unique_id": "macro.github_source.get_team_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_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_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"org_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"parent_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"privacy\", \"datatype\": dbt.type_string()},\n {\"name\": \"slug\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.267533, "supported_languages": null}, "macro.github_source.get_issue_assignee_columns": {"unique_id": "macro.github_source.get_issue_assignee_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_assignee_columns.sql", "original_file_path": "macros/get_issue_assignee_columns.sql", "name": "get_issue_assignee_columns", "macro_sql": "{% macro get_issue_assignee_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"user_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.268065, "supported_languages": null}, "macro.github_source.get_user_columns": {"unique_id": "macro.github_source.get_user_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_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\": \"company\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"login\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.268678, "supported_languages": null}, "macro.github_source.get_label_columns": {"unique_id": "macro.github_source.get_label_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_label_columns.sql", "original_file_path": "macros/get_label_columns.sql", "name": "get_label_columns", "macro_sql": "{% macro get_label_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"color\", \"datatype\": dbt.type_string()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"is_default\", \"datatype\": \"boolean\"},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"url\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.269556, "supported_languages": null}, "macro.github_source.get_pull_request_columns": {"unique_id": "macro.github_source.get_pull_request_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_pull_request_columns.sql", "original_file_path": "macros/get_pull_request_columns.sql", "name": "get_pull_request_columns", "macro_sql": "{% macro get_pull_request_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"base_label\", \"datatype\": dbt.type_string()},\n {\"name\": \"base_ref\", \"datatype\": dbt.type_string()},\n {\"name\": \"base_repo_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"base_sha\", \"datatype\": dbt.type_string()},\n {\"name\": \"base_user_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"head_label\", \"datatype\": dbt.type_string()},\n {\"name\": \"head_ref\", \"datatype\": dbt.type_string()},\n {\"name\": \"head_repo_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"head_sha\", \"datatype\": dbt.type_string()},\n {\"name\": \"head_user_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"merge_commit_sha\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2711759, "supported_languages": null}, "macro.github_source.get_requested_reviewer_history_columns": {"unique_id": "macro.github_source.get_requested_reviewer_history_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_requested_reviewer_history_columns.sql", "original_file_path": "macros/get_requested_reviewer_history_columns.sql", "name": "get_requested_reviewer_history_columns", "macro_sql": "{% macro get_requested_reviewer_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"actor_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"pull_request_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"removed\", \"datatype\": \"boolean\"},\n {\"name\": \"requested_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.271967, "supported_languages": null}, "macro.github_source.get_issue_closed_history_columns": {"unique_id": "macro.github_source.get_issue_closed_history_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_closed_history_columns.sql", "original_file_path": "macros/get_issue_closed_history_columns.sql", "name": "get_issue_closed_history_columns", "macro_sql": "{% macro get_issue_closed_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"actor_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"closed\", \"datatype\": \"boolean\"},\n {\"name\": \"commit_sha\", \"datatype\": dbt.type_string()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2727501, "supported_languages": null}, "macro.github_source.get_repo_team_columns": {"unique_id": "macro.github_source.get_repo_team_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_repo_team_columns.sql", "original_file_path": "macros/get_repo_team_columns.sql", "name": "get_repo_team_columns", "macro_sql": "{% macro get_repo_team_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"permission\", \"datatype\": dbt.type_string()},\n {\"name\": \"repository_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"team_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.273362, "supported_languages": null}, "macro.github_source.get_issue_label_columns": {"unique_id": "macro.github_source.get_issue_label_columns", "package_name": "github_source", "root_path": "/Users/catherinefritz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_label_columns.sql", "original_file_path": "macros/get_issue_label_columns.sql", "name": "get_issue_label_columns", "macro_sql": "{% macro get_issue_label_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"label_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667263067.2738838, "supported_languages": null}}, "docs": {"dbt.__overview__": {"unique_id": "dbt.__overview__", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-bigquery/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "overview.md", "original_file_path": "docs/overview.md", "name": "__overview__", "block_contents": "### Welcome!\n\nWelcome to the auto-generated documentation for your dbt project!\n\n### Navigation\n\nYou can use the `Project` and `Database` navigation tabs on the left side of the window to explore the models\nin your project.\n\n#### Project Tab\nThe `Project` tab mirrors the directory structure of your dbt project. In this tab, you can see all of the\nmodels defined in your dbt project, as well as models imported from dbt packages.\n\n#### Database Tab\nThe `Database` tab also exposes your models, but in a format that looks more like a database explorer. This view\nshows relations (tables and views) grouped into database schemas. Note that ephemeral models are _not_ shown\nin this interface, as they do not exist in the database.\n\n### Graph Exploration\nYou can click the blue icon on the bottom-right corner of the page to view the lineage graph of your models.\n\nOn model pages, you'll see the immediate parents and children of the model you're exploring. By clicking the `Expand`\nbutton at the top-right of this lineage pane, you'll be able to see all of the models that are used to build,\nor are built from, the model you're exploring.\n\nOnce expanded, you'll be able to use the `--select` and `--exclude` model selection syntax to filter the\nmodels in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax).\n\nNote that you can also right-click on models to interactively filter and explore the graph.\n\n---\n\n### More information\n\n- [What is dbt](https://docs.getdbt.com/docs/introduction)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [dbt Community](https://www.getdbt.com/community/) for questions and discussion"}}, "exposures": {}, "metrics": {}, "selectors": {}, "disabled": {}, "parent_map": {"seed.github_integration_tests.github_pull_request_review_data": [], "seed.github_integration_tests.github_label_data": [], "seed.github_integration_tests.github_repository_data": [], "seed.github_integration_tests.github_issue_merged_data": [], "seed.github_integration_tests.github_issue_data": [], "seed.github_integration_tests.github_repo_team_data": [], "seed.github_integration_tests.github_requested_reviewer_history_data": [], "seed.github_integration_tests.github_issue_label_data": [], "seed.github_integration_tests.github_issue_comment_data": [], "seed.github_integration_tests.github_issue_assignee_data": [], "seed.github_integration_tests.github_issue_closed_history_data": [], "seed.github_integration_tests.github_pull_request_data": [], "seed.github_integration_tests.github_team_data": [], "seed.github_integration_tests.github_user_data": [], "model.github.github__weekly_metrics": ["model.github.github__daily_metrics"], "model.github.github__monthly_metrics": ["model.github.github__daily_metrics"], "model.github.github__quarterly_metrics": ["model.github.github__daily_metrics"], "model.github.github__pull_requests": ["model.github.int_github__issue_joined"], "model.github.github__daily_metrics": ["model.github.github__issues", "model.github.github__pull_requests"], "model.github.github__issues": ["model.github.int_github__issue_joined"], "model.github.int_github__pull_request_times": ["model.github_source.stg_github__issue", "model.github_source.stg_github__issue_merged", "model.github_source.stg_github__pull_request", "model.github_source.stg_github__pull_request_review", "model.github_source.stg_github__requested_reviewer_history"], "model.github.int_github__pull_request_reviewers": ["model.github_source.stg_github__pull_request_review", "model.github_source.stg_github__user"], "model.github.int_github__issue_label_joined": ["model.github_source.stg_github__issue_label", "model.github_source.stg_github__label"], "model.github.int_github__issue_joined": ["model.github.int_github__issue_assignees", "model.github.int_github__issue_comments", "model.github.int_github__issue_labels", "model.github.int_github__issue_open_length", "model.github.int_github__pull_request_reviewers", "model.github.int_github__pull_request_times", "model.github.int_github__repository_teams", "model.github_source.stg_github__issue", "model.github_source.stg_github__pull_request", "model.github_source.stg_github__user"], "model.github.int_github__issue_labels": ["model.github.int_github__issue_label_joined"], "model.github.int_github__issue_assignees": ["model.github_source.stg_github__issue_assignee", "model.github_source.stg_github__user"], "model.github.int_github__issue_comments": ["model.github_source.stg_github__issue_comment"], "model.github.int_github__issue_open_length": ["model.github_source.stg_github__issue", "model.github_source.stg_github__issue_closed_history"], "model.github.int_github__repository_teams": ["model.github_source.stg_github__repo_team", "model.github_source.stg_github__repository", "model.github_source.stg_github__team"], "model.github_source.stg_github__issue_comment": ["model.github_source.stg_github__issue_comment_tmp", "model.github_source.stg_github__issue_comment_tmp"], "model.github_source.stg_github__requested_reviewer_history": ["model.github_source.stg_github__requested_reviewer_history_tmp", "model.github_source.stg_github__requested_reviewer_history_tmp"], "model.github_source.stg_github__issue_label": ["model.github_source.stg_github__issue_label_tmp", "model.github_source.stg_github__issue_label_tmp"], "model.github_source.stg_github__issue_merged": ["model.github_source.stg_github__issue_merged_tmp", "model.github_source.stg_github__issue_merged_tmp"], "model.github_source.stg_github__issue_closed_history": ["model.github_source.stg_github__issue_closed_history_tmp", "model.github_source.stg_github__issue_closed_history_tmp"], "model.github_source.stg_github__issue_assignee": ["model.github_source.stg_github__issue_assignee_tmp", "model.github_source.stg_github__issue_assignee_tmp"], "model.github_source.stg_github__repository": ["model.github_source.stg_github__repository_tmp", "model.github_source.stg_github__repository_tmp"], "model.github_source.stg_github__user": ["model.github_source.stg_github__user_tmp", "model.github_source.stg_github__user_tmp"], "model.github_source.stg_github__pull_request_review": ["model.github_source.stg_github__pull_request_review_tmp", "model.github_source.stg_github__pull_request_review_tmp"], "model.github_source.stg_github__repo_team": ["model.github_source.stg_github__repo_team_tmp", "model.github_source.stg_github__repo_team_tmp"], "model.github_source.stg_github__label": ["model.github_source.stg_github__label_tmp", "model.github_source.stg_github__label_tmp"], "model.github_source.stg_github__issue": ["model.github_source.stg_github__issue_tmp", "model.github_source.stg_github__issue_tmp"], "model.github_source.stg_github__team": ["model.github_source.stg_github__team_tmp", "model.github_source.stg_github__team_tmp"], "model.github_source.stg_github__pull_request": ["model.github_source.stg_github__pull_request_tmp", "model.github_source.stg_github__pull_request_tmp"], "model.github_source.stg_github__repository_tmp": ["source.github_source.github.repository"], "model.github_source.stg_github__label_tmp": ["source.github_source.github.label"], "model.github_source.stg_github__requested_reviewer_history_tmp": ["source.github_source.github.requested_reviewer_history"], "model.github_source.stg_github__issue_comment_tmp": ["source.github_source.github.issue_comment"], "model.github_source.stg_github__pull_request_review_tmp": ["source.github_source.github.pull_request_review"], "model.github_source.stg_github__issue_label_tmp": ["source.github_source.github.issue_label"], "model.github_source.stg_github__team_tmp": ["source.github_source.github.team"], "model.github_source.stg_github__pull_request_tmp": ["source.github_source.github.pull_request"], "model.github_source.stg_github__issue_merged_tmp": ["source.github_source.github.issue_merged"], "model.github_source.stg_github__user_tmp": ["source.github_source.github.user"], "model.github_source.stg_github__issue_closed_history_tmp": ["source.github_source.github.issue_closed_history"], "model.github_source.stg_github__issue_assignee_tmp": ["source.github_source.github.issue_assignee"], "model.github_source.stg_github__issue_tmp": ["source.github_source.github.issue"], "model.github_source.stg_github__repo_team_tmp": ["source.github_source.github.repo_team"], "test.github.unique_github__issues_issue_id.6723b9b1db": ["model.github.github__issues"], "test.github.not_null_github__issues_issue_id.fed0631e25": ["model.github.github__issues"], "test.github.unique_github__pull_requests_issue_id.ce23997907": ["model.github.github__pull_requests"], "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f": ["model.github.github__pull_requests"], "test.github.unique_github__daily_metrics_day.f98cab9456": ["model.github.github__daily_metrics"], "test.github.not_null_github__daily_metrics_day.647e494434": ["model.github.github__daily_metrics"], "test.github.unique_github__weekly_metrics_week.6794858a8e": ["model.github.github__weekly_metrics"], "test.github.not_null_github__weekly_metrics_week.4b0b928243": ["model.github.github__weekly_metrics"], "test.github.unique_github__monthly_metrics_month.3076284fbb": ["model.github.github__monthly_metrics"], "test.github.not_null_github__monthly_metrics_month.9e4fba84df": ["model.github.github__monthly_metrics"], "test.github.unique_github__quarterly_metrics_quarter.9165a921c1": ["model.github.github__quarterly_metrics"], "test.github.not_null_github__quarterly_metrics_quarter.92394d46dc": ["model.github.github__quarterly_metrics"], "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4": ["model.github_source.stg_github__issue_assignee"], "test.github_source.not_null_stg_github__label_label_id.9f07379974": ["model.github_source.stg_github__label"], "test.github_source.unique_stg_github__label_label_id.74d3c21466": ["model.github_source.stg_github__label"], "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d": ["model.github_source.stg_github__issue_closed_history"], "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a": ["model.github_source.stg_github__issue_comment"], "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f": ["model.github_source.stg_github__issue_comment"], "test.github_source.unique_stg_github__issue_issue_id.84891aeece": ["model.github_source.stg_github__issue"], "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7": ["model.github_source.stg_github__issue"], "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508": ["model.github_source.stg_github__pull_request_review"], "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790": ["model.github_source.stg_github__pull_request_review"], "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa": ["model.github_source.stg_github__pull_request"], "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71": ["model.github_source.stg_github__pull_request"], "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503": ["model.github_source.stg_github__repo_team"], "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c": ["model.github_source.stg_github__repo_team"], "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d": ["model.github_source.stg_github__repository"], "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f": ["model.github_source.stg_github__repository"], "test.github_source.unique_stg_github__team_team_id.94e9716ab4": ["model.github_source.stg_github__team"], "test.github_source.not_null_stg_github__team_team_id.440aefe7a7": ["model.github_source.stg_github__team"], "test.github_source.unique_stg_github__user_user_id.5c1a00cd90": ["model.github_source.stg_github__user"], "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b": ["model.github_source.stg_github__user"], "source.github_source.github.issue_assignee": [], "source.github_source.github.label": [], "source.github_source.github.issue_closed_history": [], "source.github_source.github.issue_label": [], "source.github_source.github.issue_comment": [], "source.github_source.github.issue_merged": [], "source.github_source.github.issue": [], "source.github_source.github.pull_request_review": [], "source.github_source.github.pull_request": [], "source.github_source.github.repo_team": [], "source.github_source.github.repository": [], "source.github_source.github.requested_reviewer_history": [], "source.github_source.github.team": [], "source.github_source.github.user": []}, "child_map": {"seed.github_integration_tests.github_pull_request_review_data": [], "seed.github_integration_tests.github_label_data": [], "seed.github_integration_tests.github_repository_data": [], "seed.github_integration_tests.github_issue_merged_data": [], "seed.github_integration_tests.github_issue_data": [], "seed.github_integration_tests.github_repo_team_data": [], "seed.github_integration_tests.github_requested_reviewer_history_data": [], "seed.github_integration_tests.github_issue_label_data": [], "seed.github_integration_tests.github_issue_comment_data": [], "seed.github_integration_tests.github_issue_assignee_data": [], "seed.github_integration_tests.github_issue_closed_history_data": [], "seed.github_integration_tests.github_pull_request_data": [], "seed.github_integration_tests.github_team_data": [], "seed.github_integration_tests.github_user_data": [], "model.github.github__weekly_metrics": ["test.github.not_null_github__weekly_metrics_week.4b0b928243", "test.github.unique_github__weekly_metrics_week.6794858a8e"], "model.github.github__monthly_metrics": ["test.github.not_null_github__monthly_metrics_month.9e4fba84df", "test.github.unique_github__monthly_metrics_month.3076284fbb"], "model.github.github__quarterly_metrics": ["test.github.not_null_github__quarterly_metrics_quarter.92394d46dc", "test.github.unique_github__quarterly_metrics_quarter.9165a921c1"], "model.github.github__pull_requests": ["model.github.github__daily_metrics", "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f", "test.github.unique_github__pull_requests_issue_id.ce23997907"], "model.github.github__daily_metrics": ["model.github.github__monthly_metrics", "model.github.github__quarterly_metrics", "model.github.github__weekly_metrics", "test.github.not_null_github__daily_metrics_day.647e494434", "test.github.unique_github__daily_metrics_day.f98cab9456"], "model.github.github__issues": ["model.github.github__daily_metrics", "test.github.not_null_github__issues_issue_id.fed0631e25", "test.github.unique_github__issues_issue_id.6723b9b1db"], "model.github.int_github__pull_request_times": ["model.github.int_github__issue_joined"], "model.github.int_github__pull_request_reviewers": ["model.github.int_github__issue_joined"], "model.github.int_github__issue_label_joined": ["model.github.int_github__issue_labels"], "model.github.int_github__issue_joined": ["model.github.github__issues", "model.github.github__pull_requests"], "model.github.int_github__issue_labels": ["model.github.int_github__issue_joined"], "model.github.int_github__issue_assignees": ["model.github.int_github__issue_joined"], "model.github.int_github__issue_comments": ["model.github.int_github__issue_joined"], "model.github.int_github__issue_open_length": ["model.github.int_github__issue_joined"], "model.github.int_github__repository_teams": ["model.github.int_github__issue_joined"], "model.github_source.stg_github__issue_comment": ["model.github.int_github__issue_comments", "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f", "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a"], "model.github_source.stg_github__requested_reviewer_history": ["model.github.int_github__pull_request_times"], "model.github_source.stg_github__issue_label": ["model.github.int_github__issue_label_joined"], "model.github_source.stg_github__issue_merged": ["model.github.int_github__pull_request_times"], "model.github_source.stg_github__issue_closed_history": ["model.github.int_github__issue_open_length", "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d"], "model.github_source.stg_github__issue_assignee": ["model.github.int_github__issue_assignees", "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4"], "model.github_source.stg_github__repository": ["model.github.int_github__repository_teams", "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f", "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d"], "model.github_source.stg_github__user": ["model.github.int_github__issue_assignees", "model.github.int_github__issue_joined", "model.github.int_github__pull_request_reviewers", "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b", "test.github_source.unique_stg_github__user_user_id.5c1a00cd90"], "model.github_source.stg_github__pull_request_review": ["model.github.int_github__pull_request_reviewers", "model.github.int_github__pull_request_times", "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790", "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508"], "model.github_source.stg_github__repo_team": ["model.github.int_github__repository_teams", "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503", "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c"], "model.github_source.stg_github__label": ["model.github.int_github__issue_label_joined", "test.github_source.not_null_stg_github__label_label_id.9f07379974", "test.github_source.unique_stg_github__label_label_id.74d3c21466"], "model.github_source.stg_github__issue": ["model.github.int_github__issue_joined", "model.github.int_github__issue_open_length", "model.github.int_github__pull_request_times", "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7", "test.github_source.unique_stg_github__issue_issue_id.84891aeece"], "model.github_source.stg_github__team": ["model.github.int_github__repository_teams", "test.github_source.not_null_stg_github__team_team_id.440aefe7a7", "test.github_source.unique_stg_github__team_team_id.94e9716ab4"], "model.github_source.stg_github__pull_request": ["model.github.int_github__issue_joined", "model.github.int_github__pull_request_times", "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71", "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa"], "model.github_source.stg_github__repository_tmp": ["model.github_source.stg_github__repository", "model.github_source.stg_github__repository"], "model.github_source.stg_github__label_tmp": ["model.github_source.stg_github__label", "model.github_source.stg_github__label"], "model.github_source.stg_github__requested_reviewer_history_tmp": ["model.github_source.stg_github__requested_reviewer_history", "model.github_source.stg_github__requested_reviewer_history"], "model.github_source.stg_github__issue_comment_tmp": ["model.github_source.stg_github__issue_comment", "model.github_source.stg_github__issue_comment"], "model.github_source.stg_github__pull_request_review_tmp": ["model.github_source.stg_github__pull_request_review", "model.github_source.stg_github__pull_request_review"], "model.github_source.stg_github__issue_label_tmp": ["model.github_source.stg_github__issue_label", "model.github_source.stg_github__issue_label"], "model.github_source.stg_github__team_tmp": ["model.github_source.stg_github__team", "model.github_source.stg_github__team"], "model.github_source.stg_github__pull_request_tmp": ["model.github_source.stg_github__pull_request", "model.github_source.stg_github__pull_request"], "model.github_source.stg_github__issue_merged_tmp": ["model.github_source.stg_github__issue_merged", "model.github_source.stg_github__issue_merged"], "model.github_source.stg_github__user_tmp": ["model.github_source.stg_github__user", "model.github_source.stg_github__user"], "model.github_source.stg_github__issue_closed_history_tmp": ["model.github_source.stg_github__issue_closed_history", "model.github_source.stg_github__issue_closed_history"], "model.github_source.stg_github__issue_assignee_tmp": ["model.github_source.stg_github__issue_assignee", "model.github_source.stg_github__issue_assignee"], "model.github_source.stg_github__issue_tmp": ["model.github_source.stg_github__issue", "model.github_source.stg_github__issue"], "model.github_source.stg_github__repo_team_tmp": ["model.github_source.stg_github__repo_team", "model.github_source.stg_github__repo_team"], "test.github.unique_github__issues_issue_id.6723b9b1db": [], "test.github.not_null_github__issues_issue_id.fed0631e25": [], "test.github.unique_github__pull_requests_issue_id.ce23997907": [], "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f": [], "test.github.unique_github__daily_metrics_day.f98cab9456": [], "test.github.not_null_github__daily_metrics_day.647e494434": [], "test.github.unique_github__weekly_metrics_week.6794858a8e": [], "test.github.not_null_github__weekly_metrics_week.4b0b928243": [], "test.github.unique_github__monthly_metrics_month.3076284fbb": [], "test.github.not_null_github__monthly_metrics_month.9e4fba84df": [], "test.github.unique_github__quarterly_metrics_quarter.9165a921c1": [], "test.github.not_null_github__quarterly_metrics_quarter.92394d46dc": [], "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4": [], "test.github_source.not_null_stg_github__label_label_id.9f07379974": [], "test.github_source.unique_stg_github__label_label_id.74d3c21466": [], "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d": [], "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a": [], "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f": [], "test.github_source.unique_stg_github__issue_issue_id.84891aeece": [], "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7": [], "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508": [], "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790": [], "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa": [], "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71": [], "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503": [], "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c": [], "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d": [], "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f": [], "test.github_source.unique_stg_github__team_team_id.94e9716ab4": [], "test.github_source.not_null_stg_github__team_team_id.440aefe7a7": [], "test.github_source.unique_stg_github__user_user_id.5c1a00cd90": [], "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b": [], "source.github_source.github.issue_assignee": ["model.github_source.stg_github__issue_assignee_tmp"], "source.github_source.github.label": ["model.github_source.stg_github__label_tmp"], "source.github_source.github.issue_closed_history": ["model.github_source.stg_github__issue_closed_history_tmp"], "source.github_source.github.issue_label": ["model.github_source.stg_github__issue_label_tmp"], "source.github_source.github.issue_comment": ["model.github_source.stg_github__issue_comment_tmp"], "source.github_source.github.issue_merged": ["model.github_source.stg_github__issue_merged_tmp"], "source.github_source.github.issue": ["model.github_source.stg_github__issue_tmp"], "source.github_source.github.pull_request_review": ["model.github_source.stg_github__pull_request_review_tmp"], "source.github_source.github.pull_request": ["model.github_source.stg_github__pull_request_tmp"], "source.github_source.github.repo_team": ["model.github_source.stg_github__repo_team_tmp"], "source.github_source.github.repository": ["model.github_source.stg_github__repository_tmp"], "source.github_source.github.requested_reviewer_history": ["model.github_source.stg_github__requested_reviewer_history_tmp"], "source.github_source.github.team": ["model.github_source.stg_github__team_tmp"], "source.github_source.github.user": ["model.github_source.stg_github__user_tmp"]}} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v7.json", "dbt_version": "1.3.0", "generated_at": "2022-11-07T19:30:30.182876Z", "invocation_id": "373a774a-fbd2-4652-b5ce-ec2e726cba75", "env": {}, "project_id": "b4ed7eda1f97e936d48d60e52edb4717", "user_id": "535a716f-60c0-47b9-9763-5e1b450166b6", "send_anonymous_usage_stats": true, "adapter_type": "bigquery"}, "nodes": {"seed.github_integration_tests.github_pull_request_review_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "INT64", "submitted_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_pull_request_review_data"], "unique_id": "seed.github_integration_tests.github_pull_request_review_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests", "path": "github_pull_request_review_data.csv", "original_file_path": "seeds/github_pull_request_review_data.csv", "name": "github_pull_request_review_data", "alias": "github_pull_request_review_data", "checksum": {"name": "sha256", "checksum": "4bdebf989d5e5d1bf41df343300be0a7e2a12f74b8148de6a97e75118edf0efa"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "submitted_at": "timestamp"}}, "created_at": 1667849268.624969, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_pull_request_review_data`"}, "seed.github_integration_tests.github_label_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "INT64"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_label_data"], "unique_id": "seed.github_integration_tests.github_label_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests", "path": "github_label_data.csv", "original_file_path": "seeds/github_label_data.csv", "name": "github_label_data", "alias": "github_label_data", "checksum": {"name": "sha256", "checksum": "f47357ad7761ae8e671c889ce5e385f6916b78cb669dfc65f09bacea1ecafb1f"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "created_at": 1667849268.64153, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_label_data`"}, "seed.github_integration_tests.github_repository_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "created_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_repository_data"], "unique_id": "seed.github_integration_tests.github_repository_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests", "path": "github_repository_data.csv", "original_file_path": "seeds/github_repository_data.csv", "name": "github_repository_data", "alias": "github_repository_data", "checksum": {"name": "sha256", "checksum": "78cd55c70468340db27d24a3fc299fc8c191129ca26ea80620a0d796a608a1a4"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"created_at": "timestamp"}}, "created_at": 1667849268.645775, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_repository_data`"}, "seed.github_integration_tests.github_issue_merged_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "merged_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_issue_merged_data"], "unique_id": "seed.github_integration_tests.github_issue_merged_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests", "path": "github_issue_merged_data.csv", "original_file_path": "seeds/github_issue_merged_data.csv", "name": "github_issue_merged_data", "alias": "github_issue_merged_data", "checksum": {"name": "sha256", "checksum": "397efa928dca45bafbdc11219b3335265bd9a6cce1447c02e07c0bf53ddaba31"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"merged_at": "timestamp"}}, "created_at": 1667849268.64978, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_merged_data`"}, "seed.github_integration_tests.github_issue_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "closed_at": "timestamp", "created_at": "timestamp", "updated_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_issue_data"], "unique_id": "seed.github_integration_tests.github_issue_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests", "path": "github_issue_data.csv", "original_file_path": "seeds/github_issue_data.csv", "name": "github_issue_data", "alias": "github_issue_data", "checksum": {"name": "sha256", "checksum": "6eabcc9bc0920d64775f8058446b279e803384a2205f18a07d7a2f1ebcf89286"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"closed_at": "timestamp", "created_at": "timestamp", "updated_at": "timestamp"}}, "created_at": 1667849268.653825, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_data`"}, "seed.github_integration_tests.github_repo_team_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_repo_team_data"], "unique_id": "seed.github_integration_tests.github_repo_team_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests", "path": "github_repo_team_data.csv", "original_file_path": "seeds/github_repo_team_data.csv", "name": "github_repo_team_data", "alias": "github_repo_team_data", "checksum": {"name": "sha256", "checksum": "3a16bf772f5f15231f0d7e26c116041543fad5a9dbdabbdfec30ddd063058722"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1667849268.65782, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_repo_team_data`"}, "seed.github_integration_tests.github_requested_reviewer_history_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "created_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_requested_reviewer_history_data"], "unique_id": "seed.github_integration_tests.github_requested_reviewer_history_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests", "path": "github_requested_reviewer_history_data.csv", "original_file_path": "seeds/github_requested_reviewer_history_data.csv", "name": "github_requested_reviewer_history_data", "alias": "github_requested_reviewer_history_data", "checksum": {"name": "sha256", "checksum": "91225ac95874fc314f772530dfcb6ece74f35c292ea5bba53ff86b599b902743"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"created_at": "timestamp"}}, "created_at": 1667849268.6619892, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_requested_reviewer_history_data`"}, "seed.github_integration_tests.github_issue_label_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "issue_id": "INT64", "label_id": "INT64"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_issue_label_data"], "unique_id": "seed.github_integration_tests.github_issue_label_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests", "path": "github_issue_label_data.csv", "original_file_path": "seeds/github_issue_label_data.csv", "name": "github_issue_label_data", "alias": "github_issue_label_data", "checksum": {"name": "sha256", "checksum": "847ef3245b5610a81f3d8e91b4787d24829b2b0d3d064c529a61d430e90f0585"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"issue_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "label_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "created_at": 1667849268.665987, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_label_data`"}, "seed.github_integration_tests.github_issue_comment_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "INT64"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_issue_comment_data"], "unique_id": "seed.github_integration_tests.github_issue_comment_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests", "path": "github_issue_comment_data.csv", "original_file_path": "seeds/github_issue_comment_data.csv", "name": "github_issue_comment_data", "alias": "github_issue_comment_data", "checksum": {"name": "sha256", "checksum": "6cc173c061308bc4de703c7c5d0fc30228b2c86117ed7db1daf9decf1a4238cd"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "created_at": 1667849268.6699939, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_comment_data`"}, "seed.github_integration_tests.github_issue_assignee_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_issue_assignee_data"], "unique_id": "seed.github_integration_tests.github_issue_assignee_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests", "path": "github_issue_assignee_data.csv", "original_file_path": "seeds/github_issue_assignee_data.csv", "name": "github_issue_assignee_data", "alias": "github_issue_assignee_data", "checksum": {"name": "sha256", "checksum": "fe25fadc4593349b873b50da5e2e2fbf436cbb3c1bcfe325c3340c64a7d8972b"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1667849268.674279, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_assignee_data`"}, "seed.github_integration_tests.github_issue_closed_history_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "updated_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_issue_closed_history_data"], "unique_id": "seed.github_integration_tests.github_issue_closed_history_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests", "path": "github_issue_closed_history_data.csv", "original_file_path": "seeds/github_issue_closed_history_data.csv", "name": "github_issue_closed_history_data", "alias": "github_issue_closed_history_data", "checksum": {"name": "sha256", "checksum": "5f281ce9e29e69280633dc6aae2e9f8028c86815442821a608bb793c82aab3f1"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"updated_at": "timestamp"}}, "created_at": 1667849268.678182, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_closed_history_data`"}, "seed.github_integration_tests.github_pull_request_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_pull_request_data"], "unique_id": "seed.github_integration_tests.github_pull_request_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests", "path": "github_pull_request_data.csv", "original_file_path": "seeds/github_pull_request_data.csv", "name": "github_pull_request_data", "alias": "github_pull_request_data", "checksum": {"name": "sha256", "checksum": "1e27d3e9b6881a3fda6402b048071032411d81612ff4b2009d852a194b137006"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1667849268.6820421, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_pull_request_data`"}, "seed.github_integration_tests.github_team_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_team_data"], "unique_id": "seed.github_integration_tests.github_team_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests", "path": "github_team_data.csv", "original_file_path": "seeds/github_team_data.csv", "name": "github_team_data", "alias": "github_team_data", "checksum": {"name": "sha256", "checksum": "a3916608387192c2bcec219067bd19e3280a23a3d4f546390e5d7e9aa16420bd"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1667849268.685923, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_team_data`"}, "seed.github_integration_tests.github_user_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_user_data"], "unique_id": "seed.github_integration_tests.github_user_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests", "path": "github_user_data.csv", "original_file_path": "seeds/github_user_data.csv", "name": "github_user_data", "alias": "github_user_data", "checksum": {"name": "sha256", "checksum": "5d101839c6a685fac17231a071c6516f3ac668b133d7a96a83d97ede20f16e46"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1667849268.690111, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_user_data`"}, "model.github.github__weekly_metrics": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.date_trunc"], "nodes": ["model.github.github__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "github__weekly_metrics"], "unique_id": "model.github.github__weekly_metrics", "raw_code": "with daily_metrics as (\n select *\n from {{ ref('github__daily_metrics') }}\n)\n\nselect \n {{ dbt.date_trunc('week', 'day') }} as week, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__weekly_metrics.sql", "original_file_path": "models/github__weekly_metrics.sql", "name": "github__weekly_metrics", "alias": "github__weekly_metrics", "checksum": {"name": "sha256", "checksum": "0c23e13d9ae5aa9256b832965069a021826131bbcf8c23be244b660d1a513870"}, "tags": [], "refs": [["github__daily_metrics"]], "sources": [], "metrics": [], "description": "Summary numbers for issues and pull requests by week\n", "columns": {"week": {"name": "week", "description": "The reporting week", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_opened": {"name": "number_issues_opened", "description": "The total number of issues created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_closed": {"name": "number_issues_closed", "description": "The total number of issues closed during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_issue_open": {"name": "avg_days_issue_open", "description": "The average number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_issue_open": {"name": "longest_days_issue_open", "description": "The longest number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_opened": {"name": "number_prs_opened", "description": "The total number of pull requests created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_merged": {"name": "number_prs_merged", "description": "The total number of pull requests merged during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_closed_without_merge": {"name": "number_prs_closed_without_merge", "description": "The total number of pull requests closed without a merge during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_pr_open": {"name": "avg_days_pr_open", "description": "The average number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_pr_open": {"name": "longest_days_pr_open", "description": "The longest number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__weekly_metrics.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667849269.493291, "compiled_code": "with daily_metrics as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`github__daily_metrics`\n)\n\nselect \n timestamp_trunc(\n cast(day as timestamp),\n week\n ) as week, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github__weekly_metrics`"}, "model.github.github__monthly_metrics": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.date_trunc"], "nodes": ["model.github.github__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "github__monthly_metrics"], "unique_id": "model.github.github__monthly_metrics", "raw_code": "with daily_metrics as (\n select *\n from {{ ref('github__daily_metrics') }}\n)\n\nselect \n {{ dbt.date_trunc('month', 'day') }} as month, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__monthly_metrics.sql", "original_file_path": "models/github__monthly_metrics.sql", "name": "github__monthly_metrics", "alias": "github__monthly_metrics", "checksum": {"name": "sha256", "checksum": "13125ad4966c9d1caa3cd74e6174cc3845a7ceb7929836e849e70628af2b0d0d"}, "tags": [], "refs": [["github__daily_metrics"]], "sources": [], "metrics": [], "description": "Summary numbers for issues and pull requests by month\n", "columns": {"month": {"name": "month", "description": "The reporting month", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_opened": {"name": "number_issues_opened", "description": "The total number of issues created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_closed": {"name": "number_issues_closed", "description": "The total number of issues closed during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_issue_open": {"name": "avg_days_issue_open", "description": "The average number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_issue_open": {"name": "longest_days_issue_open", "description": "The longest number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_opened": {"name": "number_prs_opened", "description": "The total number of pull requests created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_merged": {"name": "number_prs_merged", "description": "The total number of pull requests merged during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_closed_without_merge": {"name": "number_prs_closed_without_merge", "description": "The total number of pull requests closed without a merge during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_pr_open": {"name": "avg_days_pr_open", "description": "The average number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_pr_open": {"name": "longest_days_pr_open", "description": "The longest number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__monthly_metrics.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667849269.4994829, "compiled_code": "with daily_metrics as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`github__daily_metrics`\n)\n\nselect \n timestamp_trunc(\n cast(day as timestamp),\n month\n ) as month, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github__monthly_metrics`"}, "model.github.github__quarterly_metrics": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.date_trunc"], "nodes": ["model.github.github__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "github__quarterly_metrics"], "unique_id": "model.github.github__quarterly_metrics", "raw_code": "with daily_metrics as (\n select *\n from {{ ref('github__daily_metrics') }}\n)\n\nselect \n {{ dbt.date_trunc('quarter', 'day') }} as quarter, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\n\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__quarterly_metrics.sql", "original_file_path": "models/github__quarterly_metrics.sql", "name": "github__quarterly_metrics", "alias": "github__quarterly_metrics", "checksum": {"name": "sha256", "checksum": "482a40e9b5ae8283bec98905910cc35747f7f98accd058453d69064844533c50"}, "tags": [], "refs": [["github__daily_metrics"]], "sources": [], "metrics": [], "description": "Summary numbers for issues and pull requests by quarter\n", "columns": {"quarter": {"name": "quarter", "description": "The reporting quarter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_opened": {"name": "number_issues_opened", "description": "The total number of issues created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_closed": {"name": "number_issues_closed", "description": "The total number of issues closed during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_issue_open": {"name": "avg_days_issue_open", "description": "The average number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_issue_open": {"name": "longest_days_issue_open", "description": "The longest number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_opened": {"name": "number_prs_opened", "description": "The total number of pull requests created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_merged": {"name": "number_prs_merged", "description": "The total number of pull requests merged during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_closed_without_merge": {"name": "number_prs_closed_without_merge", "description": "The total number of pull requests closed without a merge during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_pr_open": {"name": "avg_days_pr_open", "description": "The average number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_pr_open": {"name": "longest_days_pr_open", "description": "The longest number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__quarterly_metrics.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667849269.505698, "compiled_code": "with daily_metrics as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`github__daily_metrics`\n)\n\nselect \n timestamp_trunc(\n cast(day as timestamp),\n quarter\n ) as quarter, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\n\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github__quarterly_metrics`"}, "model.github.github__pull_requests": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.github.int_github__issue_joined"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "github__pull_requests"], "unique_id": "model.github.github__pull_requests", "raw_code": "with issue_joined as (\n select *\n from {{ ref('int_github__issue_joined') }} \n)\n\nselect\n *\nfrom issue_joined\nwhere is_pull_request", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__pull_requests.sql", "original_file_path": "models/github__pull_requests.sql", "name": "github__pull_requests", "alias": "github__pull_requests", "checksum": {"name": "sha256", "checksum": "ab4761ae05c0aabc7585d92ed7c68e12b53317a47a4278810e1777a051f43350"}, "tags": [], "refs": [["int_github__issue_joined"]], "sources": [], "metrics": [], "description": "Basic information about pull_requests as well as additional fields about reviews and time between actions\n", "columns": {"issue_id": {"name": "issue_id", "description": "The unique ID of an issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "body": {"name": "body", "description": "the text body of the description of the pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed_at": {"name": "closed_at", "description": "Timestamp of when the pull request was closed. NULL for pull requests that are still open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the pull request was created", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_locked": {"name": "is_locked", "description": "Boolean indicating whether the issue is locked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "milestone_id": {"name": "milestone_id", "description": "Foreign key that references the milestone.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_pull_request": {"name": "is_pull_request", "description": "Boolean indiciating whether the issue is a pull request.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_number": {"name": "issue_number", "description": "The number of the pull request. Unique within a repository, but not accross.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_id": {"name": "repository_id", "description": "Foreign key that references the repository table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the issue was last updated", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "days_issue_open": {"name": "days_issue_open", "description": "The number of days an issue has been open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_times_reopened": {"name": "number_of_times_reopened", "description": "Total number of times the issue was reopened", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_comments": {"name": "number_of_comments", "description": "The total number of comments included in the issue", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_login_name": {"name": "creator_login_name", "description": "User that created the issue login name", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_name": {"name": "creator_name", "description": "User that created the issue name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_company": {"name": "creator_company", "description": "User that created the issue company name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the pull request is open or closed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url_link": {"name": "url_link", "description": "A link to the pull request on github.com", "meta": {}, "data_type": null, "quote": null, "tags": []}, "labels": {"name": "labels", "description": "The labels currently applied to the pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository": {"name": "repository", "description": "The repository that the pull request applies to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_team_names": {"name": "repository_team_names", "description": "An aggreate of the teams associated with the repository", "meta": {}, "data_type": null, "quote": null, "tags": []}, "assignees": {"name": "assignees", "description": "Users who have been assigned to the pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hours_request_review_to_first_review": {"name": "hours_request_review_to_first_review", "description": "Number of hours between the first request for review and a review", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hours_request_review_to_first_action": {"name": "hours_request_review_to_first_action", "description": "Number of hours between the first request for review and any action besides dismissing the request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hours_request_review_to_merge": {"name": "hours_request_review_to_merge", "description": "Number of hours between the first request for review and the pull request being merged", "meta": {}, "data_type": null, "quote": null, "tags": []}, "merged_at": {"name": "merged_at", "description": "Timestamp of when the pull request was merged", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reviewers": {"name": "reviewers", "description": "List of Users who reviewed the pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_reviews": {"name": "number_of_reviews", "description": "Number of times a pull request was reviewed", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__pull_requests.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667849269.4811258, "compiled_code": "with __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n), __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n), __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n), __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n), __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n), __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n), __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n), __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n), __dbt__cte__int_github__issue_joined as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_labels as (\n select *\n from __dbt__cte__int_github__issue_labels\n), \n\nrepository_teams as (\n select \n \n *\n from __dbt__cte__int_github__repository_teams\n\n \n), \n\nissue_assignees as (\n select *\n from __dbt__cte__int_github__issue_assignees\n), \n\nissue_open_length as (\n select *\n from __dbt__cte__int_github__issue_open_length\n), \n\nissue_comments as (\n select *\n from __dbt__cte__int_github__issue_comments\n), \n\ncreator as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n), \n\npull_request_times as (\n select *\n from __dbt__cte__int_github__pull_request_times\n), \n\npull_request_reviewers as (\n select *\n from __dbt__cte__int_github__pull_request_reviewers\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then 'https://github.com/' || repository_teams.repository || '/pull/' || issue.issue_number\n else 'https://github.com/' || repository_teams.repository || '/issues/' || issue.issue_number\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n \n repository_teams.repository_team_names,\n \n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id\n),issue_joined as (\n select *\n from __dbt__cte__int_github__issue_joined \n)\n\nselect\n *\nfrom issue_joined\nwhere is_pull_request", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.github.int_github__issue_label_joined", "sql": " __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n)"}, {"id": "model.github.int_github__issue_labels", "sql": " __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n)"}, {"id": "model.github.int_github__repository_teams", "sql": " __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n)"}, {"id": "model.github.int_github__issue_assignees", "sql": " __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n)"}, {"id": "model.github.int_github__issue_open_length", "sql": " __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n)"}, {"id": "model.github.int_github__issue_comments", "sql": " __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n)"}, {"id": "model.github.int_github__pull_request_times", "sql": " __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n)"}, {"id": "model.github.int_github__pull_request_reviewers", "sql": " __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n)"}, {"id": "model.github.int_github__issue_joined", "sql": " __dbt__cte__int_github__issue_joined as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_labels as (\n select *\n from __dbt__cte__int_github__issue_labels\n), \n\nrepository_teams as (\n select \n \n *\n from __dbt__cte__int_github__repository_teams\n\n \n), \n\nissue_assignees as (\n select *\n from __dbt__cte__int_github__issue_assignees\n), \n\nissue_open_length as (\n select *\n from __dbt__cte__int_github__issue_open_length\n), \n\nissue_comments as (\n select *\n from __dbt__cte__int_github__issue_comments\n), \n\ncreator as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n), \n\npull_request_times as (\n select *\n from __dbt__cte__int_github__pull_request_times\n), \n\npull_request_reviewers as (\n select *\n from __dbt__cte__int_github__pull_request_reviewers\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then 'https://github.com/' || repository_teams.repository || '/pull/' || issue.issue_number\n else 'https://github.com/' || repository_teams.repository || '/issues/' || issue.issue_number\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n \n repository_teams.repository_team_names,\n \n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id\n)"}], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github__pull_requests`"}, "model.github.github__daily_metrics": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.date_trunc"], "nodes": ["model.github.github__issues", "model.github.github__pull_requests"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "github__daily_metrics"], "unique_id": "model.github.github__daily_metrics", "raw_code": "with github_issues as (\n select *\n from {{ ref('github__issues') }}\n), \n\npull_requests as (\n select *\n from {{ ref('github__pull_requests') }}\n), \n\nissues_opened_per_day as (\n select \n {{ dbt.date_trunc('day', 'created_at') }} as day, \n count(*) as number_issues_opened,\n sum(days_issue_open) as sum_days_issue_open,\n max(days_issue_open) as longest_days_issue_open\n from github_issues\n group by 1\n), \n\nissues_closed_per_day as (\n select \n {{ dbt.date_trunc('day', 'closed_at') }} as day, \n count(*) as number_issues_closed\n from github_issues\n where closed_at is not null\n group by 1\n), \n\nprs_opened_per_day as (\n select \n {{ dbt.date_trunc('day', 'created_at') }} as day, \n count(*) as number_prs_opened,\n sum(days_issue_open) as sum_days_pr_open,\n max(days_issue_open) as longest_days_pr_open\n from pull_requests\n group by 1\n), \n\nprs_merged_per_day as (\n select \n {{ dbt.date_trunc('day', 'merged_at') }} as day, \n count(*) as number_prs_merged\n from pull_requests\n where merged_at is not null\n group by 1\n), \n\nprs_closed_without_merge_per_day as (\n select \n {{ dbt.date_trunc('day', 'closed_at') }} as day, \n count(*) as number_prs_closed_without_merge\n from pull_requests\n where closed_at is not null\n and merged_at is null\n group by 1\n), \n\nissues_per_day as (\n select \n coalesce(issues_opened_per_day.day, \n issues_closed_per_day.day\n ) as day,\n number_issues_opened,\n number_issues_closed, \n sum_days_issue_open,\n longest_days_issue_open\n from issues_opened_per_day\n full outer join issues_closed_per_day on issues_opened_per_day.day = issues_closed_per_day.day\n), \n\nprs_per_day as (\n select \n coalesce(prs_opened_per_day.day, \n prs_merged_per_day.day,\n prs_closed_without_merge_per_day.day\n ) as day,\n number_prs_opened,\n number_prs_merged,\n number_prs_closed_without_merge,\n sum_days_pr_open,\n longest_days_pr_open\n from prs_opened_per_day\n full outer join prs_merged_per_day on prs_opened_per_day.day = prs_merged_per_day.day\n full outer join prs_closed_without_merge_per_day on coalesce(prs_opened_per_day.day, prs_merged_per_day.day) = prs_closed_without_merge_per_day.day\n)\n\nselect \n coalesce(issues_per_day.day, prs_per_day.day) as day,\n coalesce(number_issues_opened, 0) as number_issues_opened,\n coalesce(number_issues_closed, 0) as number_issues_closed,\n sum_days_issue_open,\n longest_days_issue_open,\n coalesce(number_prs_opened, 0) as number_prs_opened,\n coalesce(number_prs_merged, 0) as number_prs_merged,\n coalesce(number_prs_closed_without_merge, 0) as number_prs_closed_without_merge,\n sum_days_pr_open,\n longest_days_pr_open\nfrom issues_per_day \nfull outer join prs_per_day on issues_per_day.day = prs_per_day.day\norder by day desc", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__daily_metrics.sql", "original_file_path": "models/github__daily_metrics.sql", "name": "github__daily_metrics", "alias": "github__daily_metrics", "checksum": {"name": "sha256", "checksum": "a6ee3eb9c8198f8b11e48b8e0206e90860a02af8a20f748985a58499dde4f476"}, "tags": [], "refs": [["github__issues"], ["github__pull_requests"]], "sources": [], "metrics": [], "description": "Summary numbers for issues and pull requests by day\n", "columns": {"day": {"name": "day", "description": "The reporting day", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_opened": {"name": "number_issues_opened", "description": "The total number of issues created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_closed": {"name": "number_issues_closed", "description": "The total number of issues closed during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sum_days_issue_open": {"name": "sum_days_issue_open", "description": "The total number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_issue_open": {"name": "longest_days_issue_open", "description": "The longest number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_opened": {"name": "number_prs_opened", "description": "The total number of pull requests created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_merged": {"name": "number_prs_merged", "description": "The total number of pull requests merged during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_closed_without_merge": {"name": "number_prs_closed_without_merge", "description": "The total number of pull requests closed without a merge during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sum_days_pr_open": {"name": "sum_days_pr_open", "description": "The total number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_pr_open": {"name": "longest_days_pr_open", "description": "The longest number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__daily_metrics.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667849269.487303, "compiled_code": "with github_issues as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`github__issues`\n), \n\npull_requests as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`github__pull_requests`\n), \n\nissues_opened_per_day as (\n select \n timestamp_trunc(\n cast(created_at as timestamp),\n day\n ) as day, \n count(*) as number_issues_opened,\n sum(days_issue_open) as sum_days_issue_open,\n max(days_issue_open) as longest_days_issue_open\n from github_issues\n group by 1\n), \n\nissues_closed_per_day as (\n select \n timestamp_trunc(\n cast(closed_at as timestamp),\n day\n ) as day, \n count(*) as number_issues_closed\n from github_issues\n where closed_at is not null\n group by 1\n), \n\nprs_opened_per_day as (\n select \n timestamp_trunc(\n cast(created_at as timestamp),\n day\n ) as day, \n count(*) as number_prs_opened,\n sum(days_issue_open) as sum_days_pr_open,\n max(days_issue_open) as longest_days_pr_open\n from pull_requests\n group by 1\n), \n\nprs_merged_per_day as (\n select \n timestamp_trunc(\n cast(merged_at as timestamp),\n day\n ) as day, \n count(*) as number_prs_merged\n from pull_requests\n where merged_at is not null\n group by 1\n), \n\nprs_closed_without_merge_per_day as (\n select \n timestamp_trunc(\n cast(closed_at as timestamp),\n day\n ) as day, \n count(*) as number_prs_closed_without_merge\n from pull_requests\n where closed_at is not null\n and merged_at is null\n group by 1\n), \n\nissues_per_day as (\n select \n coalesce(issues_opened_per_day.day, \n issues_closed_per_day.day\n ) as day,\n number_issues_opened,\n number_issues_closed, \n sum_days_issue_open,\n longest_days_issue_open\n from issues_opened_per_day\n full outer join issues_closed_per_day on issues_opened_per_day.day = issues_closed_per_day.day\n), \n\nprs_per_day as (\n select \n coalesce(prs_opened_per_day.day, \n prs_merged_per_day.day,\n prs_closed_without_merge_per_day.day\n ) as day,\n number_prs_opened,\n number_prs_merged,\n number_prs_closed_without_merge,\n sum_days_pr_open,\n longest_days_pr_open\n from prs_opened_per_day\n full outer join prs_merged_per_day on prs_opened_per_day.day = prs_merged_per_day.day\n full outer join prs_closed_without_merge_per_day on coalesce(prs_opened_per_day.day, prs_merged_per_day.day) = prs_closed_without_merge_per_day.day\n)\n\nselect \n coalesce(issues_per_day.day, prs_per_day.day) as day,\n coalesce(number_issues_opened, 0) as number_issues_opened,\n coalesce(number_issues_closed, 0) as number_issues_closed,\n sum_days_issue_open,\n longest_days_issue_open,\n coalesce(number_prs_opened, 0) as number_prs_opened,\n coalesce(number_prs_merged, 0) as number_prs_merged,\n coalesce(number_prs_closed_without_merge, 0) as number_prs_closed_without_merge,\n sum_days_pr_open,\n longest_days_pr_open\nfrom issues_per_day \nfull outer join prs_per_day on issues_per_day.day = prs_per_day.day\norder by day desc", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github__daily_metrics`"}, "model.github.github__issues": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.github.int_github__issue_joined"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "github__issues"], "unique_id": "model.github.github__issues", "raw_code": "with issue_joined as (\n select *\n from {{ ref('int_github__issue_joined') }} \n)\n\nselect\n issue_id,\n body,\n closed_at,\n created_at,\n is_locked,\n milestone_id,\n issue_number,\n is_pull_request,\n repository_id,\n state,\n title,\n updated_at,\n user_id,\n url_link,\n days_issue_open,\n number_of_times_reopened,\n labels,\n number_of_comments,\n repository,\n {% if var('github__using_repo_team', true) %}\n repository_team_names,\n {% endif %}\n assignees,\n creator_login_name,\n creator_name,\n creator_company\nfrom issue_joined\nwhere not is_pull_request", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__issues.sql", "original_file_path": "models/github__issues.sql", "name": "github__issues", "alias": "github__issues", "checksum": {"name": "sha256", "checksum": "382d94f82ea63be958d53cc7353d6e3e792844f45ab9c48609e03355eb68a133"}, "tags": [], "refs": [["int_github__issue_joined"]], "sources": [], "metrics": [], "description": "Basic information about issues as well as additional fields for things like assignees, projects, labels and open time\n", "columns": {"issue_id": {"name": "issue_id", "description": "The unique ID of an issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "body": {"name": "body", "description": "The text body of the issue's main description", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed_at": {"name": "closed_at", "description": "The timestamp for when an issue was last closed. \"null\" for issues that are open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The timestamp for when an issue was created", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_locked": {"name": "is_locked", "description": "Boolean indicating if the issue is locked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "milestone_id": {"name": "milestone_id", "description": "Foreign key that references the milestone table representing the current milestone the issue is in", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_number": {"name": "issue_number", "description": "The number of the issue. Is unique within a repository, but not accross", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_pull_request": {"name": "is_pull_request", "description": "Boolean indicating whether the issue is a pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_id": {"name": "repository_id", "description": "Foreign key that references the repository table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the issue is open or closed", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the issue", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the issue was last updated", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url_link": {"name": "url_link", "description": "a link to the issue on github.com", "meta": {}, "data_type": null, "quote": null, "tags": []}, "days_issue_open": {"name": "days_issue_open", "description": "The number of days an issue has been open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_times_reopened": {"name": "number_of_times_reopened", "description": "Total number of times the issue was reopened", "meta": {}, "data_type": null, "quote": null, "tags": []}, "labels": {"name": "labels", "description": "A list of the labels that are currently applied to the issue", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_comments": {"name": "number_of_comments", "description": "The total number of comments included in the issue", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_login_name": {"name": "creator_login_name", "description": "User that created the issue login name", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_name": {"name": "creator_name", "description": "User that created the issue name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_company": {"name": "creator_company", "description": "User that created the issue company name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository": {"name": "repository", "description": "The repository that the issue is applicable to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_team_names": {"name": "repository_team_names", "description": "An aggreate of the teams associated with the repository", "meta": {}, "data_type": null, "quote": null, "tags": []}, "assignees": {"name": "assignees", "description": "The current list of users assigned to the issue", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__issues.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667849269.4645278, "compiled_code": "with __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n), __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n), __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n), __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n), __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n), __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n), __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n), __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n), __dbt__cte__int_github__issue_joined as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_labels as (\n select *\n from __dbt__cte__int_github__issue_labels\n), \n\nrepository_teams as (\n select \n \n *\n from __dbt__cte__int_github__repository_teams\n\n \n), \n\nissue_assignees as (\n select *\n from __dbt__cte__int_github__issue_assignees\n), \n\nissue_open_length as (\n select *\n from __dbt__cte__int_github__issue_open_length\n), \n\nissue_comments as (\n select *\n from __dbt__cte__int_github__issue_comments\n), \n\ncreator as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n), \n\npull_request_times as (\n select *\n from __dbt__cte__int_github__pull_request_times\n), \n\npull_request_reviewers as (\n select *\n from __dbt__cte__int_github__pull_request_reviewers\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then 'https://github.com/' || repository_teams.repository || '/pull/' || issue.issue_number\n else 'https://github.com/' || repository_teams.repository || '/issues/' || issue.issue_number\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n \n repository_teams.repository_team_names,\n \n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id\n),issue_joined as (\n select *\n from __dbt__cte__int_github__issue_joined \n)\n\nselect\n issue_id,\n body,\n closed_at,\n created_at,\n is_locked,\n milestone_id,\n issue_number,\n is_pull_request,\n repository_id,\n state,\n title,\n updated_at,\n user_id,\n url_link,\n days_issue_open,\n number_of_times_reopened,\n labels,\n number_of_comments,\n repository,\n \n repository_team_names,\n \n assignees,\n creator_login_name,\n creator_name,\n creator_company\nfrom issue_joined\nwhere not is_pull_request", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.github.int_github__issue_label_joined", "sql": " __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n)"}, {"id": "model.github.int_github__issue_labels", "sql": " __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n)"}, {"id": "model.github.int_github__repository_teams", "sql": " __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n)"}, {"id": "model.github.int_github__issue_assignees", "sql": " __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n)"}, {"id": "model.github.int_github__issue_open_length", "sql": " __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n)"}, {"id": "model.github.int_github__issue_comments", "sql": " __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n)"}, {"id": "model.github.int_github__pull_request_times", "sql": " __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n)"}, {"id": "model.github.int_github__pull_request_reviewers", "sql": " __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n)"}, {"id": "model.github.int_github__issue_joined", "sql": " __dbt__cte__int_github__issue_joined as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_labels as (\n select *\n from __dbt__cte__int_github__issue_labels\n), \n\nrepository_teams as (\n select \n \n *\n from __dbt__cte__int_github__repository_teams\n\n \n), \n\nissue_assignees as (\n select *\n from __dbt__cte__int_github__issue_assignees\n), \n\nissue_open_length as (\n select *\n from __dbt__cte__int_github__issue_open_length\n), \n\nissue_comments as (\n select *\n from __dbt__cte__int_github__issue_comments\n), \n\ncreator as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n), \n\npull_request_times as (\n select *\n from __dbt__cte__int_github__pull_request_times\n), \n\npull_request_reviewers as (\n select *\n from __dbt__cte__int_github__pull_request_reviewers\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then 'https://github.com/' || repository_teams.repository || '/pull/' || issue.issue_number\n else 'https://github.com/' || repository_teams.repository || '/issues/' || issue.issue_number\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n \n repository_teams.repository_team_names,\n \n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id\n)"}], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github__issues`"}, "model.github.int_github__pull_request_times": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt.datediff"], "nodes": ["model.github_source.stg_github__pull_request_review", "model.github_source.stg_github__pull_request", "model.github_source.stg_github__requested_reviewer_history", "model.github_source.stg_github__issue", "model.github_source.stg_github__issue_merged"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__pull_request_times"], "unique_id": "model.github.int_github__pull_request_times", "raw_code": "with pull_request_review as (\n select *\n from {{ var('pull_request_review') }}\n), \n\npull_request as (\n select *\n from {{ var('pull_request')}}\n), \n\nrequested_reviewer_history as (\n select *\n from {{ var('requested_reviewer_history')}}\n where not removed\n), \n\nissue as (\n select *\n from {{ var('issue') }}\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from {{ var('issue_merged')}}\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n {{ dbt.datediff(\n 'time_of_first_request', \n \"coalesce(time_of_first_review_post_request, \" ~ dbt.current_timestamp_backcompat() ~ \")\", \n 'second') \n }}/ 60/60 as hours_request_review_to_first_review,\n {{ dbt.datediff(\n 'time_of_first_request', \n \"least(\n coalesce(time_of_first_requested_reviewer_review, \" ~ dbt.current_timestamp_backcompat() ~ \"),\n coalesce(issue.closed_at, \" ~ dbt.current_timestamp_backcompat() ~ \"))\", \n 'second') \n }} / 60/60 as hours_request_review_to_first_action,\n {{ dbt.datediff('time_of_first_request', 'merged_at', 'second') }}/ 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__pull_request_times.sql", "original_file_path": "models/intermediate/int_github__pull_request_times.sql", "name": "int_github__pull_request_times", "alias": "int_github__pull_request_times", "checksum": {"name": "sha256", "checksum": "35a197fef6ef12f2b408564be9d54b15ba8ff1eee0cf8514abedef9f7818422c"}, "tags": [], "refs": [["stg_github__pull_request_review"], ["stg_github__pull_request"], ["stg_github__requested_reviewer_history"], ["stg_github__issue"], ["stg_github__issue_merged"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__pull_request_times.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1667849268.867358, "compiled_code": "with pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__pull_request_reviewers": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.github_source.stg_github__pull_request_review", "model.github_source.stg_github__user"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__pull_request_reviewers"], "unique_id": "model.github.int_github__pull_request_reviewers", "raw_code": "with pull_request_review as (\n select *\n from {{ var('pull_request_review') }}\n), \n\ngithub_user as (\n select *\n from {{ var('user')}}\n)\n\nselect\n pull_request_review.pull_request_id,\n {{ fivetran_utils.string_agg( 'github_user.login_name', \"', '\" )}} as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__pull_request_reviewers.sql", "original_file_path": "models/intermediate/int_github__pull_request_reviewers.sql", "name": "int_github__pull_request_reviewers", "alias": "int_github__pull_request_reviewers", "checksum": {"name": "sha256", "checksum": "fd5518273ce75ae9066be686308ee078ce9a3df73f3799620f8eb6e611655cd7"}, "tags": [], "refs": [["stg_github__pull_request_review"], ["stg_github__user"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__pull_request_reviewers.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1667849268.895701, "compiled_code": "with pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__issue_label_joined": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.github_source.stg_github__issue_label", "model.github_source.stg_github__label"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_label_joined"], "unique_id": "model.github.int_github__issue_label_joined", "raw_code": "with issue_label as (\n\n select *\n from {{ var('issue_label') }}\n\n), label as (\n\n select *\n from {{ var('label') }}\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_label_joined.sql", "original_file_path": "models/intermediate/int_github__issue_label_joined.sql", "name": "int_github__issue_label_joined", "alias": "int_github__issue_label_joined", "checksum": {"name": "sha256", "checksum": "6f1b225ff9958e67fae4ea1ba0be10ebb9426da364c758c37d0b83305d575d98"}, "tags": [], "refs": [["stg_github__issue_label"], ["stg_github__label"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_label_joined.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1667849268.909966, "compiled_code": "with issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__issue_joined": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.concat"], "nodes": ["model.github_source.stg_github__issue", "model.github.int_github__issue_labels", "model.github.int_github__repository_teams", "model.github.int_github__issue_assignees", "model.github.int_github__issue_open_length", "model.github.int_github__issue_comments", "model.github_source.stg_github__user", "model.github.int_github__pull_request_times", "model.github.int_github__pull_request_reviewers", "model.github_source.stg_github__pull_request"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_joined"], "unique_id": "model.github.int_github__issue_joined", "raw_code": "with issue as (\n select *\n from {{ var('issue') }}\n), \n\nissue_labels as (\n select *\n from {{ ref('int_github__issue_labels')}}\n), \n\nrepository_teams as (\n select \n {% if var('github__using_repo_team', true) %}\n *\n from {{ ref('int_github__repository_teams') }}\n\n {% else %}\n repository_id,\n full_name as repository\n from {{ var('repository') }}\n\n {% endif %}\n), \n\nissue_assignees as (\n select *\n from {{ ref('int_github__issue_assignees')}}\n), \n\nissue_open_length as (\n select *\n from {{ ref('int_github__issue_open_length')}}\n), \n\nissue_comments as (\n select *\n from {{ ref('int_github__issue_comments')}}\n), \n\ncreator as (\n select *\n from {{ var('user')}}\n), \n\npull_request_times as (\n select *\n from {{ ref('int_github__pull_request_times')}}\n), \n\npull_request_reviewers as (\n select *\n from {{ ref('int_github__pull_request_reviewers')}}\n), \n\npull_request as (\n select *\n from {{ var('pull_request')}}\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then {{ dbt.concat([\"'https://github.com/'\",'repository_teams.repository',\"'/pull/'\", 'issue.issue_number']) }}\n else {{ dbt.concat([\"'https://github.com/'\",'repository_teams.repository',\"'/issues/'\", 'issue.issue_number']) }}\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n {% if var('github__using_repo_team', true) %}\n repository_teams.repository_team_names,\n {% endif %}\n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_joined.sql", "original_file_path": "models/intermediate/int_github__issue_joined.sql", "name": "int_github__issue_joined", "alias": "int_github__issue_joined", "checksum": {"name": "sha256", "checksum": "75658855b696a3744360bbbf58433d6155e44d35128236e08da3df93b87ead16"}, "tags": [], "refs": [["stg_github__issue"], ["int_github__issue_labels"], ["int_github__repository_teams"], ["int_github__issue_assignees"], ["int_github__issue_open_length"], ["int_github__issue_comments"], ["stg_github__user"], ["int_github__pull_request_times"], ["int_github__pull_request_reviewers"], ["stg_github__pull_request"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_joined.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1667849268.920543, "compiled_code": "with __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n), __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n), __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n), __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n), __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n), __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n), __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n), __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n),issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_labels as (\n select *\n from __dbt__cte__int_github__issue_labels\n), \n\nrepository_teams as (\n select \n \n *\n from __dbt__cte__int_github__repository_teams\n\n \n), \n\nissue_assignees as (\n select *\n from __dbt__cte__int_github__issue_assignees\n), \n\nissue_open_length as (\n select *\n from __dbt__cte__int_github__issue_open_length\n), \n\nissue_comments as (\n select *\n from __dbt__cte__int_github__issue_comments\n), \n\ncreator as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n), \n\npull_request_times as (\n select *\n from __dbt__cte__int_github__pull_request_times\n), \n\npull_request_reviewers as (\n select *\n from __dbt__cte__int_github__pull_request_reviewers\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then 'https://github.com/' || repository_teams.repository || '/pull/' || issue.issue_number\n else 'https://github.com/' || repository_teams.repository || '/issues/' || issue.issue_number\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n \n repository_teams.repository_team_names,\n \n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.github.int_github__issue_label_joined", "sql": " __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n)"}, {"id": "model.github.int_github__issue_labels", "sql": " __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n)"}, {"id": "model.github.int_github__repository_teams", "sql": " __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n)"}, {"id": "model.github.int_github__issue_assignees", "sql": " __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n)"}, {"id": "model.github.int_github__issue_open_length", "sql": " __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n)"}, {"id": "model.github.int_github__issue_comments", "sql": " __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n)"}, {"id": "model.github.int_github__pull_request_times", "sql": " __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n)"}, {"id": "model.github.int_github__pull_request_reviewers", "sql": " __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n)"}], "relation_name": null}, "model.github.int_github__issue_labels": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.github.int_github__issue_label_joined"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_labels"], "unique_id": "model.github.int_github__issue_labels", "raw_code": "with issue_label as (\n select *\n from {{ ref('int_github__issue_label_joined') }}\n)\n\nselect\n issue_id,\n {{ fivetran_utils.string_agg( 'label', \"', '\" )}} as labels\nfrom issue_label\ngroup by issue_id", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_labels.sql", "original_file_path": "models/intermediate/int_github__issue_labels.sql", "name": "int_github__issue_labels", "alias": "int_github__issue_labels", "checksum": {"name": "sha256", "checksum": "126b7de5034d8b9e5067e9d0a346ea3d93132574cc3ae85d4d711270404f4064"}, "tags": [], "refs": [["int_github__issue_label_joined"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_labels.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1667849268.942282, "compiled_code": "with __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n),issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.github.int_github__issue_label_joined", "sql": " __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n)"}], "relation_name": null}, "model.github.int_github__issue_assignees": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.github_source.stg_github__issue_assignee", "model.github_source.stg_github__user"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_assignees"], "unique_id": "model.github.int_github__issue_assignees", "raw_code": "with issue_assignee as (\n select *\n from {{ var('issue_assignee') }}\n), \n\ngithub_user as (\n select *\n from {{ var('user')}}\n)\n\nselect\n issue_assignee.issue_id,\n {{ fivetran_utils.string_agg( 'github_user.login_name', \"', '\" )}} as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_assignees.sql", "original_file_path": "models/intermediate/int_github__issue_assignees.sql", "name": "int_github__issue_assignees", "alias": "int_github__issue_assignees", "checksum": {"name": "sha256", "checksum": "837310bb78ff6f1460babc622037227dbc0c5776aae3ce3f5e9de48cb2ffac9c"}, "tags": [], "refs": [["stg_github__issue_assignee"], ["stg_github__user"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_assignees.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1667849268.952574, "compiled_code": "with issue_assignee as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__issue_comments": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.github_source.stg_github__issue_comment"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_comments"], "unique_id": "model.github.int_github__issue_comments", "raw_code": "with issue_comment as (\n select *\n from {{ var('issue_comment') }}\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_comments.sql", "original_file_path": "models/intermediate/int_github__issue_comments.sql", "name": "int_github__issue_comments", "alias": "int_github__issue_comments", "checksum": {"name": "sha256", "checksum": "b56ffccc19ec39a1d1bc4137557c8e1971167f97e673ea30d0f713bd34bc111a"}, "tags": [], "refs": [["stg_github__issue_comment"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_comments.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1667849268.963899, "compiled_code": "with issue_comment as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__issue_open_length": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt.datediff"], "nodes": ["model.github_source.stg_github__issue", "model.github_source.stg_github__issue_closed_history"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_open_length"], "unique_id": "model.github.int_github__issue_open_length", "raw_code": "with issue as (\n select *\n from {{ var('issue') }}\n), \n\nissue_closed_history as (\n select *\n from {{ var('issue_closed_history') }}\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), {{ dbt.current_timestamp_backcompat() }}) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum({{ dbt.datediff('valid_starting', 'valid_until', 'second') }}) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_open_length.sql", "original_file_path": "models/intermediate/int_github__issue_open_length.sql", "name": "int_github__issue_open_length", "alias": "int_github__issue_open_length", "checksum": {"name": "sha256", "checksum": "58de864860664b785e8000ef983dcb006d60af6cbba301e72e9e4c45aa1d8d5a"}, "tags": [], "refs": [["stg_github__issue"], ["stg_github__issue_closed_history"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_open_length.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1667849268.9728892, "compiled_code": "with issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__repository_teams": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.github_source.stg_github__repository", "model.github_source.stg_github__repo_team", "model.github_source.stg_github__team"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__repository_teams"], "unique_id": "model.github.int_github__repository_teams", "raw_code": "{{ config(enabled=var('github__using_repo_team', True)) }}\n\nwith repository as (\n select *\n from {{ var('repository')}}\n),\n\nrepo_teams as (\n select *\n from {{ var('repo_team')}}\n),\n\nteams as (\n select *\n from {{ var('team')}}\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n {{ fivetran_utils.string_agg('team_name', \"', '\" ) }} as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__repository_teams.sql", "original_file_path": "models/intermediate/int_github__repository_teams.sql", "name": "int_github__repository_teams", "alias": "int_github__repository_teams", "checksum": {"name": "sha256", "checksum": "aa75375faa9f533b0c9c935f80ed6e9c7b90f20249089e7d64b7b47194f9044e"}, "tags": [], "refs": [["stg_github__repository"], ["stg_github__repo_team"], ["stg_github__team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__repository_teams.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "enabled": true}, "created_at": 1667849268.985118, "compiled_code": "\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github_source.stg_github__issue_comment": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_comment_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__issue_comment_tmp", "model.github_source.stg_github__issue_comment_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__issue_comment"], "unique_id": "model.github_source.stg_github__issue_comment", "raw_code": "with issue_comment as (\n\n select *\n from {{ ref('stg_github__issue_comment_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_comment_tmp')),\n staging_columns=get_issue_comment_columns()\n )\n }}\n\n from issue_comment\n\n), fields as (\n\n select \n id as issue_comment_id,\n issue_id,\n user_id\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue_comment.sql", "original_file_path": "models/stg_github__issue_comment.sql", "name": "stg_github__issue_comment", "alias": "stg_github__issue_comment", "checksum": {"name": "sha256", "checksum": "2f96156ac9d0de0afe220888eb6912117a7d04b1680b8fb1f5890dfbbcdb2994"}, "tags": [], "refs": [["stg_github__issue_comment_tmp"], ["stg_github__issue_comment_tmp"]], "sources": [], "metrics": [], "description": "Table that contains comments made on issues", "columns": {"issue_comment_id": {"name": "issue_comment_id", "description": "System generated unique id for the issue comment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue_comment.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667849269.652618, "compiled_code": "with issue_comment as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n body\n \n as \n \n body\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 issue_id\n \n as \n \n issue_id\n \n, \n \n \n updated_at\n \n as \n \n updated_at\n \n, \n \n \n user_id\n \n as \n \n user_id\n \n\n\n\n\n from issue_comment\n\n), fields as (\n\n select \n id as issue_comment_id,\n issue_id,\n user_id\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment`"}, "model.github_source.stg_github__requested_reviewer_history": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_requested_reviewer_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.github_source.stg_github__requested_reviewer_history_tmp", "model.github_source.stg_github__requested_reviewer_history_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__requested_reviewer_history"], "unique_id": "model.github_source.stg_github__requested_reviewer_history", "raw_code": "with requested_reviewer_history as (\n\n select *\n from {{ ref('stg_github__requested_reviewer_history_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__requested_reviewer_history_tmp')),\n staging_columns=get_requested_reviewer_history_columns()\n )\n }}\n\n from requested_reviewer_history\n\n), fields as (\n\n select \n pull_request_id,\n cast(created_at as {{ dbt.type_timestamp() }}) as created_at,\n requested_id,\n removed\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__requested_reviewer_history.sql", "original_file_path": "models/stg_github__requested_reviewer_history.sql", "name": "stg_github__requested_reviewer_history", "alias": "stg_github__requested_reviewer_history", "checksum": {"name": "sha256", "checksum": "40abf6ac94bece080abe8e8a45ed43030166df171697acf3c59c5958ffe68eba"}, "tags": [], "refs": [["stg_github__requested_reviewer_history_tmp"], ["stg_github__requested_reviewer_history_tmp"]], "sources": [], "metrics": [], "description": "Table containing when a user requests another user to review a pull request", "columns": {"pull_request_id": {"name": "pull_request_id", "description": "Foreign key that references the pull request table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the review was submitted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "requested_id": {"name": "requested_id", "description": "Foreign key that references the user table, representing the user that was requested to review a PR.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "removed": {"name": "removed", "description": "Boolean variable indicating if the requester was removed from the PR (true) or added to the PR (false).", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__requested_reviewer_history.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667849269.6761038, "compiled_code": "with requested_reviewer_history as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__requested_reviewer_history_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n actor_id\n \n as \n \n actor_id\n \n, \n \n \n created_at\n \n as \n \n created_at\n \n, \n \n \n pull_request_id\n \n as \n \n pull_request_id\n \n, \n \n \n removed\n \n as \n \n removed\n \n, \n \n \n requested_id\n \n as \n \n requested_id\n \n\n\n\n\n from requested_reviewer_history\n\n), fields as (\n\n select \n pull_request_id,\n cast(created_at as TIMESTAMP) as created_at,\n requested_id,\n removed\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__requested_reviewer_history`"}, "model.github_source.stg_github__issue_label": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_label_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__issue_label_tmp", "model.github_source.stg_github__issue_label_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__issue_label"], "unique_id": "model.github_source.stg_github__issue_label", "raw_code": "with issue_label as (\n\n select *\n from {{ ref('stg_github__issue_label_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_label_tmp')),\n staging_columns=get_issue_label_columns()\n )\n }}\n\n from issue_label\n\n), fields as (\n\n select \n issue_id,\n label_id\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue_label.sql", "original_file_path": "models/stg_github__issue_label.sql", "name": "stg_github__issue_label", "alias": "stg_github__issue_label", "checksum": {"name": "sha256", "checksum": "bbc4b8e82ab26b7cb753ead2165a6d483171b6def78a34c8ab6b2c9d1dc1357c"}, "tags": [], "refs": [["stg_github__issue_label_tmp"], ["stg_github__issue_label_tmp"]], "sources": [], "metrics": [], "description": "The current labels attached to an issue", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "label_id": {"name": "label_id", "description": "Unique identifier of the used label", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue_label.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667849269.650191, "compiled_code": "with issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n label_id\n \n as \n \n label_id\n \n, \n \n \n issue_id\n \n as \n \n issue_id\n \n\n\n\n\n from issue_label\n\n), fields as (\n\n select \n issue_id,\n label_id\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label`"}, "model.github_source.stg_github__issue_merged": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_merged_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.github_source.stg_github__issue_merged_tmp", "model.github_source.stg_github__issue_merged_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__issue_merged"], "unique_id": "model.github_source.stg_github__issue_merged", "raw_code": "with issue_merged as (\n\n select *\n from {{ ref('stg_github__issue_merged_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_merged_tmp')),\n staging_columns=get_issue_merged_columns()\n )\n }}\n\n from issue_merged\n\n), fields as (\n\n select \n issue_id,\n cast(merged_at as {{ dbt.type_timestamp() }}) as merged_at\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue_merged.sql", "original_file_path": "models/stg_github__issue_merged.sql", "name": "stg_github__issue_merged", "alias": "stg_github__issue_merged", "checksum": {"name": "sha256", "checksum": "d0ffc63496f8a12ccde9c115909db85d5f2fbd7c2ca8a7761cd96abcf31f532c"}, "tags": [], "refs": [["stg_github__issue_merged_tmp"], ["stg_github__issue_merged_tmp"]], "sources": [], "metrics": [], "description": "Table that tracks when an issue (always a pull request) is merged", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table. This table will only reference issues that are pull requests", "meta": {}, "data_type": null, "quote": null, "tags": []}, "merged_at": {"name": "merged_at", "description": "Timestamp of when the code merge took place", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue_merged.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667849269.654439, "compiled_code": "with issue_merged as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_merged_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n actor_id\n \n as \n \n actor_id\n \n, \n \n \n commit_sha\n \n as \n \n commit_sha\n \n, \n \n \n issue_id\n \n as \n \n issue_id\n \n, \n \n \n merged_at\n \n as \n \n merged_at\n \n\n\n\n\n from issue_merged\n\n), fields as (\n\n select \n issue_id,\n cast(merged_at as TIMESTAMP) as merged_at\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_merged`"}, "model.github_source.stg_github__issue_closed_history": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_closed_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.github_source.stg_github__issue_closed_history_tmp", "model.github_source.stg_github__issue_closed_history_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__issue_closed_history"], "unique_id": "model.github_source.stg_github__issue_closed_history", "raw_code": "with issue_closed_history as (\n\n select *\n from {{ ref('stg_github__issue_closed_history_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_closed_history_tmp')),\n staging_columns=get_issue_closed_history_columns()\n )\n }}\n\n from issue_closed_history\n\n), fields as (\n\n select \n issue_id,\n cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at,\n closed as is_closed\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue_closed_history.sql", "original_file_path": "models/stg_github__issue_closed_history.sql", "name": "stg_github__issue_closed_history", "alias": "stg_github__issue_closed_history", "checksum": {"name": "sha256", "checksum": "8820baed7a5b47177c8e57576741ab5d3763026682f66c52429092e655e07408"}, "tags": [], "refs": [["stg_github__issue_closed_history_tmp"], ["stg_github__issue_closed_history_tmp"]], "sources": [], "metrics": [], "description": "Table to track when an issue is closed or re-opened", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the action took place", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_closed": {"name": "is_closed", "description": "Boolean variable for if the issue was closed (true) or re-opened (false)", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue_closed_history.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667849269.6483111, "compiled_code": "with issue_closed_history as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n actor_id\n \n as \n \n actor_id\n \n, \n \n \n closed\n \n as \n \n closed\n \n, \n \n \n commit_sha\n \n as \n \n commit_sha\n \n, \n \n \n issue_id\n \n as \n \n issue_id\n \n, \n \n \n updated_at\n \n as \n \n updated_at\n \n\n\n\n\n from issue_closed_history\n\n), fields as (\n\n select \n issue_id,\n cast(updated_at as TIMESTAMP) as updated_at,\n closed as is_closed\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history`"}, "model.github_source.stg_github__issue_assignee": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_assignee_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__issue_assignee_tmp", "model.github_source.stg_github__issue_assignee_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__issue_assignee"], "unique_id": "model.github_source.stg_github__issue_assignee", "raw_code": "with issue_assignee as (\n\n select *\n from {{ ref('stg_github__issue_assignee_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_assignee_tmp')),\n staging_columns=get_issue_assignee_columns()\n )\n }}\n\n from issue_assignee\n\n), fields as (\n\n select \n issue_id,\n user_id\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue_assignee.sql", "original_file_path": "models/stg_github__issue_assignee.sql", "name": "stg_github__issue_assignee", "alias": "stg_github__issue_assignee", "checksum": {"name": "sha256", "checksum": "1ee1ae6a0a648f4fddde4964f184b889bfd09ca43f0560fb10faaa8544b2f90d"}, "tags": [], "refs": [["stg_github__issue_assignee_tmp"], ["stg_github__issue_assignee_tmp"]], "sources": [], "metrics": [], "description": "Table with the current user(s) assigned to an issue", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue_assignee.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667849269.6412091, "compiled_code": "with issue_assignee as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n issue_id\n \n as \n \n issue_id\n \n, \n \n \n user_id\n \n as \n \n user_id\n \n\n\n\n\n from issue_assignee\n\n), fields as (\n\n select \n issue_id,\n user_id\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee`"}, "model.github_source.stg_github__repository": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_repository_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__repository_tmp", "model.github_source.stg_github__repository_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__repository"], "unique_id": "model.github_source.stg_github__repository", "raw_code": "with repository as (\n\n select *\n from {{ ref('stg_github__repository_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__repository_tmp')),\n staging_columns=get_repository_columns()\n )\n }}\n\n from repository\n\n), fields as (\n\n select \n id as repository_id,\n full_name,\n private as is_private\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__repository.sql", "original_file_path": "models/stg_github__repository.sql", "name": "stg_github__repository", "alias": "stg_github__repository", "checksum": {"name": "sha256", "checksum": "52faadfa1a36e8b144c01bdba106b9b22c58154bbd60b69c069c409f1b2f4712"}, "tags": [], "refs": [["stg_github__repository_tmp"], ["stg_github__repository_tmp"]], "sources": [], "metrics": [], "description": "Table representing the file structure of a directory under git control", "columns": {"repository_id": {"name": "repository_id", "description": "System generated unique id for the repository.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "full_name": {"name": "full_name", "description": "The name of the git repository.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_private": {"name": "is_private", "description": "Boolean field indicating whether the repository is private (true) or public (false).", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__repository.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667849269.673113, "compiled_code": "with repository as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repository_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\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 created_at\n \n as \n \n created_at\n \n, \n \n \n default_branch\n \n as \n \n default_branch\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n fork\n \n as \n \n fork\n \n, \n \n \n full_name\n \n as \n \n full_name\n \n, \n \n \n homepage\n \n as \n \n homepage\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n language\n \n as \n \n language\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n owner_id\n \n as \n \n owner_id\n \n, \n \n \n private\n \n as \n \n private\n \n\n\n\n\n from repository\n\n), fields as (\n\n select \n id as repository_id,\n full_name,\n private as is_private\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__repository`"}, "model.github_source.stg_github__user": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_user_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__user_tmp", "model.github_source.stg_github__user_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__user"], "unique_id": "model.github_source.stg_github__user", "raw_code": "with github_user as (\n\n select *\n from {{ ref('stg_github__user_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__user_tmp')),\n staging_columns=get_user_columns()\n )\n }}\n \n \n from github_user\n\n), fields as (\n\n select\n id as user_id,\n login as login_name,\n name,\n company\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__user.sql", "original_file_path": "models/stg_github__user.sql", "name": "stg_github__user", "alias": "stg_github__user", "checksum": {"name": "sha256", "checksum": "3fade99df6af62e01efd3bdabe4245077eeb17d7c05a33eae885ab9cebfb33a6"}, "tags": [], "refs": [["stg_github__user_tmp"], ["stg_github__user_tmp"]], "sources": [], "metrics": [], "description": "Table representing contributors to a git project", "columns": {"user_id": {"name": "user_id", "description": "System generated unique id for the user.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "login_name": {"name": "login_name", "description": "The alias the user uses to login to github.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the user", "meta": {}, "data_type": null, "quote": null, "tags": []}, "company": {"name": "company", "description": "The company of the user.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__user.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667849269.6832, "compiled_code": "with github_user as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n company\n \n as \n \n company\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n login\n \n as \n \n login\n \n, \n \n \n name\n \n as \n \n name\n \n\n\n\n \n \n from github_user\n\n), fields as (\n\n select\n id as user_id,\n login as login_name,\n name,\n company\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__user`"}, "model.github_source.stg_github__pull_request_review": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_pull_request_review_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.github_source.stg_github__pull_request_review_tmp", "model.github_source.stg_github__pull_request_review_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__pull_request_review"], "unique_id": "model.github_source.stg_github__pull_request_review", "raw_code": "with pull_request_review as (\n\n select *\n from {{ ref('stg_github__pull_request_review_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__pull_request_review_tmp')),\n staging_columns=get_pull_request_review_columns()\n )\n }}\n\n from pull_request_review\n\n), fields as (\n\n select \n id as pull_request_review_id,\n pull_request_id,\n cast(submitted_at as {{ dbt.type_timestamp() }}) as submitted_at,\n state,\n user_id\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__pull_request_review.sql", "original_file_path": "models/stg_github__pull_request_review.sql", "name": "stg_github__pull_request_review", "alias": "stg_github__pull_request_review", "checksum": {"name": "sha256", "checksum": "3c5b56fcda26503106a11215aa4895199d140d378e4f81dc73fee0a95a39ef6b"}, "tags": [], "refs": [["stg_github__pull_request_review_tmp"], ["stg_github__pull_request_review_tmp"]], "sources": [], "metrics": [], "description": "Table containing reviews made to pull requests", "columns": {"pull_request_review_id": {"name": "pull_request_review_id", "description": "System generated unique id for the pull request review.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pull_request_id": {"name": "pull_request_id", "description": "Foreign key that references the pull request table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "submitted_at": {"name": "submitted_at", "description": "Timestamp of when the request for review was submitted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the review was an approval, request for change, comment, dismissal.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table, representing the user that reviewed the pull request.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__pull_request_review.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667849269.665847, "compiled_code": "with pull_request_review as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n body\n \n as \n \n body\n \n, \n \n \n commit_sha\n \n as \n \n commit_sha\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n pull_request_id\n \n as \n \n pull_request_id\n \n, \n \n \n state\n \n as \n \n state\n \n, \n \n \n submitted_at\n \n as \n \n submitted_at\n \n, \n \n \n user_id\n \n as \n \n user_id\n \n\n\n\n\n from pull_request_review\n\n), fields as (\n\n select \n id as pull_request_review_id,\n pull_request_id,\n cast(submitted_at as TIMESTAMP) as submitted_at,\n state,\n user_id\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`"}, "model.github_source.stg_github__repo_team": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_repo_team_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__repo_team_tmp", "model.github_source.stg_github__repo_team_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__repo_team"], "unique_id": "model.github_source.stg_github__repo_team", "raw_code": "{{ config(enabled=var('github__using_repo_team', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_github__repo_team_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__repo_team_tmp')),\n staging_columns=get_repo_team_columns()\n )\n }}\n \n from base\n \n), final as (\n \n select \n repository_id,\n team_id\n from fields\n)\n\nselect * from final", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__repo_team.sql", "original_file_path": "models/stg_github__repo_team.sql", "name": "stg_github__repo_team", "alias": "stg_github__repo_team", "checksum": {"name": "sha256", "checksum": "bbf2296c63f5601191f285d1b9509717c9af73282ef8faae25df101d5c2058ec"}, "tags": [], "refs": [["stg_github__repo_team_tmp"], ["stg_github__repo_team_tmp"]], "sources": [], "metrics": [], "description": "Table representing the mapping relationships between repositories and teams", "columns": {"repository_id": {"name": "repository_id", "description": "Reference to the respective repository for the record.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "team_id": {"name": "team_id", "description": "Reference to the respective team for the record.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__repo_team.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "enabled": true}, "created_at": 1667849269.670687, "compiled_code": "\n\nwith base as (\n\n select * \n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team_tmp`\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n permission\n \n as \n \n permission\n \n, \n \n \n repository_id\n \n as \n \n repository_id\n \n, \n \n \n team_id\n \n as \n \n team_id\n \n\n\n\n \n from base\n \n), final as (\n \n select \n repository_id,\n team_id\n from fields\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team`"}, "model.github_source.stg_github__label": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_label_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__label_tmp", "model.github_source.stg_github__label_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__label"], "unique_id": "model.github_source.stg_github__label", "raw_code": "with issue_label as (\n\n select *\n from {{ ref('stg_github__label_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__label_tmp')),\n staging_columns=get_label_columns()\n )\n }}\n\n from issue_label\n\n), fields as (\n\n select \n id as label_id,\n _fivetran_synced,\t\n color,\n description,\n is_default,\n name as label,\n url\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__label.sql", "original_file_path": "models/stg_github__label.sql", "name": "stg_github__label", "alias": "stg_github__label", "checksum": {"name": "sha256", "checksum": "65919f8309be5eb259a6143e007f38f4ac91c1692d10990206708faa17f086e1"}, "tags": [], "refs": [["stg_github__label_tmp"], ["stg_github__label_tmp"]], "sources": [], "metrics": [], "description": "Table that contains labels that are used across your Github account within individual repositories.", "columns": {"label_id": {"name": "label_id", "description": "Unique identifier of the Github label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of the record being synced by Fivetran", "meta": {}, "data_type": null, "quote": null, "tags": []}, "color": {"name": "color", "description": "The color of the label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "The description of the label indicating the purpose", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_default": {"name": "is_default", "description": "Boolean flagging if the label is default on creation", "meta": {}, "data_type": null, "quote": null, "tags": []}, "label": {"name": "label", "description": "Name of the label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url": {"name": "url", "description": "Url where the label was used", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__label.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667849269.6457448, "compiled_code": "with issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\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 description\n \n as \n \n description\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n is_default\n \n as \n \n is_default\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n url\n \n as \n \n url\n \n\n\n\n\n from issue_label\n\n), fields as (\n\n select \n id as label_id,\n _fivetran_synced,\t\n color,\n description,\n is_default,\n name as label,\n url\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__label`"}, "model.github_source.stg_github__issue": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.github_source.stg_github__issue_tmp", "model.github_source.stg_github__issue_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__issue"], "unique_id": "model.github_source.stg_github__issue", "raw_code": "with issue as (\n\n select *\n from {{ ref('stg_github__issue_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_tmp')),\n staging_columns=get_issue_columns()\n )\n }}\n\n from issue \n\n), fields as (\n\n select \n id as issue_id,\n body,\n cast(closed_at as {{ dbt.type_timestamp() }}) as closed_at,\n cast(created_at as {{ dbt.type_timestamp() }}) as created_at,\n locked as is_locked,\n milestone_id,\n number as issue_number,\n pull_request as is_pull_request,\n repository_id,\n state,\n title,\n cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at,\n user_id\n \n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue.sql", "original_file_path": "models/stg_github__issue.sql", "name": "stg_github__issue", "alias": "stg_github__issue", "checksum": {"name": "sha256", "checksum": "4fa11e7a1ff0785189f14a205478aba55bb62784e05066f421e1723ec12240d0"}, "tags": [], "refs": [["stg_github__issue_tmp"], ["stg_github__issue_tmp"]], "sources": [], "metrics": [], "description": "Table that contains 1 entry for every issue created. Pull Requests also create an entry in this table, and there is a boolean field to determine if an entry is a pull request.", "columns": {"issue_id": {"name": "issue_id", "description": "System generated unique id for the issue. This is not the number that appears in the URL.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "body": {"name": "body", "description": "The text of the main description of the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed_at": {"name": "closed_at", "description": "Timestamp of when the issue was closed, NULL for issues that are open.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_locked": {"name": "is_locked", "description": "Boolean indicating whether the issue is locked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the issue was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "milestone_id": {"name": "milestone_id", "description": "Foreign key that references the milestone table representing the current milestone the issue is in.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_number": {"name": "issue_number", "description": "The issue number within a repository. Is unique by repository, but not across repositories.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_pull_request": {"name": "is_pull_request", "description": "Boolean for is the issue is a pull request (true) ot regular issue (false)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_id": {"name": "repository_id", "description": "Foreign key that references the repository table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the issue is open or closed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "Title of the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the last update was made to the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table, representing the user that created the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667849269.662169, "compiled_code": "with issue as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n body\n \n as \n \n body\n \n, \n \n \n closed_at\n \n as \n \n closed_at\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 locked\n \n as \n \n locked\n \n, \n \n \n milestone_id\n \n as \n \n milestone_id\n \n, \n \n \n number\n \n as \n \n number\n \n, \n \n \n pull_request\n \n as \n \n pull_request\n \n, \n \n \n repository_id\n \n as \n \n repository_id\n \n, \n \n \n state\n \n as \n \n state\n \n, \n \n \n title\n \n as \n \n title\n \n, \n \n \n updated_at\n \n as \n \n updated_at\n \n, \n \n \n user_id\n \n as \n \n user_id\n \n\n\n\n\n from issue \n\n), fields as (\n\n select \n id as issue_id,\n body,\n cast(closed_at as TIMESTAMP) as closed_at,\n cast(created_at as TIMESTAMP) as created_at,\n locked as is_locked,\n milestone_id,\n number as issue_number,\n pull_request as is_pull_request,\n repository_id,\n state,\n title,\n cast(updated_at as TIMESTAMP) as updated_at,\n user_id\n \n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue`"}, "model.github_source.stg_github__team": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_team_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__team_tmp", "model.github_source.stg_github__team_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__team"], "unique_id": "model.github_source.stg_github__team", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_github__team_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__team_tmp')),\n staging_columns=get_team_columns()\n )\n }}\n \n from base\n \n), final as (\n \n select \n id as team_id,\n description,\n name,\n parent_id,\n privacy,\n slug\n from fields\n)\n\nselect * \nfrom final", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__team.sql", "original_file_path": "models/stg_github__team.sql", "name": "stg_github__team", "alias": "stg_github__team", "checksum": {"name": "sha256", "checksum": "219e47883ec9f076dc1c27b22f72534709edaedd60e8ad9dc1b13db05499f4a4"}, "tags": [], "refs": [["stg_github__team_tmp"], ["stg_github__team_tmp"]], "sources": [], "metrics": [], "description": "Table containing teams and team details", "columns": {"team_id": {"name": "team_id", "description": "System generated unique id for the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "User created description of the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "User created name of the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "Reference to the parent team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "privacy": {"name": "privacy", "description": "Type of privacy permissions associated with the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "slug": {"name": "slug", "description": "Url friendly version of the team name.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__team.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667849269.680067, "compiled_code": "with base as (\n\n select * \n from `dbt-package-testing`.`github_integration_tests`.`stg_github__team_tmp`\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n description\n \n as \n \n description\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 org_id\n \n as \n \n org_id\n \n, \n \n \n parent_id\n \n as \n \n parent_id\n \n, \n \n \n privacy\n \n as \n \n privacy\n \n, \n \n \n slug\n \n as \n \n slug\n \n\n\n\n \n from base\n \n), final as (\n \n select \n id as team_id,\n description,\n name,\n parent_id,\n privacy,\n slug\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__team`"}, "model.github_source.stg_github__pull_request": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_pull_request_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__pull_request_tmp", "model.github_source.stg_github__pull_request_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__pull_request"], "unique_id": "model.github_source.stg_github__pull_request", "raw_code": "with pull_request as (\n\n select *\n from {{ ref('stg_github__pull_request_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__pull_request_tmp')),\n staging_columns=get_pull_request_columns()\n )\n }}\n\n from pull_request\n\n), fields as (\n\n select \n id as pull_request_id,\n issue_id,\n head_repo_id,\n head_user_id\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__pull_request.sql", "original_file_path": "models/stg_github__pull_request.sql", "name": "stg_github__pull_request", "alias": "stg_github__pull_request", "checksum": {"name": "sha256", "checksum": "c2b1a593030492afcf35407523b636105f42f1cf3fd14f6067e31ba76d70dfe8"}, "tags": [], "refs": [["stg_github__pull_request_tmp"], ["stg_github__pull_request_tmp"]], "sources": [], "metrics": [], "description": "A special type of issue that is created when a user wants to merge one branch of code into another", "columns": {"pull_request_id": {"name": "pull_request_id", "description": "System generated unique id for the pull request.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "head_repo_id": {"name": "head_repo_id", "description": "Foreign key that references the repository table, referencing the current branch.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "head_user_id": {"name": "head_user_id", "description": "Foreign key that references the user table, referencing who created the current branch.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__pull_request.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667849269.66875, "compiled_code": "with pull_request as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n base_label\n \n as \n \n base_label\n \n, \n \n \n base_ref\n \n as \n \n base_ref\n \n, \n \n \n base_repo_id\n \n as \n \n base_repo_id\n \n, \n \n \n base_sha\n \n as \n \n base_sha\n \n, \n \n \n base_user_id\n \n as \n \n base_user_id\n \n, \n \n \n head_label\n \n as \n \n head_label\n \n, \n \n \n head_ref\n \n as \n \n head_ref\n \n, \n \n \n head_repo_id\n \n as \n \n head_repo_id\n \n, \n \n \n head_sha\n \n as \n \n head_sha\n \n, \n \n \n head_user_id\n \n as \n \n head_user_id\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n issue_id\n \n as \n \n issue_id\n \n, \n \n \n merge_commit_sha\n \n as \n \n merge_commit_sha\n \n\n\n\n\n from pull_request\n\n), fields as (\n\n select \n id as pull_request_id,\n issue_id,\n head_repo_id,\n head_user_id\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`"}, "model.github_source.stg_github__repository_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.repository"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__repository_tmp"], "unique_id": "model.github_source.stg_github__repository_tmp", "raw_code": "select *\nfrom {{ var('repository') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__repository_tmp.sql", "original_file_path": "models/tmp/stg_github__repository_tmp.sql", "name": "stg_github__repository_tmp", "alias": "stg_github__repository_tmp", "checksum": {"name": "sha256", "checksum": "e090c8cb68dc96c49ee363d95e9bbaf417dd03e2ec675bfdc3d9cefdf889cfc8"}, "tags": [], "refs": [], "sources": [["github", "repository"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__repository_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667849269.3035278, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_repository_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__repository_tmp`"}, "model.github_source.stg_github__label_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.label"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__label_tmp"], "unique_id": "model.github_source.stg_github__label_tmp", "raw_code": "select *\nfrom {{ var('label') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__label_tmp.sql", "original_file_path": "models/tmp/stg_github__label_tmp.sql", "name": "stg_github__label_tmp", "alias": "stg_github__label_tmp", "checksum": {"name": "sha256", "checksum": "8e66aceee9e6c677e3b0b105b85de66edea0f4141bef42cd097fd9a236abcf2f"}, "tags": [], "refs": [], "sources": [["github", "label"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__label_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667849269.313513, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_label_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__label_tmp`"}, "model.github_source.stg_github__requested_reviewer_history_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.requested_reviewer_history"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__requested_reviewer_history_tmp"], "unique_id": "model.github_source.stg_github__requested_reviewer_history_tmp", "raw_code": "select *\nfrom {{ var('requested_reviewer_history') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__requested_reviewer_history_tmp.sql", "original_file_path": "models/tmp/stg_github__requested_reviewer_history_tmp.sql", "name": "stg_github__requested_reviewer_history_tmp", "alias": "stg_github__requested_reviewer_history_tmp", "checksum": {"name": "sha256", "checksum": "ed713a77bb2c7407b63c6cc1eb5da22d3267a585bd972dabeb7c86e568180aaf"}, "tags": [], "refs": [], "sources": [["github", "requested_reviewer_history"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__requested_reviewer_history_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667849269.3224, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_requested_reviewer_history_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__requested_reviewer_history_tmp`"}, "model.github_source.stg_github__issue_comment_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.issue_comment"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_comment_tmp"], "unique_id": "model.github_source.stg_github__issue_comment_tmp", "raw_code": "select *\nfrom {{ var('issue_comment') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_comment_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_comment_tmp.sql", "name": "stg_github__issue_comment_tmp", "alias": "stg_github__issue_comment_tmp", "checksum": {"name": "sha256", "checksum": "0954877e30180964df220c97f9b398d775fc74106c25666bf9dd98c5449a72a1"}, "tags": [], "refs": [], "sources": [["github", "issue_comment"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_comment_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667849269.331229, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_issue_comment_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment_tmp`"}, "model.github_source.stg_github__pull_request_review_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.pull_request_review"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__pull_request_review_tmp"], "unique_id": "model.github_source.stg_github__pull_request_review_tmp", "raw_code": "select *\nfrom {{ var('pull_request_review') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__pull_request_review_tmp.sql", "original_file_path": "models/tmp/stg_github__pull_request_review_tmp.sql", "name": "stg_github__pull_request_review_tmp", "alias": "stg_github__pull_request_review_tmp", "checksum": {"name": "sha256", "checksum": "3419833d93b14d370eb3c9cfb7fda9a373c47a2f9701620425d882b95fbaa55c"}, "tags": [], "refs": [], "sources": [["github", "pull_request_review"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__pull_request_review_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667849269.340085, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_pull_request_review_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review_tmp`"}, "model.github_source.stg_github__issue_label_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.issue_label"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_label_tmp"], "unique_id": "model.github_source.stg_github__issue_label_tmp", "raw_code": "select *\nfrom {{ var('issue_label') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_label_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_label_tmp.sql", "name": "stg_github__issue_label_tmp", "alias": "stg_github__issue_label_tmp", "checksum": {"name": "sha256", "checksum": "3cd52e662c2bc67a66c9c3e6250e38739362a0b688287d41329d2989297fa201"}, "tags": [], "refs": [], "sources": [["github", "issue_label"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_label_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667849269.348972, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_issue_label_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label_tmp`"}, "model.github_source.stg_github__team_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.team"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__team_tmp"], "unique_id": "model.github_source.stg_github__team_tmp", "raw_code": "select * \nfrom {{ var('team') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__team_tmp.sql", "original_file_path": "models/tmp/stg_github__team_tmp.sql", "name": "stg_github__team_tmp", "alias": "stg_github__team_tmp", "checksum": {"name": "sha256", "checksum": "8c107692c9394962da82e0c2460045e6686d962c1eefe0cff564c618aed7a17d"}, "tags": [], "refs": [], "sources": [["github", "team"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__team_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667849269.35787, "compiled_code": "select * \nfrom `dbt-package-testing`.`github_integration_tests`.`github_team_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__team_tmp`"}, "model.github_source.stg_github__pull_request_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.pull_request"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__pull_request_tmp"], "unique_id": "model.github_source.stg_github__pull_request_tmp", "raw_code": "select *\nfrom {{ var('pull_request') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__pull_request_tmp.sql", "original_file_path": "models/tmp/stg_github__pull_request_tmp.sql", "name": "stg_github__pull_request_tmp", "alias": "stg_github__pull_request_tmp", "checksum": {"name": "sha256", "checksum": "11df5e7fd7046db485c6654ea88c82c566b71140c4e233f3567bd63bbf1cca19"}, "tags": [], "refs": [], "sources": [["github", "pull_request"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__pull_request_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667849269.367984, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_pull_request_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_tmp`"}, "model.github_source.stg_github__issue_merged_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.issue_merged"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_merged_tmp"], "unique_id": "model.github_source.stg_github__issue_merged_tmp", "raw_code": "select *\nfrom {{ var('issue_merged') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_merged_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_merged_tmp.sql", "name": "stg_github__issue_merged_tmp", "alias": "stg_github__issue_merged_tmp", "checksum": {"name": "sha256", "checksum": "e61fb5297937f494370067232958a443ec21c885a55cca0022f480b463ce90a9"}, "tags": [], "refs": [], "sources": [["github", "issue_merged"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_merged_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667849269.376788, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_issue_merged_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_merged_tmp`"}, "model.github_source.stg_github__user_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.user"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__user_tmp"], "unique_id": "model.github_source.stg_github__user_tmp", "raw_code": "select *\nfrom {{ var('user') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__user_tmp.sql", "original_file_path": "models/tmp/stg_github__user_tmp.sql", "name": "stg_github__user_tmp", "alias": "stg_github__user_tmp", "checksum": {"name": "sha256", "checksum": "e71885bca06f3e1feaef9e729cfb58827c8999bc4d4b7cda538c392c5f56ffdf"}, "tags": [], "refs": [], "sources": [["github", "user"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__user_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667849269.38559, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_user_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__user_tmp`"}, "model.github_source.stg_github__issue_closed_history_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.issue_closed_history"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_closed_history_tmp"], "unique_id": "model.github_source.stg_github__issue_closed_history_tmp", "raw_code": "select *\nfrom {{ var('issue_closed_history') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_closed_history_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_closed_history_tmp.sql", "name": "stg_github__issue_closed_history_tmp", "alias": "stg_github__issue_closed_history_tmp", "checksum": {"name": "sha256", "checksum": "5ce3eed90261c385c0ddcb0dc9d914a0bf3d3e0f737e4e233af244d29bbf3ce4"}, "tags": [], "refs": [], "sources": [["github", "issue_closed_history"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_closed_history_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667849269.3945248, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_issue_closed_history_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history_tmp`"}, "model.github_source.stg_github__issue_assignee_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.issue_assignee"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_assignee_tmp"], "unique_id": "model.github_source.stg_github__issue_assignee_tmp", "raw_code": "select *\nfrom {{ var('issue_assignee') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_assignee_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_assignee_tmp.sql", "name": "stg_github__issue_assignee_tmp", "alias": "stg_github__issue_assignee_tmp", "checksum": {"name": "sha256", "checksum": "4cab39e652c5972bfa16de13454df8e5745610e91b69f3840305e49a9d613753"}, "tags": [], "refs": [], "sources": [["github", "issue_assignee"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_assignee_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667849269.403893, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_issue_assignee_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee_tmp`"}, "model.github_source.stg_github__issue_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.issue"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_tmp"], "unique_id": "model.github_source.stg_github__issue_tmp", "raw_code": "select *\nfrom {{ var('issue') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_tmp.sql", "name": "stg_github__issue_tmp", "alias": "stg_github__issue_tmp", "checksum": {"name": "sha256", "checksum": "4100b13686c42d580a5eeaab15449896ec2ce740b0e5f002775eb9f222ef7c32"}, "tags": [], "refs": [], "sources": [["github", "issue"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667849269.413236, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_issue_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_tmp`"}, "model.github_source.stg_github__repo_team_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.repo_team"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__repo_team_tmp"], "unique_id": "model.github_source.stg_github__repo_team_tmp", "raw_code": "{{ config(enabled=var('github__using_repo_team', True)) }}\n\nselect * \nfrom {{ var('repo_team') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__repo_team_tmp.sql", "original_file_path": "models/tmp/stg_github__repo_team_tmp.sql", "name": "stg_github__repo_team_tmp", "alias": "stg_github__repo_team_tmp", "checksum": {"name": "sha256", "checksum": "25a704d9235d40dc05601995f184779690eabcc6e3a64d3a0489e00c3e6d13ab"}, "tags": [], "refs": [], "sources": [["github", "repo_team"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__repo_team_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "enabled": true}, "created_at": 1667849269.423819, "compiled_code": "\n\nselect * \nfrom `dbt-package-testing`.`github_integration_tests`.`github_repo_team_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team_tmp`"}, "test.github.unique_github__issues_issue_id.6723b9b1db": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('github__issues')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__issues"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__issues_issue_id"], "unique_id": "test.github.unique_github__issues_issue_id.6723b9b1db", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__issues_issue_id.sql", "original_file_path": "models/github.yml", "name": "unique_github__issues_issue_id", "alias": "unique_github__issues_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__issues"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__issues_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.517782, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select issue_id as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`github__issues`\n where issue_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.github__issues"}, "test.github.not_null_github__issues_issue_id.fed0631e25": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('github__issues')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__issues"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__issues_issue_id"], "unique_id": "test.github.not_null_github__issues_issue_id.fed0631e25", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__issues_issue_id.sql", "original_file_path": "models/github.yml", "name": "not_null_github__issues_issue_id", "alias": "not_null_github__issues_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__issues"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__issues_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.52129, "compiled_code": "\n \n \n\n\n\nselect issue_id\nfrom `dbt-package-testing`.`github_integration_tests`.`github__issues`\nwhere issue_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.github__issues"}, "test.github.unique_github__pull_requests_issue_id.ce23997907": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('github__pull_requests')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__pull_requests"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__pull_requests_issue_id"], "unique_id": "test.github.unique_github__pull_requests_issue_id.ce23997907", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__pull_requests_issue_id.sql", "original_file_path": "models/github.yml", "name": "unique_github__pull_requests_issue_id", "alias": "unique_github__pull_requests_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__pull_requests"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__pull_requests_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.5246751, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select issue_id as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`github__pull_requests`\n where issue_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.github__pull_requests"}, "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('github__pull_requests')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__pull_requests"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__pull_requests_issue_id"], "unique_id": "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__pull_requests_issue_id.sql", "original_file_path": "models/github.yml", "name": "not_null_github__pull_requests_issue_id", "alias": "not_null_github__pull_requests_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__pull_requests"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__pull_requests_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.5279942, "compiled_code": "\n \n \n\n\n\nselect issue_id\nfrom `dbt-package-testing`.`github_integration_tests`.`github__pull_requests`\nwhere issue_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.github__pull_requests"}, "test.github.unique_github__daily_metrics_day.f98cab9456": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "day", "model": "{{ get_where_subquery(ref('github__daily_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__daily_metrics_day"], "unique_id": "test.github.unique_github__daily_metrics_day.f98cab9456", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__daily_metrics_day.sql", "original_file_path": "models/github.yml", "name": "unique_github__daily_metrics_day", "alias": "unique_github__daily_metrics_day", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__daily_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__daily_metrics_day.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.531581, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select day as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`github__daily_metrics`\n where day is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "day", "file_key_name": "models.github__daily_metrics"}, "test.github.not_null_github__daily_metrics_day.647e494434": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "day", "model": "{{ get_where_subquery(ref('github__daily_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__daily_metrics_day"], "unique_id": "test.github.not_null_github__daily_metrics_day.647e494434", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__daily_metrics_day.sql", "original_file_path": "models/github.yml", "name": "not_null_github__daily_metrics_day", "alias": "not_null_github__daily_metrics_day", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__daily_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__daily_metrics_day.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.5348191, "compiled_code": "\n \n \n\n\n\nselect day\nfrom `dbt-package-testing`.`github_integration_tests`.`github__daily_metrics`\nwhere day is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "day", "file_key_name": "models.github__daily_metrics"}, "test.github.unique_github__weekly_metrics_week.6794858a8e": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "week", "model": "{{ get_where_subquery(ref('github__weekly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__weekly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__weekly_metrics_week"], "unique_id": "test.github.unique_github__weekly_metrics_week.6794858a8e", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__weekly_metrics_week.sql", "original_file_path": "models/github.yml", "name": "unique_github__weekly_metrics_week", "alias": "unique_github__weekly_metrics_week", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__weekly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__weekly_metrics_week.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.538055, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select week as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`github__weekly_metrics`\n where week is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "week", "file_key_name": "models.github__weekly_metrics"}, "test.github.not_null_github__weekly_metrics_week.4b0b928243": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "week", "model": "{{ get_where_subquery(ref('github__weekly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__weekly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__weekly_metrics_week"], "unique_id": "test.github.not_null_github__weekly_metrics_week.4b0b928243", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__weekly_metrics_week.sql", "original_file_path": "models/github.yml", "name": "not_null_github__weekly_metrics_week", "alias": "not_null_github__weekly_metrics_week", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__weekly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__weekly_metrics_week.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.541444, "compiled_code": "\n \n \n\n\n\nselect week\nfrom `dbt-package-testing`.`github_integration_tests`.`github__weekly_metrics`\nwhere week is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "week", "file_key_name": "models.github__weekly_metrics"}, "test.github.unique_github__monthly_metrics_month.3076284fbb": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "month", "model": "{{ get_where_subquery(ref('github__monthly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__monthly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__monthly_metrics_month"], "unique_id": "test.github.unique_github__monthly_metrics_month.3076284fbb", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__monthly_metrics_month.sql", "original_file_path": "models/github.yml", "name": "unique_github__monthly_metrics_month", "alias": "unique_github__monthly_metrics_month", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__monthly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__monthly_metrics_month.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.5450659, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select month as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`github__monthly_metrics`\n where month is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "month", "file_key_name": "models.github__monthly_metrics"}, "test.github.not_null_github__monthly_metrics_month.9e4fba84df": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "month", "model": "{{ get_where_subquery(ref('github__monthly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__monthly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__monthly_metrics_month"], "unique_id": "test.github.not_null_github__monthly_metrics_month.9e4fba84df", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__monthly_metrics_month.sql", "original_file_path": "models/github.yml", "name": "not_null_github__monthly_metrics_month", "alias": "not_null_github__monthly_metrics_month", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__monthly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__monthly_metrics_month.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.5483038, "compiled_code": "\n \n \n\n\n\nselect month\nfrom `dbt-package-testing`.`github_integration_tests`.`github__monthly_metrics`\nwhere month is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "month", "file_key_name": "models.github__monthly_metrics"}, "test.github.unique_github__quarterly_metrics_quarter.9165a921c1": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "quarter", "model": "{{ get_where_subquery(ref('github__quarterly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__quarterly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__quarterly_metrics_quarter"], "unique_id": "test.github.unique_github__quarterly_metrics_quarter.9165a921c1", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__quarterly_metrics_quarter.sql", "original_file_path": "models/github.yml", "name": "unique_github__quarterly_metrics_quarter", "alias": "unique_github__quarterly_metrics_quarter", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__quarterly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__quarterly_metrics_quarter.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.551539, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select quarter as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`github__quarterly_metrics`\n where quarter is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "quarter", "file_key_name": "models.github__quarterly_metrics"}, "test.github.not_null_github__quarterly_metrics_quarter.92394d46dc": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "quarter", "model": "{{ get_where_subquery(ref('github__quarterly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__quarterly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__quarterly_metrics_quarter"], "unique_id": "test.github.not_null_github__quarterly_metrics_quarter.92394d46dc", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__quarterly_metrics_quarter.sql", "original_file_path": "models/github.yml", "name": "not_null_github__quarterly_metrics_quarter", "alias": "not_null_github__quarterly_metrics_quarter", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__quarterly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__quarterly_metrics_quarter.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.55484, "compiled_code": "\n \n \n\n\n\nselect quarter\nfrom `dbt-package-testing`.`github_integration_tests`.`github__quarterly_metrics`\nwhere quarter is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "quarter", "file_key_name": "models.github__quarterly_metrics"}, "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["issue_id", "user_id"], "model": "{{ get_where_subquery(ref('stg_github__issue_assignee')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue_assignee"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id"], "unique_id": "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388\") }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388.sql", "original_file_path": "models/stg_github.yml", "name": "dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id", "alias": "dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue_assignee"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388"}, "created_at": 1667849269.684551, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n issue_id, user_id\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee`\n group by issue_id, user_id\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_github__issue_assignee"}, "test.github_source.not_null_stg_github__label_label_id.9f07379974": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "label_id", "model": "{{ get_where_subquery(ref('stg_github__label')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__label"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__label_label_id"], "unique_id": "test.github_source.not_null_stg_github__label_label_id.9f07379974", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__label_label_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__label_label_id", "alias": "not_null_stg_github__label_label_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__label"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__label_label_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.704911, "compiled_code": "\n \n \n\n\n\nselect label_id\nfrom `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\nwhere label_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "label_id", "file_key_name": "models.stg_github__label"}, "test.github_source.unique_stg_github__label_label_id.74d3c21466": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "label_id", "model": "{{ get_where_subquery(ref('stg_github__label')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__label"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__label_label_id"], "unique_id": "test.github_source.unique_stg_github__label_label_id.74d3c21466", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__label_label_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__label_label_id", "alias": "unique_stg_github__label_label_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__label"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__label_label_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.708118, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select label_id as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\n where label_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "label_id", "file_key_name": "models.stg_github__label"}, "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["issue_id", "updated_at"], "model": "{{ get_where_subquery(ref('stg_github__issue_closed_history')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue_closed_history"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at"], "unique_id": "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f\") }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f.sql", "original_file_path": "models/stg_github.yml", "name": "dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at", "alias": "dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue_closed_history"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f"}, "created_at": 1667849269.711691, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n issue_id, updated_at\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history`\n group by issue_id, updated_at\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_github__issue_closed_history"}, "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "issue_comment_id", "model": "{{ get_where_subquery(ref('stg_github__issue_comment')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue_comment"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__issue_comment_issue_comment_id"], "unique_id": "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__issue_comment_issue_comment_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__issue_comment_issue_comment_id", "alias": "unique_stg_github__issue_comment_issue_comment_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue_comment"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__issue_comment_issue_comment_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.719666, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select issue_comment_id as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment`\n where issue_comment_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_comment_id", "file_key_name": "models.stg_github__issue_comment"}, "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "issue_comment_id", "model": "{{ get_where_subquery(ref('stg_github__issue_comment')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue_comment"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__issue_comment_issue_comment_id"], "unique_id": "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__issue_comment_issue_comment_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__issue_comment_issue_comment_id", "alias": "not_null_stg_github__issue_comment_issue_comment_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue_comment"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__issue_comment_issue_comment_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.723181, "compiled_code": "\n \n \n\n\n\nselect issue_comment_id\nfrom `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment`\nwhere issue_comment_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_comment_id", "file_key_name": "models.stg_github__issue_comment"}, "test.github_source.unique_stg_github__issue_issue_id.84891aeece": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('stg_github__issue')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__issue_issue_id"], "unique_id": "test.github_source.unique_stg_github__issue_issue_id.84891aeece", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__issue_issue_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__issue_issue_id", "alias": "unique_stg_github__issue_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__issue_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.726414, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select issue_id as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n where issue_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.stg_github__issue"}, "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('stg_github__issue')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__issue_issue_id"], "unique_id": "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__issue_issue_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__issue_issue_id", "alias": "not_null_stg_github__issue_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__issue_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.7296598, "compiled_code": "\n \n \n\n\n\nselect issue_id\nfrom `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\nwhere issue_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.stg_github__issue"}, "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "pull_request_review_id", "model": "{{ get_where_subquery(ref('stg_github__pull_request_review')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__pull_request_review"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__pull_request_review_pull_request_review_id"], "unique_id": "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__pull_request_review_pull_request_review_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__pull_request_review_pull_request_review_id", "alias": "unique_stg_github__pull_request_review_pull_request_review_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__pull_request_review"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__pull_request_review_pull_request_review_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.7329721, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select pull_request_review_id as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n where pull_request_review_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "pull_request_review_id", "file_key_name": "models.stg_github__pull_request_review"}, "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "pull_request_review_id", "model": "{{ get_where_subquery(ref('stg_github__pull_request_review')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__pull_request_review"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__pull_request_review_pull_request_review_id"], "unique_id": "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__pull_request_review_pull_request_review_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__pull_request_review_pull_request_review_id", "alias": "not_null_stg_github__pull_request_review_pull_request_review_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__pull_request_review"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__pull_request_review_pull_request_review_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.736512, "compiled_code": "\n \n \n\n\n\nselect pull_request_review_id\nfrom `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\nwhere pull_request_review_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "pull_request_review_id", "file_key_name": "models.stg_github__pull_request_review"}, "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "pull_request_id", "model": "{{ get_where_subquery(ref('stg_github__pull_request')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__pull_request"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__pull_request_pull_request_id"], "unique_id": "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__pull_request_pull_request_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__pull_request_pull_request_id", "alias": "unique_stg_github__pull_request_pull_request_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__pull_request"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__pull_request_pull_request_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.739743, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select pull_request_id as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n where pull_request_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "pull_request_id", "file_key_name": "models.stg_github__pull_request"}, "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "pull_request_id", "model": "{{ get_where_subquery(ref('stg_github__pull_request')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__pull_request"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__pull_request_pull_request_id"], "unique_id": "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__pull_request_pull_request_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__pull_request_pull_request_id", "alias": "not_null_stg_github__pull_request_pull_request_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__pull_request"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__pull_request_pull_request_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.742954, "compiled_code": "\n \n \n\n\n\nselect pull_request_id\nfrom `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\nwhere pull_request_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "pull_request_id", "file_key_name": "models.stg_github__pull_request"}, "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "repository_id", "model": "{{ get_where_subquery(ref('stg_github__repo_team')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__repo_team"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__repo_team_repository_id"], "unique_id": "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__repo_team_repository_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__repo_team_repository_id", "alias": "not_null_stg_github__repo_team_repository_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__repo_team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__repo_team_repository_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.7461839, "compiled_code": "\n \n \n\n\n\nselect repository_id\nfrom `dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team`\nwhere repository_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "repository_id", "file_key_name": "models.stg_github__repo_team"}, "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "team_id", "model": "{{ get_where_subquery(ref('stg_github__repo_team')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__repo_team"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__repo_team_team_id"], "unique_id": "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__repo_team_team_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__repo_team_team_id", "alias": "not_null_stg_github__repo_team_team_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__repo_team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__repo_team_team_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.749707, "compiled_code": "\n \n \n\n\n\nselect team_id\nfrom `dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team`\nwhere team_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "team_id", "file_key_name": "models.stg_github__repo_team"}, "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "repository_id", "model": "{{ get_where_subquery(ref('stg_github__repository')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__repository"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__repository_repository_id"], "unique_id": "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__repository_repository_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__repository_repository_id", "alias": "unique_stg_github__repository_repository_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__repository"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__repository_repository_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.752929, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select repository_id as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repository`\n where repository_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "repository_id", "file_key_name": "models.stg_github__repository"}, "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "repository_id", "model": "{{ get_where_subquery(ref('stg_github__repository')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__repository"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__repository_repository_id"], "unique_id": "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__repository_repository_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__repository_repository_id", "alias": "not_null_stg_github__repository_repository_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__repository"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__repository_repository_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.756143, "compiled_code": "\n \n \n\n\n\nselect repository_id\nfrom `dbt-package-testing`.`github_integration_tests`.`stg_github__repository`\nwhere repository_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "repository_id", "file_key_name": "models.stg_github__repository"}, "test.github_source.unique_stg_github__team_team_id.94e9716ab4": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "team_id", "model": "{{ get_where_subquery(ref('stg_github__team')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__team"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__team_team_id"], "unique_id": "test.github_source.unique_stg_github__team_team_id.94e9716ab4", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__team_team_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__team_team_id", "alias": "unique_stg_github__team_team_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__team_team_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.759424, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select team_id as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__team`\n where team_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "team_id", "file_key_name": "models.stg_github__team"}, "test.github_source.not_null_stg_github__team_team_id.440aefe7a7": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "team_id", "model": "{{ get_where_subquery(ref('stg_github__team')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__team"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__team_team_id"], "unique_id": "test.github_source.not_null_stg_github__team_team_id.440aefe7a7", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__team_team_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__team_team_id", "alias": "not_null_stg_github__team_team_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__team_team_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.763335, "compiled_code": "\n \n \n\n\n\nselect team_id\nfrom `dbt-package-testing`.`github_integration_tests`.`stg_github__team`\nwhere team_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "team_id", "file_key_name": "models.stg_github__team"}, "test.github_source.unique_stg_github__user_user_id.5c1a00cd90": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(ref('stg_github__user')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__user"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__user_user_id"], "unique_id": "test.github_source.unique_stg_github__user_user_id.5c1a00cd90", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__user_user_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__user_user_id", "alias": "unique_stg_github__user_user_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__user"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__user_user_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.766531, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select user_id as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n where user_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "user_id", "file_key_name": "models.stg_github__user"}, "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(ref('stg_github__user')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__user"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__user_user_id"], "unique_id": "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__user_user_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__user_user_id", "alias": "not_null_stg_github__user_user_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__user"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__user_user_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.769741, "compiled_code": "\n \n \n\n\n\nselect user_id\nfrom `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "user_id", "file_key_name": "models.stg_github__user"}}, "sources": {"source.github_source.github.issue_assignee": {"fqn": ["github_source", "github", "issue_assignee"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue_assignee", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue_assignee", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_issue_assignee_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table with the current user(s) assigned to an issue", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_assignee_data`", "created_at": 1667849269.7722812}, "source.github_source.github.label": {"fqn": ["github_source", "github", "label"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.label", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "label", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_label_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Table that contains labels that are used across your Github account within individual repositories.", "columns": {"id": {"name": "id", "description": "Unique identifier of the Github label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of the record being synced by Fivetran", "meta": {}, "data_type": null, "quote": null, "tags": []}, "color": {"name": "color", "description": "The color of the label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "The description of the label indicating the purpose", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_default": {"name": "is_default", "description": "Boolean flagging if the label is default on creation", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "Name of the label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url": {"name": "url", "description": "Url where the label was used", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_label_data`", "created_at": 1667849269.7725282}, "source.github_source.github.issue_closed_history": {"fqn": ["github_source", "github", "issue_closed_history"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue_closed_history", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue_closed_history", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_issue_closed_history_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table to track when an issue is closed or re-opened", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the action took place", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed": {"name": "closed", "description": "Boolean variable for if the issue was closed (true) or re-opened (false)", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_closed_history_data`", "created_at": 1667849269.772745}, "source.github_source.github.issue_label": {"fqn": ["github_source", "github", "issue_label"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue_label", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue_label", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_issue_label_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "The current labels attached to an issue", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "label_id": {"name": "label_id", "description": "Unique identifier of the used label", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_label_data`", "created_at": 1667849269.772955}, "source.github_source.github.issue_comment": {"fqn": ["github_source", "github", "issue_comment"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue_comment", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue_comment", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_issue_comment_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table that contains comments made on issues", "columns": {"id": {"name": "id", "description": "System generated unique id for the issue comment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_comment_data`", "created_at": 1667849269.773164}, "source.github_source.github.issue_merged": {"fqn": ["github_source", "github", "issue_merged"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue_merged", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue_merged", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_issue_merged_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table that tracks when an issue (always a pull request) is merged", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table. This table will only reference issues that are pull requests", "meta": {}, "data_type": null, "quote": null, "tags": []}, "merged_at": {"name": "merged_at", "description": "Timestamp of when the code merge took place", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_merged_data`", "created_at": 1667849269.773365}, "source.github_source.github.issue": {"fqn": ["github_source", "github", "issue"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_issue_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table that contains 1 entry for every issue created. Pull Requests also create an entry in this table, and there is a boolean field to determine if an entry is a pull request.", "columns": {"id": {"name": "id", "description": "System generated unique id for the issue. This is not the number that appears in the URL.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "body": {"name": "body", "description": "The text of the main description of the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "locked": {"name": "locked", "description": "Boolean indicating whether the issue is locked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed_at": {"name": "closed_at", "description": "Timestamp of when the issue was closed, NULL for issues that are open.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the issue was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "milestone_id": {"name": "milestone_id", "description": "Foreign key that references the milestone table representing the current milestone the issue is in.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number": {"name": "number", "description": "The issue number within a repository. Is unique by repository, but not across repositories.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pull_request": {"name": "pull_request", "description": "Boolean for is the issue is a pull request (true) ot regular issue (false)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_id": {"name": "repository_id", "description": "Foreign key that references the repository table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the issue is open or closed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "Title of the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the last update was made to the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table, representing the user that created the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_data`", "created_at": 1667849269.7735941}, "source.github_source.github.pull_request_review": {"fqn": ["github_source", "github", "pull_request_review"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.pull_request_review", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "pull_request_review", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_pull_request_review_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table containing reviews made to pull requests", "columns": {"id": {"name": "id", "description": "System generated unique id for the pull request review.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pull_request_id": {"name": "pull_request_id", "description": "Foreign key that references the pull request table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "submitted_at": {"name": "submitted_at", "description": "Timestamp of when the request for review was submitted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the review was an approval, request for change, comment, dismissal.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table, representing the user that reviewed the pull request.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_pull_request_review_data`", "created_at": 1667849269.7738008}, "source.github_source.github.pull_request": {"fqn": ["github_source", "github", "pull_request"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.pull_request", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "pull_request", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_pull_request_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "A special type of issue that is created when a user wants to merge one branch of code into another", "columns": {"id": {"name": "id", "description": "System generated unique id for the pull request.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "head_repo_id": {"name": "head_repo_id", "description": "Foreign key that references the repository table, referencing the current branch.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "head_user_id": {"name": "head_user_id", "description": "Foreign key that references the user table, referencing who created the current branch.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_pull_request_data`", "created_at": 1667849269.774009}, "source.github_source.github.repo_team": {"fqn": ["github_source", "github", "repo_team"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.repo_team", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "repo_team", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_repo_team_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table representing the mapping relationships between repositories and teams", "columns": {"repository_id": {"name": "repository_id", "description": "Reference to the respective repository for the record.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "team_id": {"name": "team_id", "description": "Reference to the respective team for the record.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {"is_enabled": true}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_repo_team_data`", "created_at": 1667849269.774208}, "source.github_source.github.repository": {"fqn": ["github_source", "github", "repository"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.repository", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "repository", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_repository_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Table representing the file structure of a directory under git control", "columns": {"id": {"name": "id", "description": "System generated unique id for the repository.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the repository was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "full_name": {"name": "full_name", "description": "The name of the git repository.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "private": {"name": "private", "description": "Boolean field indicating whether the repository is private (true) or public (false).", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_repository_data`", "created_at": 1667849269.774401}, "source.github_source.github.requested_reviewer_history": {"fqn": ["github_source", "github", "requested_reviewer_history"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.requested_reviewer_history", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "requested_reviewer_history", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_requested_reviewer_history_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table containing when a user requests another user to review a pull request", "columns": {"pull_request_id": {"name": "pull_request_id", "description": "Foreign key that references the pull request table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the review was submitted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "requested_id": {"name": "requested_id", "description": "Foreign key that references the user table, representing the user that was requested to review a PR.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "removed": {"name": "removed", "description": "Boolean variable indicating if the requester was removed from the PR (true) or added to the PR (false).", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_requested_reviewer_history_data`", "created_at": 1667849269.7746072}, "source.github_source.github.team": {"fqn": ["github_source", "github", "team"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.team", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "team", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_team_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table containing teams and team details", "columns": {"id": {"name": "id", "description": "System generated unique id for the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "User created description of the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "User created name of the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "Reference to the parent team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "privacy": {"name": "privacy", "description": "Type of privacy permissions associated with the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "slug": {"name": "slug", "description": "Url friendly version of the team name.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_team_data`", "created_at": 1667849269.774818}, "source.github_source.github.user": {"fqn": ["github_source", "github", "user"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.user", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "user", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_user_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Table representing contributors to a git project", "columns": {"id": {"name": "id", "description": "System generated unique id for the user.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "login": {"name": "login", "description": "The alias the user uses to login to github.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the user", "meta": {}, "data_type": null, "quote": null, "tags": []}, "company": {"name": "company", "description": "The company of the user.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_user_data`", "created_at": 1667849269.775011}}, "macros": {"macro.dbt_bigquery.date_sharded_table": {"unique_id": "macro.dbt_bigquery.date_sharded_table", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "date_sharded_table", "macro_sql": "{% macro date_sharded_table(base_name) %}\n {{ return(base_name ~ \"[DBT__PARTITION_DATE]\") }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.022051, "supported_languages": null}, "macro.dbt_bigquery.grant_access_to": {"unique_id": "macro.dbt_bigquery.grant_access_to", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "grant_access_to", "macro_sql": "{% macro grant_access_to(entity, entity_type, role, grant_target_dict) -%}\n {% do adapter.grant_access_to(entity, entity_type, role, grant_target_dict) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.0227761, "supported_languages": null}, "macro.dbt_bigquery.get_partitions_metadata": {"unique_id": "macro.dbt_bigquery.get_partitions_metadata", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "get_partitions_metadata", "macro_sql": "\n\n{%- macro get_partitions_metadata(table) -%}\n {%- if execute -%}\n {%- set res = adapter.get_partitions_metadata(table) -%}\n {{- return(res) -}}\n {%- endif -%}\n {{- return(None) -}}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.023689, "supported_languages": null}, "macro.dbt_bigquery.bigquery__get_catalog": {"unique_id": "macro.dbt_bigquery.bigquery__get_catalog", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "name": "bigquery__get_catalog", "macro_sql": "{% macro bigquery__get_catalog(information_schema, schemas) -%}\n\n {%- if (schemas | length) == 0 -%}\n {# Hopefully nothing cares about the columns we return when there are no rows #}\n {%- set query = \"select 1 as id limit 0\" -%}\n {%- else -%}\n\n {%- set query -%}\n with tables as (\n select\n project_id as table_database,\n dataset_id as table_schema,\n table_id as original_table_name,\n\n concat(project_id, '.', dataset_id, '.', table_id) as relation_id,\n\n row_count,\n size_bytes as size_bytes,\n case\n when type = 1 then 'table'\n when type = 2 then 'view'\n else 'external'\n end as table_type,\n\n REGEXP_CONTAINS(table_id, '^.+[0-9]{8}$') and coalesce(type, 0) = 1 as is_date_shard,\n REGEXP_EXTRACT(table_id, '^(.+)[0-9]{8}$') as shard_base_name,\n REGEXP_EXTRACT(table_id, '^.+([0-9]{8})$') as shard_name\n\n from {{ information_schema.replace(information_schema_view='__TABLES__') }}\n where (\n {%- for schema in schemas -%}\n upper(dataset_id) = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n ),\n\n extracted as (\n\n select *,\n case\n when is_date_shard then shard_base_name\n else original_table_name\n end as table_name\n\n from tables\n\n ),\n\n unsharded_tables as (\n\n select\n table_database,\n table_schema,\n table_name,\n coalesce(table_type, 'external') as table_type,\n is_date_shard,\n\n struct(\n min(shard_name) as shard_min,\n max(shard_name) as shard_max,\n count(*) as shard_count\n ) as table_shards,\n\n sum(size_bytes) as size_bytes,\n sum(row_count) as row_count,\n\n max(relation_id) as relation_id\n\n from extracted\n group by 1,2,3,4,5\n\n ),\n\n info_schema_columns as (\n\n select\n concat(table_catalog, '.', table_schema, '.', table_name) as relation_id,\n table_catalog as table_database,\n table_schema,\n table_name,\n\n -- use the \"real\" column name from the paths query below\n column_name as base_column_name,\n ordinal_position as column_index,\n\n is_partitioning_column,\n clustering_ordinal_position\n\n from {{ information_schema.replace(information_schema_view='COLUMNS') }}\n where ordinal_position is not null\n\n ),\n\n info_schema_column_paths as (\n\n select\n concat(table_catalog, '.', table_schema, '.', table_name) as relation_id,\n field_path as column_name,\n data_type as column_type,\n column_name as base_column_name,\n description as column_comment\n\n from {{ information_schema.replace(information_schema_view='COLUMN_FIELD_PATHS') }}\n\n ),\n\n columns as (\n\n select * except (base_column_name)\n from info_schema_columns\n join info_schema_column_paths using (relation_id, base_column_name)\n\n ),\n\n column_stats as (\n\n select\n table_database,\n table_schema,\n table_name,\n max(relation_id) as relation_id,\n max(case when is_partitioning_column = 'YES' then 1 else 0 end) = 1 as is_partitioned,\n max(case when is_partitioning_column = 'YES' then column_name else null end) as partition_column,\n max(case when clustering_ordinal_position is not null then 1 else 0 end) = 1 as is_clustered,\n array_to_string(\n array_agg(\n case\n when clustering_ordinal_position is not null then column_name\n else null\n end ignore nulls\n order by clustering_ordinal_position\n ), ', '\n ) as clustering_columns\n\n from columns\n group by 1,2,3\n\n )\n\n select\n unsharded_tables.table_database,\n unsharded_tables.table_schema,\n case\n when is_date_shard then concat(unsharded_tables.table_name, '*')\n else unsharded_tables.table_name\n end as table_name,\n unsharded_tables.table_type,\n\n -- coalesce name and type for External tables - these columns are not\n -- present in the COLUMN_FIELD_PATHS resultset\n coalesce(columns.column_name, '') as column_name,\n -- invent a row number to account for nested fields -- BQ does\n -- not treat these nested properties as independent fields\n row_number() over (\n partition by relation_id\n order by columns.column_index, columns.column_name\n ) as column_index,\n coalesce(columns.column_type, '') as column_type,\n columns.column_comment,\n\n 'Shard count' as `stats__date_shards__label`,\n table_shards.shard_count as `stats__date_shards__value`,\n 'The number of date shards in this table' as `stats__date_shards__description`,\n is_date_shard as `stats__date_shards__include`,\n\n 'Shard (min)' as `stats__date_shard_min__label`,\n table_shards.shard_min as `stats__date_shard_min__value`,\n 'The first date shard in this table' as `stats__date_shard_min__description`,\n is_date_shard as `stats__date_shard_min__include`,\n\n 'Shard (max)' as `stats__date_shard_max__label`,\n table_shards.shard_max as `stats__date_shard_max__value`,\n 'The last date shard in this table' as `stats__date_shard_max__description`,\n is_date_shard as `stats__date_shard_max__include`,\n\n '# Rows' as `stats__num_rows__label`,\n row_count as `stats__num_rows__value`,\n 'Approximate count of rows in this table' as `stats__num_rows__description`,\n (unsharded_tables.table_type = 'table') as `stats__num_rows__include`,\n\n 'Approximate Size' as `stats__num_bytes__label`,\n size_bytes as `stats__num_bytes__value`,\n 'Approximate size of table as reported by BigQuery' as `stats__num_bytes__description`,\n (unsharded_tables.table_type = 'table') as `stats__num_bytes__include`,\n\n 'Partitioned By' as `stats__partitioning_type__label`,\n partition_column as `stats__partitioning_type__value`,\n 'The partitioning column for this table' as `stats__partitioning_type__description`,\n is_partitioned as `stats__partitioning_type__include`,\n\n 'Clustered By' as `stats__clustering_fields__label`,\n clustering_columns as `stats__clustering_fields__value`,\n 'The clustering columns for this table' as `stats__clustering_fields__description`,\n is_clustered as `stats__clustering_fields__include`\n\n -- join using relation_id (an actual relation, not a shard prefix) to make\n -- sure that column metadata is picked up through the join. This will only\n -- return the column information for the \"max\" table in a date-sharded table set\n from unsharded_tables\n left join columns using (relation_id)\n left join column_stats using (relation_id)\n {%- endset -%}\n\n {%- endif -%}\n\n {{ return(run_query(query)) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.032407, "supported_languages": null}, "macro.dbt_bigquery.partition_by": {"unique_id": "macro.dbt_bigquery.partition_by", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "partition_by", "macro_sql": "{% macro partition_by(partition_config) -%}\n {%- if partition_config is none -%}\n {% do return('') %}\n {%- elif partition_config.data_type | lower in ('date','timestamp','datetime') -%}\n partition by {{ partition_config.render() }}\n {%- elif partition_config.data_type | lower in ('int64') -%}\n {%- set range = partition_config.range -%}\n partition by range_bucket(\n {{ partition_config.field }},\n generate_array({{ range.start}}, {{ range.end }}, {{ range.interval }})\n )\n {%- endif -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.0429142, "supported_languages": null}, "macro.dbt_bigquery.cluster_by": {"unique_id": "macro.dbt_bigquery.cluster_by", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "cluster_by", "macro_sql": "{% macro cluster_by(raw_cluster_by) %}\n {%- if raw_cluster_by is not none -%}\n cluster by {% if raw_cluster_by is string -%}\n {% set raw_cluster_by = [raw_cluster_by] %}\n {%- endif -%}\n {%- for cluster in raw_cluster_by -%}\n {{ cluster }}\n {%- if not loop.last -%}, {% endif -%}\n {%- endfor -%}\n\n {% endif %}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.044132, "supported_languages": null}, "macro.dbt_bigquery.bigquery_options": {"unique_id": "macro.dbt_bigquery.bigquery_options", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_options", "macro_sql": "{% macro bigquery_options(opts) %}\n {% set options -%}\n OPTIONS({% for opt_key, opt_val in opts.items() %}\n {{ opt_key }}={{ opt_val }}{{ \",\" if not loop.last }}\n {% endfor %})\n {%- endset %}\n {%- do return(options) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.045302, "supported_languages": null}, "macro.dbt_bigquery.bigquery_table_options": {"unique_id": "macro.dbt_bigquery.bigquery_table_options", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_table_options", "macro_sql": "{% macro bigquery_table_options(config, node, temporary) %}\n {% set opts = adapter.get_table_options(config, node, temporary) %}\n {%- do return(bigquery_options(opts)) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.046165, "supported_languages": null}, "macro.dbt_bigquery.bigquery__create_table_as": {"unique_id": "macro.dbt_bigquery.bigquery__create_table_as", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_table_as", "macro_sql": "{% macro bigquery__create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {%- if language == '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 {{ compiled_code }}\n );\n {%- elif language == 'python' -%}\n {#--\n N.B. Python models _can_ write to temp views HOWEVER they use a different session\n and have already expired by the time they need to be used (I.E. in merges for incremental models)\n\n TODO: Deep dive into spark sessions to see if we can reuse a single session for an entire\n dbt invocation.\n --#}\n {{ py_write_table(compiled_code=compiled_code, target_relation=relation.quote(database=False, schema=False, identifier=False)) }}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"bigquery__create_table_as macro didn't get supported language, it got %s\" % language) %}\n {%- endif -%}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.partition_by", "macro.dbt_bigquery.cluster_by", "macro.dbt_bigquery.bigquery_table_options", "macro.dbt_bigquery.py_write_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.0493171, "supported_languages": null}, "macro.dbt_bigquery.bigquery_view_options": {"unique_id": "macro.dbt_bigquery.bigquery_view_options", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_view_options", "macro_sql": "{% macro bigquery_view_options(config, node) %}\n {% set opts = adapter.get_view_options(config, node) %}\n {%- do return(bigquery_options(opts)) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.050119, "supported_languages": null}, "macro.dbt_bigquery.bigquery__create_view_as": {"unique_id": "macro.dbt_bigquery.bigquery__create_view_as", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_view_as", "macro_sql": "{% macro bigquery__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create or replace view {{ relation }}\n {{ bigquery_view_options(config, model) }}\n as {{ sql }};\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_view_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.051152, "supported_languages": null}, "macro.dbt_bigquery.bigquery__drop_schema": {"unique_id": "macro.dbt_bigquery.bigquery__drop_schema", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__drop_schema", "macro_sql": "{% macro bigquery__drop_schema(relation) -%}\n {{ adapter.drop_schema(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.051597, "supported_languages": null}, "macro.dbt_bigquery.bigquery__drop_relation": {"unique_id": "macro.dbt_bigquery.bigquery__drop_relation", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__drop_relation", "macro_sql": "{% macro bigquery__drop_relation(relation) -%}\n {% call statement('drop_relation') -%}\n drop {{ relation.type }} if exists {{ relation }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.0522392, "supported_languages": null}, "macro.dbt_bigquery.bigquery__get_columns_in_relation": {"unique_id": "macro.dbt_bigquery.bigquery__get_columns_in_relation", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__get_columns_in_relation", "macro_sql": "{% macro bigquery__get_columns_in_relation(relation) -%}\n {{ return(adapter.get_columns_in_relation(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.052743, "supported_languages": null}, "macro.dbt_bigquery.bigquery__list_relations_without_caching": {"unique_id": "macro.dbt_bigquery.bigquery__list_relations_without_caching", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__list_relations_without_caching", "macro_sql": "{% macro bigquery__list_relations_without_caching(schema_relation) -%}\n {{ return(adapter.list_relations_without_caching(schema_relation)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.053236, "supported_languages": null}, "macro.dbt_bigquery.bigquery__list_schemas": {"unique_id": "macro.dbt_bigquery.bigquery__list_schemas", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__list_schemas", "macro_sql": "{% macro bigquery__list_schemas(database) -%}\n {{ return(adapter.list_schemas(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.053741, "supported_languages": null}, "macro.dbt_bigquery.bigquery__check_schema_exists": {"unique_id": "macro.dbt_bigquery.bigquery__check_schema_exists", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__check_schema_exists", "macro_sql": "{% macro bigquery__check_schema_exists(information_schema, schema) %}\n {{ return(adapter.check_schema_exists(information_schema.database, schema)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.054348, "supported_languages": null}, "macro.dbt_bigquery.bigquery__persist_docs": {"unique_id": "macro.dbt_bigquery.bigquery__persist_docs", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__persist_docs", "macro_sql": "{% macro bigquery__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do alter_column_comment(relation, model.columns) %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.055437, "supported_languages": null}, "macro.dbt_bigquery.bigquery__alter_column_comment": {"unique_id": "macro.dbt_bigquery.bigquery__alter_column_comment", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_column_comment", "macro_sql": "{% macro bigquery__alter_column_comment(relation, column_dict) -%}\n {% do adapter.update_columns(relation, column_dict) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.055968, "supported_languages": null}, "macro.dbt_bigquery.bigquery__rename_relation": {"unique_id": "macro.dbt_bigquery.bigquery__rename_relation", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__rename_relation", "macro_sql": "{% macro bigquery__rename_relation(from_relation, to_relation) -%}\n {% do adapter.rename_relation(from_relation, to_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.056488, "supported_languages": null}, "macro.dbt_bigquery.bigquery__alter_relation_add_columns": {"unique_id": "macro.dbt_bigquery.bigquery__alter_relation_add_columns", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_relation_add_columns", "macro_sql": "{% macro bigquery__alter_relation_add_columns(relation, add_columns) %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation }}\n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {{ return(run_query(sql)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.057782, "supported_languages": null}, "macro.dbt_bigquery.bigquery__alter_relation_drop_columns": {"unique_id": "macro.dbt_bigquery.bigquery__alter_relation_drop_columns", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_relation_drop_columns", "macro_sql": "{% macro bigquery__alter_relation_drop_columns(relation, drop_columns) %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation }}\n\n {% for column in drop_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {{ return(run_query(sql)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.059009, "supported_languages": null}, "macro.dbt_bigquery.bigquery__alter_column_type": {"unique_id": "macro.dbt_bigquery.bigquery__alter_column_type", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_column_type", "macro_sql": "{% macro bigquery__alter_column_type(relation, column_name, new_column_type) -%}\n {#-- Changing a column's data type using a query requires you to scan the entire table.\n The query charges can be significant if the table is very large.\n\n https://cloud.google.com/bigquery/docs/manually-changing-schemas#changing_a_columns_data_type\n #}\n {% set relation_columns = get_columns_in_relation(relation) %}\n\n {% set sql %}\n select\n {%- for col in relation_columns -%}\n {% if col.column == column_name %}\n CAST({{ col.quoted }} AS {{ new_column_type }}) AS {{ col.quoted }}\n {%- else %}\n {{ col.quoted }}\n {%- endif %}\n {%- if not loop.last %},{% endif -%}\n {%- endfor %}\n from {{ relation }}\n {% endset %}\n\n {% call statement('alter_column_type') %}\n {{ create_table_as(False, relation, sql)}}\n {%- endcall %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_columns_in_relation", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.061151, "supported_languages": null}, "macro.dbt_bigquery.bigquery__test_unique": {"unique_id": "macro.dbt_bigquery.bigquery__test_unique", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__test_unique", "macro_sql": "{% macro bigquery__test_unique(model, column_name) %}\n\nwith dbt_test__target as (\n\n select {{ column_name }} as unique_field\n from {{ model }}\n where {{ column_name }} is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.061717, "supported_languages": null}, "macro.dbt_bigquery.bigquery__upload_file": {"unique_id": "macro.dbt_bigquery.bigquery__upload_file", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__upload_file", "macro_sql": "{% macro bigquery__upload_file(local_file_path, database, table_schema, table_name) %}\n\n {{ log(\"kwargs: \" ~ kwargs) }}\n\n {% do adapter.upload_file(local_file_path, database, table_schema, table_name, kwargs=kwargs) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.0626261, "supported_languages": null}, "macro.dbt_bigquery.bigquery__create_csv_table": {"unique_id": "macro.dbt_bigquery.bigquery__create_csv_table", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__create_csv_table", "macro_sql": "{% macro bigquery__create_csv_table(model, agate_table) %}\n -- no-op\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.0637472, "supported_languages": null}, "macro.dbt_bigquery.bigquery__reset_csv_table": {"unique_id": "macro.dbt_bigquery.bigquery__reset_csv_table", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__reset_csv_table", "macro_sql": "{% macro bigquery__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.064283, "supported_languages": null}, "macro.dbt_bigquery.bigquery__load_csv_rows": {"unique_id": "macro.dbt_bigquery.bigquery__load_csv_rows", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__load_csv_rows", "macro_sql": "{% macro bigquery__load_csv_rows(model, agate_table) %}\n\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {{ adapter.load_dataframe(model['database'], model['schema'], model['alias'],\n \t\t\t\t\t\t\tagate_table, column_override) }}\n {% if config.persist_relation_docs() and 'description' in model %}\n\n \t{{ adapter.update_table_description(model['database'], model['schema'], model['alias'], model['description']) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.0662348, "supported_languages": null}, "macro.dbt_bigquery.bigquery__handle_existing_table": {"unique_id": "macro.dbt_bigquery.bigquery__handle_existing_table", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/view.sql", "original_file_path": "macros/materializations/view.sql", "name": "bigquery__handle_existing_table", "macro_sql": "{% macro bigquery__handle_existing_table(full_refresh, old_relation) %}\n {%- if full_refresh -%}\n {{ adapter.drop_relation(old_relation) }}\n {%- else -%}\n {{ exceptions.relation_wrong_type(old_relation, 'view') }}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.068089, "supported_languages": null}, "macro.dbt_bigquery.materialization_view_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_view_bigquery", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/view.sql", "original_file_path": "macros/materializations/view.sql", "name": "materialization_view_bigquery", "macro_sql": "{% materialization view, adapter='bigquery' -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {% set to_return = create_or_replace_view() %}\n\n {% set target_relation = this.incorporate(type='view') %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if config.get('grant_access_to') %}\n {% for grant_target_dict in config.get('grant_access_to') %}\n {% do adapter.grant_access_to(this, 'view', None, grant_target_dict) %}\n {% endfor %}\n {% endif %}\n\n {% do return(to_return) %}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_or_replace_view", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.0702488, "supported_languages": ["sql"]}, "macro.dbt_bigquery.materialization_table_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_table_bigquery", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "name": "materialization_table_bigquery", "macro_sql": "{% materialization table, adapter='bigquery', supported_languages=['sql', 'python']-%}\n\n {%- set language = model['language'] -%}\n {%- set identifier = model['alias'] -%}\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_not_as_table = (old_relation is not none and not old_relation.is_table) -%}\n {%- set target_relation = api.Relation.create(database=database, schema=schema, identifier=identifier, type='table') -%}\n\n -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\n\n {{ run_hooks(pre_hooks) }}\n\n {#\n We only need to drop this thing if it is not a table.\n If it _is_ already a table, then we can overwrite it without downtime\n Unlike table -> view, no need for `--full-refresh`: dropping a view is no big deal\n #}\n {%- if exists_not_as_table -%}\n {{ adapter.drop_relation(old_relation) }}\n {%- endif -%}\n\n -- build model\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set partition_by = adapter.parse_partition_by(raw_partition_by) -%}\n {%- set cluster_by = config.get('cluster_by', none) -%}\n {% if not adapter.is_replaceable(old_relation, partition_by, cluster_by) %}\n {% do log(\"Hard refreshing \" ~ old_relation ~ \" because it is not replaceable\") %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n\n -- build model\n {%- call statement('main', language=language) -%}\n {{ create_table_as(False, target_relation, compiled_code, language) }}\n {%- endcall -%}\n\n {{ run_hooks(post_hooks) }}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.079746, "supported_languages": ["sql", "python"]}, "macro.dbt_bigquery.py_write_table": {"unique_id": "macro.dbt_bigquery.py_write_table", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "name": "py_write_table", "macro_sql": "{% macro py_write_table(compiled_code, target_relation) %}\nfrom pyspark.sql import SparkSession\n\nspark = SparkSession.builder.appName('smallTest').getOrCreate()\n\nspark.conf.set(\"viewsEnabled\",\"true\")\nspark.conf.set(\"temporaryGcsBucket\",\"{{target.gcs_bucket}}\")\n\n{{ compiled_code }}\ndbt = dbtObj(spark.read.format(\"bigquery\").load)\ndf = model(dbt, spark)\n\n# COMMAND ----------\n# this is materialization code dbt generated, please do not modify\n\nimport pyspark\n# make sure pandas exists before using it\ntry:\n import pandas\n pandas_available = True\nexcept ImportError:\n pandas_available = False\n\n# make sure pyspark.pandas exists before using it\ntry:\n import pyspark.pandas\n pyspark_pandas_api_available = True\nexcept ImportError:\n pyspark_pandas_api_available = False\n\n# make sure databricks.koalas exists before using it\ntry:\n import databricks.koalas\n koalas_available = True\nexcept ImportError:\n koalas_available = False\n\n# preferentially convert pandas DataFrames to pandas-on-Spark or Koalas DataFrames first\n# since they know how to convert pandas DataFrames better than `spark.createDataFrame(df)`\n# and converting from pandas-on-Spark to Spark DataFrame has no overhead\nif pyspark_pandas_api_available and pandas_available and isinstance(df, pandas.core.frame.DataFrame):\n df = pyspark.pandas.frame.DataFrame(df)\nelif koalas_available and pandas_available and isinstance(df, pandas.core.frame.DataFrame):\n df = databricks.koalas.frame.DataFrame(df)\n\n# convert to pyspark.sql.dataframe.DataFrame\nif isinstance(df, pyspark.sql.dataframe.DataFrame):\n pass # since it is already a Spark DataFrame\nelif pyspark_pandas_api_available and isinstance(df, pyspark.pandas.frame.DataFrame):\n df = df.to_spark()\nelif koalas_available and isinstance(df, databricks.koalas.frame.DataFrame):\n df = df.to_spark()\nelif pandas_available and isinstance(df, pandas.core.frame.DataFrame):\n df = spark.createDataFrame(df)\nelse:\n msg = f\"{type(df)} is not a supported type for dbt Python materialization\"\n raise Exception(msg)\n\ndf.write \\\n .mode(\"overwrite\") \\\n .format(\"bigquery\") \\\n .option(\"writeMethod\", \"direct\").option(\"writeDisposition\", 'WRITE_TRUNCATE') \\\n .save(\"{{target_relation}}\")\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.080779, "supported_languages": null}, "macro.dbt_bigquery.materialization_copy_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_copy_bigquery", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/copy.sql", "original_file_path": "macros/materializations/copy.sql", "name": "materialization_copy_bigquery", "macro_sql": "{% materialization copy, adapter='bigquery' -%}\n\n {# Setup #}\n {{ run_hooks(pre_hooks) }}\n\n {% set destination = this.incorporate(type='table') %}\n\n {# there can be several ref() or source() according to BQ copy API docs #}\n {# cycle over ref() and source() to create source tables array #}\n {% set source_array = [] %}\n {% for ref_table in model.refs %}\n {{ source_array.append(ref(*ref_table)) }}\n {% endfor %}\n\n {% for src_table in model.sources %}\n {{ source_array.append(source(*src_table)) }}\n {% endfor %}\n\n {# Call adapter copy_table function #}\n {%- set result_str = adapter.copy_table(\n source_array,\n destination,\n config.get('copy_materialization', default = 'table')) -%}\n\n {{ store_result('main', response=result_str) }}\n\n {# Clean up #}\n {{ run_hooks(post_hooks) }}\n {%- do apply_grants(target_relation, grant_config) -%}\n {{ adapter.commit() }}\n\n {{ return({'relations': [destination]}) }}\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.084664, "supported_languages": ["sql"]}, "macro.dbt_bigquery.declare_dbt_max_partition": {"unique_id": "macro.dbt_bigquery.declare_dbt_max_partition", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "declare_dbt_max_partition", "macro_sql": "{% macro declare_dbt_max_partition(relation, partition_by, complied_code, language='sql') %}\n\n {#-- TODO: revisit partitioning with python models --#}\n {%- if '_dbt_max_partition' in complied_code and language == 'sql' -%}\n\n declare _dbt_max_partition {{ partition_by.data_type }} default (\n select max({{ partition_by.field }}) from {{ this }}\n where {{ partition_by.field }} is not null\n );\n\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.090793, "supported_languages": null}, "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": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "dbt_bigquery_validate_get_incremental_strategy", "macro_sql": "{% macro dbt_bigquery_validate_get_incremental_strategy(config) %}\n {#-- Find and validate the incremental strategy #}\n {%- set strategy = config.get(\"incremental_strategy\") or '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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.092235, "supported_languages": null}, "macro.dbt_bigquery.bq_insert_overwrite": {"unique_id": "macro.dbt_bigquery.bq_insert_overwrite", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "bq_insert_overwrite", "macro_sql": "{% macro bq_insert_overwrite(\n tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n) %}\n\n {% if partitions is not none and partitions != [] %} {# static #}\n\n {% set predicate -%}\n {{ partition_by.render(alias='DBT_INTERNAL_DEST') }} in (\n {{ partitions | join (', ') }}\n )\n {%- endset %}\n\n {%- set source_sql -%}\n (\n {{sql}}\n )\n {%- endset -%}\n\n {#-- Because we're putting the model SQL _directly_ into the MERGE statement,\n we need to prepend the MERGE statement with the user-configured sql_header,\n which may be needed to resolve that model SQL (e.g. referencing a variable or UDF in the header)\n in the \"dynamic\" case, we save the model SQL result as a temp table first, wherein the\n sql_header is included by the create_table_as macro.\n #}\n {{ get_insert_overwrite_merge_sql(target_relation, source_sql, dest_columns, [predicate], include_sql_header=true) }}\n\n {% else %} {# dynamic #}\n\n {% set predicate -%}\n {{ partition_by.render(alias='DBT_INTERNAL_DEST') }} in unnest(dbt_partitions_for_replacement)\n {%- endset %}\n\n {%- set source_sql -%}\n (\n select * from {{ tmp_relation }}\n )\n {%- endset -%}\n\n -- generated script to merge partitions into {{ target_relation }}\n declare dbt_partitions_for_replacement array<{{ partition_by.data_type }}>;\n\n {# have we already created the temp table to check for schema changes? #}\n {% if not tmp_relation_exists %}\n {{ declare_dbt_max_partition(this, partition_by, sql) }}\n\n -- 1. create a temp table\n {{ create_table_as(True, tmp_relation, compiled_code) }}\n {% else %}\n -- 1. temp table already exists, we used it to check for schema changes\n {% endif %}\n\n -- 2. define partitions to update\n set (dbt_partitions_for_replacement) = (\n select as struct\n array_agg(distinct {{ partition_by.render() }})\n from {{ tmp_relation }}\n );\n\n -- 3. run the merge statement\n {{ get_insert_overwrite_merge_sql(target_relation, source_sql, dest_columns, [predicate]) }};\n\n -- 4. clean up the temp table\n drop table if exists {{ tmp_relation }}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql", "macro.dbt_bigquery.declare_dbt_max_partition", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.096151, "supported_languages": null}, "macro.dbt_bigquery.bq_generate_incremental_build_sql": {"unique_id": "macro.dbt_bigquery.bq_generate_incremental_build_sql", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "bq_generate_incremental_build_sql", "macro_sql": "{% macro bq_generate_incremental_build_sql(\n strategy, tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n) %}\n {#-- if partitioned, use BQ scripting to get the range of partition values to be updated --#}\n {% if strategy == 'insert_overwrite' %}\n\n {% set missing_partition_msg -%}\n The 'insert_overwrite' strategy requires the `partition_by` config.\n {%- endset %}\n {% if partition_by is none %}\n {% do exceptions.raise_compiler_error(missing_partition_msg) %}\n {% endif %}\n\n {% set build_sql = bq_insert_overwrite(\n tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n ) %}\n\n {% else %} {# strategy == 'merge' #}\n {%- set source_sql -%}\n {%- if tmp_relation_exists -%}\n (\n select * from {{ tmp_relation }}\n )\n {%- else -%} {#-- wrap sql in parens to make it a subquery --#}\n (\n {{sql}}\n )\n {%- endif -%}\n {%- endset -%}\n\n {% set build_sql = get_merge_sql(target_relation, source_sql, unique_key, dest_columns) %}\n\n {% endif %}\n\n {{ return(build_sql) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bq_insert_overwrite", "macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.098884, "supported_languages": null}, "macro.dbt_bigquery.materialization_incremental_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_incremental_bigquery", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "materialization_incremental_bigquery", "macro_sql": "{% materialization incremental, adapter='bigquery', supported_languages=['sql', 'python'] -%}\n\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n {%- set language = model['language'] %}\n\n {%- set target_relation = this %}\n {%- set existing_relation = load_relation(this) %}\n {%- set tmp_relation = make_temp_relation(this) %}\n\n {#-- Validate early so we don't run SQL if the strategy is invalid --#}\n {% set strategy = dbt_bigquery_validate_get_incremental_strategy(config) -%}\n\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set partition_by = adapter.parse_partition_by(raw_partition_by) -%}\n {%- set partitions = config.get('partitions', none) -%}\n {%- set cluster_by = config.get('cluster_by', none) -%}\n\n {% set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') %}\n\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n {% if existing_relation is none %}\n {%- call statement('main', language=language) -%}\n {{ create_table_as(False, target_relation, compiled_code, language) }}\n {%- endcall -%}\n\n {% elif existing_relation.is_view %}\n {#-- There's no way to atomically replace a view with a table on BQ --#}\n {{ adapter.drop_relation(existing_relation) }}\n {%- call statement('main', language=language) -%}\n {{ create_table_as(False, target_relation, compiled_code, language) }}\n {%- endcall -%}\n\n {% elif full_refresh_mode %}\n {#-- If the partition/cluster config has changed, then we must drop and recreate --#}\n {% if not adapter.is_replaceable(existing_relation, partition_by, cluster_by) %}\n {% do log(\"Hard refreshing \" ~ existing_relation ~ \" because it is not replaceable\") %}\n {{ adapter.drop_relation(existing_relation) }}\n {% endif %}\n {%- call statement('main', language=language) -%}\n {{ create_table_as(False, target_relation, compiled_code, language) }}\n {%- endcall -%}\n\n {% else %}\n {%- if language == 'python' and strategy == 'insert_overwrite' -%}\n {#-- This lets us move forward assuming no python will be directly templated into a query --#}\n {%- set python_unsupported_msg -%}\n The 'insert_overwrite' strategy is not yet supported for python models.\n {%- endset %}\n {% do exceptions.raise_compiler_error(python_unsupported_msg) %}\n {%- endif -%}\n\n {% set tmp_relation_exists = false %}\n {% if on_schema_change != 'ignore' or language == 'python' %}\n {#-- Check first, since otherwise we may not build a temp table --#}\n {#-- Python always needs to create a temp table --#}\n {%- call statement('create_tmp_relation', language=language) -%}\n {{ declare_dbt_max_partition(this, partition_by, compiled_code, language) +\n create_table_as(True, tmp_relation, compiled_code, language)\n }}\n {%- endcall -%}\n {% set tmp_relation_exists = true %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, tmp_relation, existing_relation) %}\n {% endif %}\n\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n {% set build_sql = bq_generate_incremental_build_sql(\n strategy, tmp_relation, target_relation, compiled_code, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n ) %}\n\n {%- call statement('main') -%}\n {{ build_sql }}\n {% endcall %}\n\n {%- if language == 'python' and tmp_relation -%}\n {{ adapter.drop_relation(tmp_relation) }}\n {%- endif -%}\n\n {% endif %}\n\n {{ run_hooks(post_hooks) }}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.load_relation", "macro.dbt.make_temp_relation", "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt_bigquery.declare_dbt_max_partition", "macro.dbt.process_schema_changes", "macro.dbt_bigquery.bq_generate_incremental_build_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.109974, "supported_languages": ["sql", "python"]}, "macro.dbt_bigquery.bigquery__snapshot_hash_arguments": {"unique_id": "macro.dbt_bigquery.bigquery__snapshot_hash_arguments", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__snapshot_hash_arguments", "macro_sql": "{% macro bigquery__snapshot_hash_arguments(args) -%}\n to_hex(md5(concat({%- for arg in args -%}\n coalesce(cast({{ arg }} as string), ''){% if not loop.last %}, '|',{% endif -%}\n {%- endfor -%}\n )))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.111441, "supported_languages": null}, "macro.dbt_bigquery.bigquery__create_columns": {"unique_id": "macro.dbt_bigquery.bigquery__create_columns", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__create_columns", "macro_sql": "{% macro bigquery__create_columns(relation, columns) %}\n {{ adapter.alter_table_add_columns(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.111964, "supported_languages": null}, "macro.dbt_bigquery.bigquery__post_snapshot": {"unique_id": "macro.dbt_bigquery.bigquery__post_snapshot", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__post_snapshot", "macro_sql": "{% macro bigquery__post_snapshot(staging_relation) %}\n -- Clean up the snapshot temp table\n {% do drop_relation(staging_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.112418, "supported_languages": null}, "macro.dbt_bigquery.bigquery__except": {"unique_id": "macro.dbt_bigquery.bigquery__except", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "name": "bigquery__except", "macro_sql": "{% macro bigquery__except() %}\n\n except distinct\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.113031, "supported_languages": null}, "macro.dbt_bigquery.bigquery__dateadd": {"unique_id": "macro.dbt_bigquery.bigquery__dateadd", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "name": "bigquery__dateadd", "macro_sql": "{% macro bigquery__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n datetime_add(\n cast( {{ from_date_or_timestamp }} as datetime),\n interval {{ interval }} {{ datepart }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.113991, "supported_languages": null}, "macro.dbt_bigquery.bigquery__current_timestamp": {"unique_id": "macro.dbt_bigquery.bigquery__current_timestamp", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/timestamps.sql", "original_file_path": "macros/utils/timestamps.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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.114763, "supported_languages": null}, "macro.dbt_bigquery.bigquery__snapshot_string_as_time": {"unique_id": "macro.dbt_bigquery.bigquery__snapshot_string_as_time", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/timestamps.sql", "original_file_path": "macros/utils/timestamps.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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.1153631, "supported_languages": null}, "macro.dbt_bigquery.bigquery__current_timestamp_backcompat": {"unique_id": "macro.dbt_bigquery.bigquery__current_timestamp_backcompat", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/timestamps.sql", "original_file_path": "macros/utils/timestamps.sql", "name": "bigquery__current_timestamp_backcompat", "macro_sql": "{% macro bigquery__current_timestamp_backcompat() -%}\n current_timestamp\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.115637, "supported_languages": null}, "macro.dbt_bigquery.bigquery__intersect": {"unique_id": "macro.dbt_bigquery.bigquery__intersect", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "name": "bigquery__intersect", "macro_sql": "{% macro bigquery__intersect() %}\n\n intersect distinct\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.116256, "supported_languages": null}, "macro.dbt_bigquery.bigquery__escape_single_quotes": {"unique_id": "macro.dbt_bigquery.bigquery__escape_single_quotes", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "name": "bigquery__escape_single_quotes", "macro_sql": "{% macro bigquery__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\", \"\\\\'\") }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.117132, "supported_languages": null}, "macro.dbt_bigquery.bigquery__right": {"unique_id": "macro.dbt_bigquery.bigquery__right", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "name": "bigquery__right", "macro_sql": "{% macro bigquery__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0\n then ''\n else\n substr(\n {{ string_text }},\n -1 * ({{ length_expression }})\n )\n end\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.118114, "supported_languages": null}, "macro.dbt_bigquery.bigquery__listagg": {"unique_id": "macro.dbt_bigquery.bigquery__listagg", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "name": "bigquery__listagg", "macro_sql": "{% macro bigquery__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n string_agg(\n {{ measure }},\n {{ delimiter_text }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n {% if limit_num -%}\n limit {{ limit_num }}\n {%- endif %}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.119581, "supported_languages": null}, "macro.dbt_bigquery.bigquery__datediff": {"unique_id": "macro.dbt_bigquery.bigquery__datediff", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "name": "bigquery__datediff", "macro_sql": "{% macro bigquery__datediff(first_date, second_date, datepart) -%}\n\n {% if dbt_version[0] == 1 and dbt_version[2] >= 2 %}\n {{ return(dbt.datediff(first_date, second_date, datepart)) }}\n {% else %}\n\n datetime_diff(\n cast({{second_date}} as datetime),\n cast({{first_date}} as datetime),\n {{datepart}}\n )\n\n {% endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.121366, "supported_languages": null}, "macro.dbt_bigquery.bigquery__safe_cast": {"unique_id": "macro.dbt_bigquery.bigquery__safe_cast", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "name": "bigquery__safe_cast", "macro_sql": "{% macro bigquery__safe_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.122184, "supported_languages": null}, "macro.dbt_bigquery.bigquery__hash": {"unique_id": "macro.dbt_bigquery.bigquery__hash", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "name": "bigquery__hash", "macro_sql": "{% macro bigquery__hash(field) -%}\n to_hex({{dbt.default__hash(field)}})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.122995, "supported_languages": null}, "macro.dbt_bigquery.bigquery__position": {"unique_id": "macro.dbt_bigquery.bigquery__position", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "name": "bigquery__position", "macro_sql": "{% macro bigquery__position(substring_text, string_text) %}\n\n strpos(\n {{ string_text }},\n {{ substring_text }}\n\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.1238568, "supported_languages": null}, "macro.dbt_bigquery.bigquery__array_concat": {"unique_id": "macro.dbt_bigquery.bigquery__array_concat", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "name": "bigquery__array_concat", "macro_sql": "{% macro bigquery__array_concat(array_1, array_2) -%}\n array_concat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.1246898, "supported_languages": null}, "macro.dbt_bigquery.bigquery__bool_or": {"unique_id": "macro.dbt_bigquery.bigquery__bool_or", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "name": "bigquery__bool_or", "macro_sql": "{% macro bigquery__bool_or(expression) -%}\n\n logical_or({{ expression }})\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.1254349, "supported_languages": null}, "macro.dbt_bigquery.bigquery__split_part": {"unique_id": "macro.dbt_bigquery.bigquery__split_part", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "name": "bigquery__split_part", "macro_sql": "{% macro bigquery__split_part(string_text, delimiter_text, part_number) %}\n\n {% if part_number >= 0 %}\n split(\n {{ string_text }},\n {{ delimiter_text }}\n )[safe_offset({{ part_number - 1 }})]\n {% else %}\n split(\n {{ string_text }},\n {{ delimiter_text }}\n )[safe_offset(\n length({{ string_text }})\n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 1\n )]\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.127519, "supported_languages": null}, "macro.dbt_bigquery.bigquery__date_trunc": {"unique_id": "macro.dbt_bigquery.bigquery__date_trunc", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "name": "bigquery__date_trunc", "macro_sql": "{% macro bigquery__date_trunc(datepart, date) -%}\n timestamp_trunc(\n cast({{date}} as timestamp),\n {{datepart}}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.128372, "supported_languages": null}, "macro.dbt_bigquery.bigquery__array_construct": {"unique_id": "macro.dbt_bigquery.bigquery__array_construct", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "name": "bigquery__array_construct", "macro_sql": "{% macro bigquery__array_construct(inputs, data_type) -%}\n {% if inputs|length > 0 %}\n [ {{ inputs|join(' , ') }} ]\n {% else %}\n ARRAY<{{data_type}}>[]\n {% endif %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.129604, "supported_languages": null}, "macro.dbt_bigquery.bigquery__array_append": {"unique_id": "macro.dbt_bigquery.bigquery__array_append", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "name": "bigquery__array_append", "macro_sql": "{% macro bigquery__array_append(array, new_element) -%}\n {{ array_concat(array, array_construct([new_element])) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.array_concat", "macro.dbt.array_construct"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.130538, "supported_languages": null}, "macro.dbt_bigquery.bigquery__get_show_grant_sql": {"unique_id": "macro.dbt_bigquery.bigquery__get_show_grant_sql", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "bigquery__get_show_grant_sql", "macro_sql": "{% macro bigquery__get_show_grant_sql(relation) %}\n {% set location = adapter.get_dataset_location(relation) %}\n {% set relation = relation.incorporate(location=location) %}\n\n select privilege_type, grantee\n from {{ relation.information_schema(\"OBJECT_PRIVILEGES\") }}\n where object_schema = \"{{ relation.dataset }}\"\n and object_name = \"{{ relation.identifier }}\"\n -- filter out current user\n and split(grantee, ':')[offset(1)] != session_user()\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.1326349, "supported_languages": null}, "macro.dbt_bigquery.bigquery__get_grant_sql": {"unique_id": "macro.dbt_bigquery.bigquery__get_grant_sql", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "bigquery__get_grant_sql", "macro_sql": "\n\n\n{%- macro bigquery__get_grant_sql(relation, privilege, grantee) -%}\n grant `{{ privilege }}` on {{ relation.type }} {{ relation }} to {{ '\\\"' + grantee|join('\\\", \\\"') + '\\\"' }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.133445, "supported_languages": null}, "macro.dbt_bigquery.bigquery__get_revoke_sql": {"unique_id": "macro.dbt_bigquery.bigquery__get_revoke_sql", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "bigquery__get_revoke_sql", "macro_sql": "{%- macro bigquery__get_revoke_sql(relation, privilege, grantee) -%}\n revoke `{{ privilege }}` on {{ relation.type }} {{ relation }} from {{ '\\\"' + grantee|join('\\\", \\\"') + '\\\"' }}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.134235, "supported_languages": null}, "macro.dbt.run_hooks": {"unique_id": "macro.dbt.run_hooks", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.1376069, "supported_languages": null}, "macro.dbt.make_hook_config": {"unique_id": "macro.dbt.make_hook_config", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.138248, "supported_languages": null}, "macro.dbt.before_begin": {"unique_id": "macro.dbt.before_begin", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.1387389, "supported_languages": null}, "macro.dbt.in_transaction": {"unique_id": "macro.dbt.in_transaction", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.13923, "supported_languages": null}, "macro.dbt.after_commit": {"unique_id": "macro.dbt.after_commit", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.139714, "supported_languages": null}, "macro.dbt.set_sql_header": {"unique_id": "macro.dbt.set_sql_header", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.1410298, "supported_languages": null}, "macro.dbt.should_full_refresh": {"unique_id": "macro.dbt.should_full_refresh", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.142035, "supported_languages": null}, "macro.dbt.should_store_failures": {"unique_id": "macro.dbt.should_store_failures", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.143051, "supported_languages": null}, "macro.dbt.snapshot_merge_sql": {"unique_id": "macro.dbt.snapshot_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "name": "snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.144536, "supported_languages": null}, "macro.dbt.default__snapshot_merge_sql": {"unique_id": "macro.dbt.default__snapshot_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "name": "default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.dbt_scd_id = DBT_INTERNAL_DEST.dbt_scd_id\n\n when matched\n and DBT_INTERNAL_DEST.dbt_valid_to is null\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.145429, "supported_languages": null}, "macro.dbt.strategy_dispatch": {"unique_id": "macro.dbt.strategy_dispatch", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "strategy_dispatch", "macro_sql": "{% macro strategy_dispatch(name) -%}\n{% set original_name = name %}\n {% if '.' in name %}\n {% set package_name, name = name.split(\".\", 1) %}\n {% else %}\n {% set package_name = none %}\n {% endif %}\n\n {% if package_name is none %}\n {% set package_context = context %}\n {% elif package_name in context %}\n {% set package_context = context[package_name] %}\n {% else %}\n {% set error_msg %}\n Could not find package '{{package_name}}', called with '{{original_name}}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n\n {%- set search_name = 'snapshot_' ~ name ~ '_strategy' -%}\n\n {% if search_name not in package_context %}\n {% set error_msg %}\n The specified strategy macro '{{name}}' was not found in package '{{ package_name }}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n {{ return(package_context[search_name]) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.154826, "supported_languages": null}, "macro.dbt.snapshot_hash_arguments": {"unique_id": "macro.dbt.snapshot_hash_arguments", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments', 'dbt')(args) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.155394, "supported_languages": null}, "macro.dbt.default__snapshot_hash_arguments": {"unique_id": "macro.dbt.default__snapshot_hash_arguments", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "default__snapshot_hash_arguments", "macro_sql": "{% macro default__snapshot_hash_arguments(args) -%}\n md5({%- for arg in args -%}\n coalesce(cast({{ arg }} as varchar ), '')\n {% if not loop.last %} || '|' || {% endif %}\n {%- endfor -%})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.1561441, "supported_languages": null}, "macro.dbt.snapshot_timestamp_strategy": {"unique_id": "macro.dbt.snapshot_timestamp_strategy", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_timestamp_strategy", "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set primary_key = config['unique_key'] %}\n {% set updated_at = config['updated_at'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/dbt-labs/dbt-core/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.dbt_valid_from < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.158421, "supported_languages": null}, "macro.dbt.snapshot_string_as_time": {"unique_id": "macro.dbt.snapshot_string_as_time", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time', 'dbt')(timestamp) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.158977, "supported_languages": null}, "macro.dbt.default__snapshot_string_as_time": {"unique_id": "macro.dbt.default__snapshot_string_as_time", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "default__snapshot_string_as_time", "macro_sql": "{% macro default__snapshot_string_as_time(timestamp) %}\n {% do exceptions.raise_not_implemented(\n 'snapshot_string_as_time macro not implemented for adapter '+adapter.type()\n ) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.159549, "supported_languages": null}, "macro.dbt.snapshot_check_all_get_existing_columns": {"unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) -%}\n {%- if not target_exists -%}\n {#-- no table yet -> return whatever the query does --#}\n {{ return((false, query_columns)) }}\n {%- endif -%}\n\n {#-- handle any schema changes --#}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=node.alias) -%}\n\n {% if check_cols_config == 'all' %}\n {%- set query_columns = get_columns_in_query(node['compiled_code']) -%}\n\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {#-- query for proper casing/quoting, to support comparison below --#}\n {%- set select_check_cols_from_target -%}\n select {{ check_cols_config | join(', ') }} from ({{ node['compiled_code'] }}) subq\n {%- endset -%}\n {% set query_columns = get_columns_in_query(select_check_cols_from_target) %}\n\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set existing_cols = adapter.get_columns_in_relation(target_relation) | map(attribute = 'name') | list -%}\n {%- set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(adapter.quote(col)) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return((ns.column_added, intersection)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.163959, "supported_languages": null}, "macro.dbt.snapshot_check_strategy": {"unique_id": "macro.dbt.snapshot_check_strategy", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set check_cols_config = config['check_cols'] %}\n {% set primary_key = config['unique_key'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n {% set updated_at = config.get('updated_at', snapshot_get_time()) %}\n\n {% set column_added = false %}\n\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n {{ get_true_sql() }}\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.get_true_sql", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.168245, "supported_languages": null}, "macro.dbt.create_columns": {"unique_id": "macro.dbt.create_columns", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns', 'dbt')(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.1776361, "supported_languages": null}, "macro.dbt.default__create_columns": {"unique_id": "macro.dbt.default__create_columns", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation }} add column \"{{ column.name }}\" {{ column.data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.178567, "supported_languages": null}, "macro.dbt.post_snapshot": {"unique_id": "macro.dbt.post_snapshot", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.17913, "supported_languages": null}, "macro.dbt.default__post_snapshot": {"unique_id": "macro.dbt.default__post_snapshot", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.179445, "supported_languages": null}, "macro.dbt.get_true_sql": {"unique_id": "macro.dbt.get_true_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "get_true_sql", "macro_sql": "{% macro get_true_sql() %}\n {{ adapter.dispatch('get_true_sql', 'dbt')() }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_true_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.179939, "supported_languages": null}, "macro.dbt.default__get_true_sql": {"unique_id": "macro.dbt.default__get_true_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__get_true_sql", "macro_sql": "{% macro default__get_true_sql() %}\n {{ return('TRUE') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.180347, "supported_languages": null}, "macro.dbt.snapshot_staging_table": {"unique_id": "macro.dbt.snapshot_staging_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "snapshot_staging_table", "macro_sql": "{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {{ adapter.dispatch('snapshot_staging_table', 'dbt')(strategy, source_sql, target_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_staging_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.1810272, "supported_languages": null}, "macro.dbt.default__snapshot_staging_table": {"unique_id": "macro.dbt.default__snapshot_staging_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__snapshot_staging_table", "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *,\n {{ strategy.unique_key }} as dbt_unique_key\n\n from {{ target_relation }}\n where dbt_valid_to is null\n\n ),\n\n insertions_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to,\n {{ strategy.scd_id }} as dbt_scd_id\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n {{ strategy.updated_at }} as dbt_valid_to\n\n from snapshot_query\n ),\n\n {%- if strategy.invalidate_hard_deletes %}\n\n deletes_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from insertions_source_data as source_data\n left outer join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_unique_key is null\n or (\n snapshotted_data.dbt_unique_key is not null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.dbt_scd_id\n\n from updates_source_data as source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where (\n {{ strategy.row_changed }}\n )\n )\n\n {%- if strategy.invalidate_hard_deletes -%}\n ,\n\n deletes as (\n\n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as dbt_valid_from,\n {{ snapshot_get_time() }} as dbt_updated_at,\n {{ snapshot_get_time() }} as dbt_valid_to,\n snapshotted_data.dbt_scd_id\n\n from snapshotted_data\n left join deletes_source_data as source_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where source_data.dbt_unique_key is null\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.invalidate_hard_deletes %}\n union all\n select * from deletes\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.1838, "supported_languages": null}, "macro.dbt.build_snapshot_table": {"unique_id": "macro.dbt.build_snapshot_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) -%}\n {{ adapter.dispatch('build_snapshot_table', 'dbt')(strategy, sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__build_snapshot_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.1844301, "supported_languages": null}, "macro.dbt.default__build_snapshot_table": {"unique_id": "macro.dbt.default__build_snapshot_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__build_snapshot_table", "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.1852689, "supported_languages": null}, "macro.dbt.build_snapshot_staging_table": {"unique_id": "macro.dbt.build_snapshot_staging_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set temp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, temp_relation, select) }}\n {% endcall %}\n\n {% do return(temp_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.18665, "supported_languages": null}, "macro.dbt.materialization_snapshot_default": {"unique_id": "macro.dbt.materialization_snapshot_default", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot.sql", "original_file_path": "macros/materializations/snapshots/snapshot.sql", "name": "materialization_snapshot_default", "macro_sql": "{% materialization snapshot, default %}\n {%- set config = model['config'] -%}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\n\n {% set target_relation_exists, target_relation = get_or_create_relation(\n database=model.database,\n schema=model.schema,\n identifier=target_table,\n type='table') -%}\n\n {%- if not target_relation.is_table -%}\n {% do exceptions.relation_wrong_type(target_relation, 'table') %}\n {%- endif -%}\n\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set strategy_macro = strategy_dispatch(strategy_name) %}\n {% set strategy = strategy_macro(model, \"snapshotted_data\", \"source_data\", config, target_relation_exists) %}\n\n {% if not target_relation_exists %}\n\n {% set build_sql = build_snapshot_table(strategy, model['compiled_code']) %}\n {% set final_sql = create_table_as(False, target_relation, build_sql) %}\n\n {% else %}\n\n {{ adapter.valid_snapshot_target(target_relation) }}\n\n {% set staging_table = build_snapshot_staging_table(strategy, sql, target_relation) %}\n\n -- this may no-op if the database does not require column expansion\n {% do adapter.expand_target_column_types(from_relation=staging_table,\n to_relation=target_relation) %}\n\n {% set missing_columns = adapter.get_missing_columns(staging_table, target_relation)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% do create_columns(target_relation, missing_columns) %}\n\n {% set source_columns = adapter.get_columns_in_relation(staging_table)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% set quoted_source_columns = [] %}\n {% for column in source_columns %}\n {% do quoted_source_columns.append(adapter.quote(column.name)) %}\n {% endfor %}\n\n {% set final_sql = snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n %}\n\n {% endif %}\n\n {% call statement('main') %}\n {{ final_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(target_relation_exists, full_refresh_mode=False) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if not target_relation_exists %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if staging_table is defined %}\n {% do post_snapshot(staging_table) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_or_create_relation", "macro.dbt.run_hooks", "macro.dbt.strategy_dispatch", "macro.dbt.build_snapshot_table", "macro.dbt.create_table_as", "macro.dbt.build_snapshot_staging_table", "macro.dbt.create_columns", "macro.dbt.snapshot_merge_sql", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes", "macro.dbt.post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.203635, "supported_languages": ["sql"]}, "macro.dbt.materialization_test_default": {"unique_id": "macro.dbt.materialization_test_default", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/test.sql", "original_file_path": "macros/materializations/tests/test.sql", "name": "materialization_test_default", "macro_sql": "{%- materialization test, default -%}\n\n {% set relations = [] %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type='table') -%} %}\n\n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n\n {% call statement(auto_begin=True) %}\n {{ create_table_as(False, target_relation, sql) }}\n {% endcall %}\n\n {% do relations.append(target_relation) %}\n\n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n\n {{ adapter.commit() }}\n\n {% else %}\n\n {% set main_sql = sql %}\n\n {% endif %}\n\n {% set limit = config.get('limit') %}\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit)}}\n\n {%- endcall %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.20992, "supported_languages": ["sql"]}, "macro.dbt.get_test_sql": {"unique_id": "macro.dbt.get_test_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "name": "get_test_sql", "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql', 'dbt')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.2114549, "supported_languages": null}, "macro.dbt.default__get_test_sql": {"unique_id": "macro.dbt.default__get_test_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "name": "default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.212451, "supported_languages": null}, "macro.dbt.get_where_subquery": {"unique_id": "macro.dbt.get_where_subquery", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "name": "get_where_subquery", "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_where_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.21379, "supported_languages": null}, "macro.dbt.default__get_where_subquery": {"unique_id": "macro.dbt.default__get_where_subquery", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "name": "default__get_where_subquery", "macro_sql": "{% macro default__get_where_subquery(relation) -%}\n {% set where = config.get('where', '') %}\n {% if where %}\n {%- set filtered -%}\n (select * from {{ relation }} where {{ where }}) dbt_subquery\n {%- endset -%}\n {% do return(filtered) %}\n {%- else -%}\n {% do return(relation) %}\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.215034, "supported_languages": null}, "macro.dbt.get_quoted_csv": {"unique_id": "macro.dbt.get_quoted_csv", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\n\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.219352, "supported_languages": null}, "macro.dbt.diff_columns": {"unique_id": "macro.dbt.diff_columns", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "diff_columns", "macro_sql": "{% macro diff_columns(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% set source_names = source_columns | map(attribute = 'column') | list %}\n {% set target_names = target_columns | map(attribute = 'column') | list %}\n\n {# --check whether the name attribute exists in the target - this does not perform a data type check #}\n {% for sc in source_columns %}\n {% if sc.name not in target_names %}\n {{ result.append(sc) }}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.2211351, "supported_languages": null}, "macro.dbt.diff_column_data_types": {"unique_id": "macro.dbt.diff_column_data_types", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "diff_column_data_types", "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.data_type != tc.data_type and not sc.can_expand_to(other_column=tc) %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.data_type } ) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.223254, "supported_languages": null}, "macro.dbt.get_merge_update_columns": {"unique_id": "macro.dbt.get_merge_update_columns", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "get_merge_update_columns", "macro_sql": "{% macro get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {{ return(adapter.dispatch('get_merge_update_columns', 'dbt')(merge_update_columns, merge_exclude_columns, dest_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.224027, "supported_languages": null}, "macro.dbt.default__get_merge_update_columns": {"unique_id": "macro.dbt.default__get_merge_update_columns", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "default__get_merge_update_columns", "macro_sql": "{% macro default__get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {%- set default_cols = dest_columns | map(attribute=\"quoted\") | list -%}\n\n {%- if merge_update_columns and merge_exclude_columns -%}\n {{ exceptions.raise_compiler_error(\n 'Model cannot specify merge_update_columns and merge_exclude_columns. Please update model to use only one config'\n )}}\n {%- elif merge_update_columns -%}\n {%- set update_columns = merge_update_columns -%}\n {%- elif merge_exclude_columns -%}\n {%- set update_columns = [] -%}\n {%- for column in dest_columns -%}\n {% if column.column | lower not in merge_exclude_columns | map(\"lower\") | list %}\n {%- do update_columns.append(column.quoted) -%}\n {% endif %}\n {%- endfor -%}\n {%- else -%}\n {%- set update_columns = default_cols -%}\n {%- endif -%}\n\n {{ return(update_columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.2263439, "supported_languages": null}, "macro.dbt.get_merge_sql": {"unique_id": "macro.dbt.get_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, predicates=none) -%}\n {{ adapter.dispatch('get_merge_sql', 'dbt')(target, source, unique_key, dest_columns, predicates) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.2369258, "supported_languages": null}, "macro.dbt.default__get_merge_sql": {"unique_id": "macro.dbt.default__get_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, predicates) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set merge_update_columns = config.get('merge_update_columns') -%}\n {%- set merge_exclude_columns = config.get('merge_exclude_columns') -%}\n {%- set update_columns = get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not mapping and unique_key is not string %}\n {% for key in unique_key %}\n {% set this_key_match %}\n DBT_INTERNAL_SOURCE.{{ key }} = DBT_INTERNAL_DEST.{{ key }}\n {% endset %}\n {% do predicates.append(this_key_match) %}\n {% endfor %}\n {% else %}\n {% set unique_key_match %}\n DBT_INTERNAL_SOURCE.{{ unique_key }} = DBT_INTERNAL_DEST.{{ unique_key }}\n {% endset %}\n {% do predicates.append(unique_key_match) %}\n {% endif %}\n {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\n\n {{ sql_header if sql_header is not none }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on {{ predicates | join(' and ') }}\n\n {% if unique_key %}\n when matched then update set\n {% for column_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv", "macro.dbt.get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.242033, "supported_languages": null}, "macro.dbt.get_delete_insert_merge_sql": {"unique_id": "macro.dbt.get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql', 'dbt')(target, source, unique_key, dest_columns) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.242809, "supported_languages": null}, "macro.dbt.default__get_delete_insert_merge_sql": {"unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not string %}\n delete from {{target }}\n using {{ source }}\n where (\n {% for key in unique_key %}\n {{ source }}.{{ key }} = {{ target }}.{{ key }}\n {{ \"and \" if not loop.last }}\n {% endfor %}\n );\n {% else %}\n delete from {{ target }}\n where (\n {{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n );\n\n {% endif %}\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.245188, "supported_languages": null}, "macro.dbt.get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql', 'dbt')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.246043, "supported_languages": null}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {#-- The only time include_sql_header is True: --#}\n {#-- BigQuery + insert_overwrite strategy + \"static\" partitions config --#}\n {#-- We should consider including the sql header at the materialization level instead --#}\n\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.248106, "supported_languages": null}, "macro.dbt.is_incremental": {"unique_id": "macro.dbt.is_incremental", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/is_incremental.sql", "original_file_path": "macros/materializations/models/incremental/is_incremental.sql", "name": "is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.2502542, "supported_languages": null}, "macro.dbt.get_incremental_append_sql": {"unique_id": "macro.dbt.get_incremental_append_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_append_sql", "macro_sql": "{% macro get_incremental_append_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_append_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.252784, "supported_languages": null}, "macro.dbt.default__get_incremental_append_sql": {"unique_id": "macro.dbt.default__get_incremental_append_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_append_sql", "macro_sql": "{% macro default__get_incremental_append_sql(arg_dict) %}\n\n {% do return(get_insert_into_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_insert_into_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.25355, "supported_languages": null}, "macro.dbt.get_incremental_delete_insert_sql": {"unique_id": "macro.dbt.get_incremental_delete_insert_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_delete_insert_sql", "macro_sql": "{% macro get_incremental_delete_insert_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_delete_insert_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_delete_insert_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.254168, "supported_languages": null}, "macro.dbt.default__get_incremental_delete_insert_sql": {"unique_id": "macro.dbt.default__get_incremental_delete_insert_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_delete_insert_sql", "macro_sql": "{% macro default__get_incremental_delete_insert_sql(arg_dict) %}\n\n {% do return(get_delete_insert_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.2550411, "supported_languages": null}, "macro.dbt.get_incremental_merge_sql": {"unique_id": "macro.dbt.get_incremental_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_merge_sql", "macro_sql": "{% macro get_incremental_merge_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.255666, "supported_languages": null}, "macro.dbt.default__get_incremental_merge_sql": {"unique_id": "macro.dbt.default__get_incremental_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_merge_sql", "macro_sql": "{% macro default__get_incremental_merge_sql(arg_dict) %}\n\n {% do return(get_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.2565272, "supported_languages": null}, "macro.dbt.get_incremental_insert_overwrite_sql": {"unique_id": "macro.dbt.get_incremental_insert_overwrite_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_insert_overwrite_sql", "macro_sql": "{% macro get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_insert_overwrite_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_insert_overwrite_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.2571461, "supported_languages": null}, "macro.dbt.default__get_incremental_insert_overwrite_sql": {"unique_id": "macro.dbt.default__get_incremental_insert_overwrite_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_insert_overwrite_sql", "macro_sql": "{% macro default__get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {% do return(get_insert_overwrite_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"], arg_dict[\"predicates\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.2580101, "supported_languages": null}, "macro.dbt.get_incremental_default_sql": {"unique_id": "macro.dbt.get_incremental_default_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_default_sql", "macro_sql": "{% macro get_incremental_default_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_default_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_default_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.258629, "supported_languages": null}, "macro.dbt.default__get_incremental_default_sql": {"unique_id": "macro.dbt.default__get_incremental_default_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_default_sql", "macro_sql": "{% macro default__get_incremental_default_sql(arg_dict) %}\n\n {% do return(get_incremental_append_sql(arg_dict)) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.2591429, "supported_languages": null}, "macro.dbt.get_insert_into_sql": {"unique_id": "macro.dbt.get_insert_into_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_insert_into_sql", "macro_sql": "{% macro get_insert_into_sql(target_relation, temp_relation, dest_columns) %}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ temp_relation }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.260065, "supported_languages": null}, "macro.dbt.materialization_incremental_default": {"unique_id": "macro.dbt.materialization_incremental_default", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/incremental.sql", "original_file_path": "macros/materializations/models/incremental/incremental.sql", "name": "materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% if existing_relation is none %}\n {% set build_sql = get_create_table_as_sql(False, target_relation, sql) %}\n {% elif full_refresh_mode %}\n {% set build_sql = get_create_table_as_sql(False, intermediate_relation, sql) %}\n {% set need_swap = true %}\n {% else %}\n {% do run_query(get_create_table_as_sql(True, temp_relation, sql)) %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set incremental_predicates = config.get('incremental_predicates', none) %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.get_create_table_as_sql", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.274704, "supported_languages": ["sql"]}, "macro.dbt.incremental_validate_on_schema_change": {"unique_id": "macro.dbt.incremental_validate_on_schema_change", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "incremental_validate_on_schema_change", "macro_sql": "{% macro incremental_validate_on_schema_change(on_schema_change, default='ignore') %}\n\n {% if on_schema_change not in ['sync_all_columns', 'append_new_columns', 'fail', 'ignore'] %}\n\n {% set log_message = 'Invalid value for on_schema_change (%s) specified. Setting default value of %s.' % (on_schema_change, default) %}\n {% do log(log_message) %}\n\n {{ return(default) }}\n\n {% else %}\n\n {{ return(on_schema_change) }}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.287938, "supported_languages": null}, "macro.dbt.check_for_schema_changes": {"unique_id": "macro.dbt.check_for_schema_changes", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "check_for_schema_changes", "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n\n {% set schema_changed = False %}\n\n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n\n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n\n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.diff_columns", "macro.dbt.diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.291851, "supported_languages": null}, "macro.dbt.sync_column_schemas": {"unique_id": "macro.dbt.sync_column_schemas", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "sync_column_schemas", "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n\n {% elif on_schema_change == 'sync_all_columns' %}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n\n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n\n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n\n {% do log(schema_change_message) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.alter_relation_add_remove_columns", "macro.dbt.alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.295676, "supported_languages": null}, "macro.dbt.process_schema_changes": {"unique_id": "macro.dbt.process_schema_changes", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "process_schema_changes", "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n\n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n\n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n\n {% if schema_changes_dict['schema_changed'] %}\n\n {% if on_schema_change == 'fail' %}\n\n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways:\n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n\n Additional troubleshooting context:\n Source columns not in target: {{ schema_changes_dict['source_not_in_target'] }}\n Target columns not in source: {{ schema_changes_dict['target_not_in_source'] }}\n New column types: {{ schema_changes_dict['new_target_types'] }}\n {% endset %}\n\n {% do exceptions.raise_compiler_error(fail_msg) %}\n\n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n\n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {% endif %}\n\n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.298419, "supported_languages": null}, "macro.dbt.materialization_table_default": {"unique_id": "macro.dbt.materialization_table_default", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/table.sql", "original_file_path": "macros/materializations/models/table/table.sql", "name": "materialization_table_default", "macro_sql": "{% materialization table, default %}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do create_indexes(target_relation) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.get_create_table_as_sql", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.306106, "supported_languages": ["sql"]}, "macro.dbt.get_create_table_as_sql": {"unique_id": "macro.dbt.get_create_table_as_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "get_create_table_as_sql", "macro_sql": "{% macro get_create_table_as_sql(temporary, relation, sql) -%}\n {{ adapter.dispatch('get_create_table_as_sql', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_table_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.307809, "supported_languages": null}, "macro.dbt.default__get_create_table_as_sql": {"unique_id": "macro.dbt.default__get_create_table_as_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "default__get_create_table_as_sql", "macro_sql": "{% macro default__get_create_table_as_sql(temporary, relation, sql) -%}\n {{ return(create_table_as(temporary, relation, sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.308418, "supported_languages": null}, "macro.dbt.create_table_as": {"unique_id": "macro.dbt.create_table_as", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {# backward compatibility for create_table_as that does not support language #}\n {% if language == \"sql\" %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code)}}\n {% else %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code, language) }}\n {% endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.30982, "supported_languages": null}, "macro.dbt.default__create_table_as": {"unique_id": "macro.dbt.default__create_table_as", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.311156, "supported_languages": null}, "macro.dbt.materialization_view_default": {"unique_id": "macro.dbt.materialization_view_default", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/view.sql", "original_file_path": "macros/materializations/models/view/view.sql", "name": "materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='view') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n This relation (probably) doesn't exist yet. If it does exist, it's a leftover from\n a previous run, and we're going to try to drop it immediately. At the end of this\n materialization, we're going to rename the \"existing_relation\" to this identifier,\n and then we're going to drop it. In order to make sure we run the correct one of:\n - drop view ...\n - drop table ...\n\n We need to set the type of this relation to be the type of the existing_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the existing_relation does not\n exist, then there is nothing to move out of the way and subsequentally drop. In that case,\n this relation will be effectively unused.\n */\n {%- set backup_relation_type = 'view' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.318738, "supported_languages": ["sql"]}, "macro.dbt.handle_existing_table": {"unique_id": "macro.dbt.handle_existing_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/helpers.sql", "original_file_path": "macros/materializations/models/view/helpers.sql", "name": "handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.3199072, "supported_languages": null}, "macro.dbt.default__handle_existing_table": {"unique_id": "macro.dbt.default__handle_existing_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/helpers.sql", "original_file_path": "macros/materializations/models/view/helpers.sql", "name": "default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.320638, "supported_languages": null}, "macro.dbt.create_or_replace_view": {"unique_id": "macro.dbt.create_or_replace_view", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/models/view/create_or_replace_view.sql", "name": "create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {% set should_revoke = should_revoke(exists_as_view, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=True) %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.3253481, "supported_languages": null}, "macro.dbt.get_create_view_as_sql": {"unique_id": "macro.dbt.get_create_view_as_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "get_create_view_as_sql", "macro_sql": "{% macro get_create_view_as_sql(relation, sql) -%}\n {{ adapter.dispatch('get_create_view_as_sql', 'dbt')(relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.326668, "supported_languages": null}, "macro.dbt.default__get_create_view_as_sql": {"unique_id": "macro.dbt.default__get_create_view_as_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "default__get_create_view_as_sql", "macro_sql": "{% macro default__get_create_view_as_sql(relation, sql) -%}\n {{ return(create_view_as(relation, sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.327213, "supported_languages": null}, "macro.dbt.create_view_as": {"unique_id": "macro.dbt.create_view_as", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.327821, "supported_languages": null}, "macro.dbt.default__create_view_as": {"unique_id": "macro.dbt.default__create_view_as", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation }} as (\n {{ sql }}\n );\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.3286731, "supported_languages": null}, "macro.dbt.materialization_seed_default": {"unique_id": "macro.dbt.materialization_seed_default", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/seed.sql", "original_file_path": "macros/materializations/seeds/seed.sql", "name": "materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set grant_config = config.get('grants') -%}\n {%- set agate_table = load_agate_table() -%}\n -- grab current tables grants config for comparision later on\n\n {%- do store_result('agate_table', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation)) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', code ~ ' ' ~ rows_affected, code, rows_affected) %}\n {{ get_csv_sql(create_table_sql, sql) }};\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if full_refresh_mode or not exists_as_table %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.run_hooks", "macro.dbt.reset_csv_table", "macro.dbt.create_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.noop_statement", "macro.dbt.get_csv_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.338463, "supported_languages": ["sql"]}, "macro.dbt.create_csv_table": {"unique_id": "macro.dbt.create_csv_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.350079, "supported_languages": null}, "macro.dbt.default__create_csv_table": {"unique_id": "macro.dbt.default__create_csv_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.352968, "supported_languages": null}, "macro.dbt.reset_csv_table": {"unique_id": "macro.dbt.reset_csv_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table', 'dbt')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.353729, "supported_languages": null}, "macro.dbt.default__reset_csv_table": {"unique_id": "macro.dbt.default__reset_csv_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.355298, "supported_languages": null}, "macro.dbt.get_csv_sql": {"unique_id": "macro.dbt.get_csv_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_csv_sql", "macro_sql": "{% macro get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ adapter.dispatch('get_csv_sql', 'dbt')(create_or_truncate_sql, insert_sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_csv_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.3559391, "supported_languages": null}, "macro.dbt.default__get_csv_sql": {"unique_id": "macro.dbt.default__get_csv_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_csv_sql", "macro_sql": "{% macro default__get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ create_or_truncate_sql }};\n -- dbt seed --\n {{ insert_sql }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.3563972, "supported_languages": null}, "macro.dbt.get_binding_char": {"unique_id": "macro.dbt.get_binding_char", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_binding_char", "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.356871, "supported_languages": null}, "macro.dbt.default__get_binding_char": {"unique_id": "macro.dbt.default__get_binding_char", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_binding_char", "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.35727, "supported_languages": null}, "macro.dbt.get_batch_size": {"unique_id": "macro.dbt.get_batch_size", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_batch_size", "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_batch_size"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.357803, "supported_languages": null}, "macro.dbt.default__get_batch_size": {"unique_id": "macro.dbt.default__get_batch_size", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_batch_size", "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.358203, "supported_languages": null}, "macro.dbt.get_seed_column_quoted_csv": {"unique_id": "macro.dbt.get_seed_column_quoted_csv", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.3597472, "supported_languages": null}, "macro.dbt.load_csv_rows": {"unique_id": "macro.dbt.load_csv_rows", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.36036, "supported_languages": null}, "macro.dbt.default__load_csv_rows": {"unique_id": "macro.dbt.default__load_csv_rows", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n\n {% set batch_size = get_batch_size() %}\n\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.36444, "supported_languages": null}, "macro.dbt.generate_alias_name": {"unique_id": "macro.dbt.generate_alias_name", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "name": "generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_alias_name', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_alias_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.365839, "supported_languages": null}, "macro.dbt.default__generate_alias_name": {"unique_id": "macro.dbt.default__generate_alias_name", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "name": "default__generate_alias_name", "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name is none -%}\n\n {{ node.name }}\n\n {%- else -%}\n\n {{ custom_alias_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.366606, "supported_languages": null}, "macro.dbt.generate_schema_name": {"unique_id": "macro.dbt.generate_schema_name", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name=none, node=none) -%}\n {{ return(adapter.dispatch('generate_schema_name', 'dbt')(custom_schema_name, node)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.368313, "supported_languages": null}, "macro.dbt.default__generate_schema_name": {"unique_id": "macro.dbt.default__generate_schema_name", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.3691862, "supported_languages": null}, "macro.dbt.generate_schema_name_for_env": {"unique_id": "macro.dbt.generate_schema_name_for_env", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.370128, "supported_languages": null}, "macro.dbt.generate_database_name": {"unique_id": "macro.dbt.generate_database_name", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "name": "generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name', 'dbt')(custom_database_name, node)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.371542, "supported_languages": null}, "macro.dbt.default__generate_database_name": {"unique_id": "macro.dbt.default__generate_database_name", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "name": "default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.372382, "supported_languages": null}, "macro.dbt.default__test_relationships": {"unique_id": "macro.dbt.default__test_relationships", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/relationships.sql", "original_file_path": "macros/generic_test_sql/relationships.sql", "name": "default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.373656, "supported_languages": null}, "macro.dbt.default__test_not_null": {"unique_id": "macro.dbt.default__test_not_null", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/not_null.sql", "original_file_path": "macros/generic_test_sql/not_null.sql", "name": "default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else column_name %}\n\nselect {{ column_list }}\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.3748622, "supported_languages": null}, "macro.dbt.default__test_unique": {"unique_id": "macro.dbt.default__test_unique", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/unique.sql", "original_file_path": "macros/generic_test_sql/unique.sql", "name": "default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.375886, "supported_languages": null}, "macro.dbt.default__test_accepted_values": {"unique_id": "macro.dbt.default__test_accepted_values", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/accepted_values.sql", "original_file_path": "macros/generic_test_sql/accepted_values.sql", "name": "default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by {{ column_name }}\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.377843, "supported_languages": null}, "macro.dbt.statement": {"unique_id": "macro.dbt.statement", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "statement", "macro_sql": "\n{%- macro statement(name=None, fetch_result=False, auto_begin=True, language='sql') -%}\n {%- if execute: -%}\n {%- set compiled_code = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime {} for node \"{}\"'.format(language, model['unique_id'])) }}\n {{ write(compiled_code) }}\n {%- endif -%}\n {%- if language == 'sql'-%}\n {%- set res, table = adapter.execute(compiled_code, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- elif language == 'python' -%}\n {%- set res = submit_python_job(model, compiled_code) -%}\n {#-- TODO: What should table be for python models? --#}\n {%- set table = None -%}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"statement macro didn't get supported language\") %}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.3824131, "supported_languages": null}, "macro.dbt.noop_statement": {"unique_id": "macro.dbt.noop_statement", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.384428, "supported_languages": null}, "macro.dbt.run_query": {"unique_id": "macro.dbt.run_query", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.385372, "supported_languages": null}, "macro.dbt.convert_datetime": {"unique_id": "macro.dbt.convert_datetime", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "convert_datetime", "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.390149, "supported_languages": null}, "macro.dbt.dates_in_range": {"unique_id": "macro.dbt.dates_in_range", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "dates_in_range", "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n Partiton start date is after the end date ({{ start_date }}, {{ end_date }})\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg, model) }}\n {% endif %}\n\n {% set date_list = [] %}\n {% for i in range(0, day_count + 1) %}\n {% set the_date = (modules.datetime.timedelta(days=i) + start_date) %}\n {% if not out_fmt %}\n {% set _ = date_list.append(the_date) %}\n {% else %}\n {% set _ = date_list.append(the_date.strftime(out_fmt)) %}\n {% endif %}\n {% endfor %}\n\n {{ return(date_list) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.3939168, "supported_languages": null}, "macro.dbt.partition_range": {"unique_id": "macro.dbt.partition_range", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "partition_range", "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.396317, "supported_languages": null}, "macro.dbt.py_current_timestring": {"unique_id": "macro.dbt.py_current_timestring", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "py_current_timestring", "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.397082, "supported_languages": null}, "macro.dbt.except": {"unique_id": "macro.dbt.except", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "name": "except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.39807, "supported_languages": null}, "macro.dbt.default__except": {"unique_id": "macro.dbt.default__except", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "name": "default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.398342, "supported_languages": null}, "macro.dbt.replace": {"unique_id": "macro.dbt.replace", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "name": "replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt') (field, old_chars, new_chars)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.399589, "supported_languages": null}, "macro.dbt.default__replace": {"unique_id": "macro.dbt.default__replace", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "name": "default__replace", "macro_sql": "{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.400138, "supported_languages": null}, "macro.dbt.concat": {"unique_id": "macro.dbt.concat", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "name": "concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt')(fields)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.401171, "supported_languages": null}, "macro.dbt.default__concat": {"unique_id": "macro.dbt.default__concat", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "name": "default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n {{ fields|join(' || ') }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.401603, "supported_languages": null}, "macro.dbt.length": {"unique_id": "macro.dbt.length", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "name": "length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__length"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.402658, "supported_languages": null}, "macro.dbt.default__length": {"unique_id": "macro.dbt.default__length", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "name": "default__length", "macro_sql": "{% macro default__length(expression) %}\n\n length(\n {{ expression }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.403025, "supported_languages": null}, "macro.dbt.dateadd": {"unique_id": "macro.dbt.dateadd", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "name": "dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.404323, "supported_languages": null}, "macro.dbt.default__dateadd": {"unique_id": "macro.dbt.default__dateadd", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "name": "default__dateadd", "macro_sql": "{% macro default__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_date_or_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.404876, "supported_languages": null}, "macro.dbt.intersect": {"unique_id": "macro.dbt.intersect", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "name": "intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__intersect"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.405857, "supported_languages": null}, "macro.dbt.default__intersect": {"unique_id": "macro.dbt.default__intersect", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "name": "default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4061272, "supported_languages": null}, "macro.dbt.escape_single_quotes": {"unique_id": "macro.dbt.escape_single_quotes", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "name": "escape_single_quotes", "macro_sql": "{% macro escape_single_quotes(expression) %}\n {{ return(adapter.dispatch('escape_single_quotes', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__escape_single_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.407231, "supported_languages": null}, "macro.dbt.default__escape_single_quotes": {"unique_id": "macro.dbt.default__escape_single_quotes", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "name": "default__escape_single_quotes", "macro_sql": "{% macro default__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\",\"''\") }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.407718, "supported_languages": null}, "macro.dbt.right": {"unique_id": "macro.dbt.right", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "name": "right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt') (string_text, length_expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__right"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.408916, "supported_languages": null}, "macro.dbt.default__right": {"unique_id": "macro.dbt.default__right", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "name": "default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.409546, "supported_languages": null}, "macro.dbt.listagg": {"unique_id": "macro.dbt.listagg", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "name": "listagg", "macro_sql": "{% macro listagg(measure, delimiter_text=\"','\", order_by_clause=none, limit_num=none) -%}\n {{ return(adapter.dispatch('listagg', 'dbt') (measure, delimiter_text, order_by_clause, limit_num)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__listagg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.41152, "supported_languages": null}, "macro.dbt.default__listagg": {"unique_id": "macro.dbt.default__listagg", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "name": "default__listagg", "macro_sql": "{% macro default__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n array_slice(\n array_agg(\n {{ measure }}\n ){% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n ,0\n ,{{ limit_num }}\n ),\n {{ delimiter_text }}\n )\n {%- else %}\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4128299, "supported_languages": null}, "macro.dbt.datediff": {"unique_id": "macro.dbt.datediff", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "name": "datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt')(first_date, second_date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.414102, "supported_languages": null}, "macro.dbt.default__datediff": {"unique_id": "macro.dbt.default__datediff", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "name": "default__datediff", "macro_sql": "{% macro default__datediff(first_date, second_date, datepart) -%}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.414657, "supported_languages": null}, "macro.dbt.safe_cast": {"unique_id": "macro.dbt.safe_cast", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "name": "safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt') (field, type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4158049, "supported_languages": null}, "macro.dbt.default__safe_cast": {"unique_id": "macro.dbt.default__safe_cast", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "name": "default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4162781, "supported_languages": null}, "macro.dbt.hash": {"unique_id": "macro.dbt.hash", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "name": "hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt') (field)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.417341, "supported_languages": null}, "macro.dbt.default__hash": {"unique_id": "macro.dbt.default__hash", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "name": "default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{ field }} as {{ api.Column.translate_type('string') }}))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4178839, "supported_languages": null}, "macro.dbt.cast_bool_to_text": {"unique_id": "macro.dbt.cast_bool_to_text", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "name": "cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', 'dbt') (field) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.418924, "supported_languages": null}, "macro.dbt.default__cast_bool_to_text": {"unique_id": "macro.dbt.default__cast_bool_to_text", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "name": "default__cast_bool_to_text", "macro_sql": "{% macro default__cast_bool_to_text(field) %}\n cast({{ field }} as {{ api.Column.translate_type('string') }})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.419467, "supported_languages": null}, "macro.dbt.any_value": {"unique_id": "macro.dbt.any_value", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "name": "any_value", "macro_sql": "{% macro any_value(expression) -%}\n {{ return(adapter.dispatch('any_value', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__any_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.420506, "supported_languages": null}, "macro.dbt.default__any_value": {"unique_id": "macro.dbt.default__any_value", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "name": "default__any_value", "macro_sql": "{% macro default__any_value(expression) -%}\n\n any_value({{ expression }})\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4208698, "supported_languages": null}, "macro.dbt.position": {"unique_id": "macro.dbt.position", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "name": "position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt') (substring_text, string_text)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__position"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4220212, "supported_languages": null}, "macro.dbt.default__position": {"unique_id": "macro.dbt.default__position", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "name": "default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4225101, "supported_languages": null}, "macro.dbt.string_literal": {"unique_id": "macro.dbt.string_literal", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "name": "string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt') (value)) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4235451, "supported_languages": null}, "macro.dbt.default__string_literal": {"unique_id": "macro.dbt.default__string_literal", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "name": "default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.423916, "supported_languages": null}, "macro.dbt.type_string": {"unique_id": "macro.dbt.type_string", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.426599, "supported_languages": null}, "macro.dbt.default__type_string": {"unique_id": "macro.dbt.default__type_string", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_string", "macro_sql": "{% macro default__type_string() %}\n {{ return(api.Column.translate_type(\"string\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.427125, "supported_languages": null}, "macro.dbt.type_timestamp": {"unique_id": "macro.dbt.type_timestamp", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.427826, "supported_languages": null}, "macro.dbt.default__type_timestamp": {"unique_id": "macro.dbt.default__type_timestamp", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n {{ return(api.Column.translate_type(\"timestamp\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.428344, "supported_languages": null}, "macro.dbt.type_float": {"unique_id": "macro.dbt.type_float", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.428886, "supported_languages": null}, "macro.dbt.default__type_float": {"unique_id": "macro.dbt.default__type_float", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_float", "macro_sql": "{% macro default__type_float() %}\n {{ return(api.Column.translate_type(\"float\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.429397, "supported_languages": null}, "macro.dbt.type_numeric": {"unique_id": "macro.dbt.type_numeric", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4299378, "supported_languages": null}, "macro.dbt.default__type_numeric": {"unique_id": "macro.dbt.default__type_numeric", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n {{ return(api.Column.numeric_type(\"numeric\", 28, 6)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.430528, "supported_languages": null}, "macro.dbt.type_bigint": {"unique_id": "macro.dbt.type_bigint", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.431073, "supported_languages": null}, "macro.dbt.default__type_bigint": {"unique_id": "macro.dbt.default__type_bigint", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n {{ return(api.Column.translate_type(\"bigint\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4315891, "supported_languages": null}, "macro.dbt.type_int": {"unique_id": "macro.dbt.type_int", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.432129, "supported_languages": null}, "macro.dbt.default__type_int": {"unique_id": "macro.dbt.default__type_int", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_int", "macro_sql": "{%- macro default__type_int() -%}\n {{ return(api.Column.translate_type(\"integer\")) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4326138, "supported_languages": null}, "macro.dbt.type_boolean": {"unique_id": "macro.dbt.type_boolean", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_boolean", "macro_sql": "\n\n{%- macro type_boolean() -%}\n {{ return(adapter.dispatch('type_boolean', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_boolean"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.433146, "supported_languages": null}, "macro.dbt.default__type_boolean": {"unique_id": "macro.dbt.default__type_boolean", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_boolean", "macro_sql": "{%- macro default__type_boolean() -%}\n {{ return(api.Column.translate_type(\"boolean\")) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.433642, "supported_languages": null}, "macro.dbt.array_concat": {"unique_id": "macro.dbt.array_concat", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "name": "array_concat", "macro_sql": "{% macro array_concat(array_1, array_2) -%}\n {{ return(adapter.dispatch('array_concat', 'dbt')(array_1, array_2)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__array_concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4347572, "supported_languages": null}, "macro.dbt.default__array_concat": {"unique_id": "macro.dbt.default__array_concat", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "name": "default__array_concat", "macro_sql": "{% macro default__array_concat(array_1, array_2) -%}\n array_cat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.435209, "supported_languages": null}, "macro.dbt.bool_or": {"unique_id": "macro.dbt.bool_or", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "name": "bool_or", "macro_sql": "{% macro bool_or(expression) -%}\n {{ return(adapter.dispatch('bool_or', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__bool_or"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.436243, "supported_languages": null}, "macro.dbt.default__bool_or": {"unique_id": "macro.dbt.default__bool_or", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "name": "default__bool_or", "macro_sql": "{% macro default__bool_or(expression) -%}\n\n bool_or({{ expression }})\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.436714, "supported_languages": null}, "macro.dbt.last_day": {"unique_id": "macro.dbt.last_day", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "name": "last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt') (date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4380338, "supported_languages": null}, "macro.dbt.default_last_day": {"unique_id": "macro.dbt.default_last_day", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "name": "default_last_day", "macro_sql": "\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd(datepart, '1', dbt.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.43891, "supported_languages": null}, "macro.dbt.default__last_day": {"unique_id": "macro.dbt.default__last_day", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "name": "default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt.default_last_day(date, datepart)}}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.439405, "supported_languages": null}, "macro.dbt.split_part": {"unique_id": "macro.dbt.split_part", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "name": "split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ return(adapter.dispatch('split_part', 'dbt') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.441097, "supported_languages": null}, "macro.dbt.default__split_part": {"unique_id": "macro.dbt.default__split_part", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "name": "default__split_part", "macro_sql": "{% macro default__split_part(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n {{ part_number }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.441665, "supported_languages": null}, "macro.dbt._split_part_negative": {"unique_id": "macro.dbt._split_part_negative", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "name": "_split_part_negative", "macro_sql": "{% macro _split_part_negative(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n length({{ string_text }})\n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 2 {{ part_number }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4425879, "supported_languages": null}, "macro.dbt.date_trunc": {"unique_id": "macro.dbt.date_trunc", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "name": "date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt') (datepart, date)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4437099, "supported_languages": null}, "macro.dbt.default__date_trunc": {"unique_id": "macro.dbt.default__date_trunc", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "name": "default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) -%}\n date_trunc('{{datepart}}', {{date}})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4441578, "supported_languages": null}, "macro.dbt.array_construct": {"unique_id": "macro.dbt.array_construct", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "name": "array_construct", "macro_sql": "{% macro array_construct(inputs=[], data_type=api.Column.translate_type('integer')) -%}\n {{ return(adapter.dispatch('array_construct', 'dbt')(inputs, data_type)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__array_construct"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.445559, "supported_languages": null}, "macro.dbt.default__array_construct": {"unique_id": "macro.dbt.default__array_construct", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "name": "default__array_construct", "macro_sql": "{% macro default__array_construct(inputs, data_type) -%}\n {% if inputs|length > 0 %}\n array[ {{ inputs|join(' , ') }} ]\n {% else %}\n array[]::{{data_type}}[]\n {% endif %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.44636, "supported_languages": null}, "macro.dbt.array_append": {"unique_id": "macro.dbt.array_append", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "name": "array_append", "macro_sql": "{% macro array_append(array, new_element) -%}\n {{ return(adapter.dispatch('array_append', 'dbt')(array, new_element)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__array_append"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.447506, "supported_languages": null}, "macro.dbt.default__array_append": {"unique_id": "macro.dbt.default__array_append", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "name": "default__array_append", "macro_sql": "{% macro default__array_append(array, new_element) -%}\n array_append({{ array }}, {{ new_element }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.447964, "supported_languages": null}, "macro.dbt.create_schema": {"unique_id": "macro.dbt.create_schema", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema', 'dbt')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.44931, "supported_languages": null}, "macro.dbt.default__create_schema": {"unique_id": "macro.dbt.default__create_schema", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4499478, "supported_languages": null}, "macro.dbt.drop_schema": {"unique_id": "macro.dbt.drop_schema", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.45051, "supported_languages": null}, "macro.dbt.default__drop_schema": {"unique_id": "macro.dbt.default__drop_schema", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.451156, "supported_languages": null}, "macro.dbt.current_timestamp": {"unique_id": "macro.dbt.current_timestamp", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "current_timestamp", "macro_sql": "{%- macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.452808, "supported_languages": null}, "macro.dbt.default__current_timestamp": {"unique_id": "macro.dbt.default__current_timestamp", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter ' + adapter.type()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.453341, "supported_languages": null}, "macro.dbt.snapshot_get_time": {"unique_id": "macro.dbt.snapshot_get_time", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "snapshot_get_time", "macro_sql": "\n\n{%- macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.453865, "supported_languages": null}, "macro.dbt.default__snapshot_get_time": {"unique_id": "macro.dbt.default__snapshot_get_time", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() %}\n {{ current_timestamp() }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.454248, "supported_languages": null}, "macro.dbt.current_timestamp_backcompat": {"unique_id": "macro.dbt.current_timestamp_backcompat", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "current_timestamp_backcompat", "macro_sql": "{% macro current_timestamp_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.454805, "supported_languages": null}, "macro.dbt.default__current_timestamp_backcompat": {"unique_id": "macro.dbt.default__current_timestamp_backcompat", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "default__current_timestamp_backcompat", "macro_sql": "{% macro default__current_timestamp_backcompat() %}\n current_timestamp::timestamp\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.455076, "supported_languages": null}, "macro.dbt.current_timestamp_in_utc_backcompat": {"unique_id": "macro.dbt.current_timestamp_in_utc_backcompat", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "current_timestamp_in_utc_backcompat", "macro_sql": "{% macro current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_in_utc_backcompat', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__current_timestamp_in_utc_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.455637, "supported_languages": null}, "macro.dbt.default__current_timestamp_in_utc_backcompat": {"unique_id": "macro.dbt.default__current_timestamp_in_utc_backcompat", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "default__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro default__current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt_bigquery.bigquery__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.456204, "supported_languages": null}, "macro.dbt.get_create_index_sql": {"unique_id": "macro.dbt.get_create_index_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.457786, "supported_languages": null}, "macro.dbt.default__get_create_index_sql": {"unique_id": "macro.dbt.default__get_create_index_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.458435, "supported_languages": null}, "macro.dbt.create_indexes": {"unique_id": "macro.dbt.create_indexes", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes', 'dbt')(relation) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.458969, "supported_languages": null}, "macro.dbt.default__create_indexes": {"unique_id": "macro.dbt.default__create_indexes", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.460272, "supported_languages": null}, "macro.dbt.make_intermediate_relation": {"unique_id": "macro.dbt.make_intermediate_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "make_intermediate_relation", "macro_sql": "{% macro make_intermediate_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_intermediate_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_intermediate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.468462, "supported_languages": null}, "macro.dbt.default__make_intermediate_relation": {"unique_id": "macro.dbt.default__make_intermediate_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__make_intermediate_relation", "macro_sql": "{% macro default__make_intermediate_relation(base_relation, suffix) %}\n {{ return(default__make_temp_relation(base_relation, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4690292, "supported_languages": null}, "macro.dbt.make_temp_relation": {"unique_id": "macro.dbt.make_temp_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4697611, "supported_languages": null}, "macro.dbt.default__make_temp_relation": {"unique_id": "macro.dbt.default__make_temp_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {%- set temp_identifier = base_relation.identifier ~ suffix -%}\n {%- set temp_relation = base_relation.incorporate(\n path={\"identifier\": temp_identifier}) -%}\n\n {{ return(temp_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.470711, "supported_languages": null}, "macro.dbt.make_backup_relation": {"unique_id": "macro.dbt.make_backup_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "make_backup_relation", "macro_sql": "{% macro make_backup_relation(base_relation, backup_relation_type, suffix='__dbt_backup') %}\n {{ return(adapter.dispatch('make_backup_relation', 'dbt')(base_relation, backup_relation_type, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_backup_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4715269, "supported_languages": null}, "macro.dbt.default__make_backup_relation": {"unique_id": "macro.dbt.default__make_backup_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__make_backup_relation", "macro_sql": "{% macro default__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {%- set backup_identifier = base_relation.identifier ~ suffix -%}\n {%- set backup_relation = base_relation.incorporate(\n path={\"identifier\": backup_identifier},\n type=backup_relation_type\n ) -%}\n {{ return(backup_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.472574, "supported_languages": null}, "macro.dbt.drop_relation": {"unique_id": "macro.dbt.drop_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.473184, "supported_languages": null}, "macro.dbt.default__drop_relation": {"unique_id": "macro.dbt.default__drop_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__drop_relation", "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.473896, "supported_languages": null}, "macro.dbt.truncate_relation": {"unique_id": "macro.dbt.truncate_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.474498, "supported_languages": null}, "macro.dbt.default__truncate_relation": {"unique_id": "macro.dbt.default__truncate_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.475052, "supported_languages": null}, "macro.dbt.rename_relation": {"unique_id": "macro.dbt.rename_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.475714, "supported_languages": null}, "macro.dbt.default__rename_relation": {"unique_id": "macro.dbt.default__rename_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.476663, "supported_languages": null}, "macro.dbt.get_or_create_relation": {"unique_id": "macro.dbt.get_or_create_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) -%}\n {{ return(adapter.dispatch('get_or_create_relation', 'dbt')(database, schema, identifier, type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_or_create_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.477479, "supported_languages": null}, "macro.dbt.default__get_or_create_relation": {"unique_id": "macro.dbt.default__get_or_create_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__get_or_create_relation", "macro_sql": "{% macro default__get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.479247, "supported_languages": null}, "macro.dbt.load_cached_relation": {"unique_id": "macro.dbt.load_cached_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "load_cached_relation", "macro_sql": "{% macro load_cached_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.48015, "supported_languages": null}, "macro.dbt.load_relation": {"unique_id": "macro.dbt.load_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {{ return(load_cached_relation(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.480633, "supported_languages": null}, "macro.dbt.drop_relation_if_exists": {"unique_id": "macro.dbt.drop_relation_if_exists", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.481281, "supported_languages": null}, "macro.dbt.collect_freshness": {"unique_id": "macro.dbt.collect_freshness", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness', 'dbt')(source, loaded_at_field, filter))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.48277, "supported_languages": null}, "macro.dbt.default__collect_freshness": {"unique_id": "macro.dbt.default__collect_freshness", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.484145, "supported_languages": null}, "macro.dbt.copy_grants": {"unique_id": "macro.dbt.copy_grants", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "copy_grants", "macro_sql": "{% macro copy_grants() %}\n {{ return(adapter.dispatch('copy_grants', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.488588, "supported_languages": null}, "macro.dbt.default__copy_grants": {"unique_id": "macro.dbt.default__copy_grants", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__copy_grants", "macro_sql": "{% macro default__copy_grants() %}\n {{ return(True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4889941, "supported_languages": null}, "macro.dbt.support_multiple_grantees_per_dcl_statement": {"unique_id": "macro.dbt.support_multiple_grantees_per_dcl_statement", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "support_multiple_grantees_per_dcl_statement", "macro_sql": "{% macro support_multiple_grantees_per_dcl_statement() %}\n {{ return(adapter.dispatch('support_multiple_grantees_per_dcl_statement', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.489558, "supported_languages": null}, "macro.dbt.default__support_multiple_grantees_per_dcl_statement": {"unique_id": "macro.dbt.default__support_multiple_grantees_per_dcl_statement", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__support_multiple_grantees_per_dcl_statement", "macro_sql": "\n\n{%- macro default__support_multiple_grantees_per_dcl_statement() -%}\n {{ return(True) }}\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4899468, "supported_languages": null}, "macro.dbt.should_revoke": {"unique_id": "macro.dbt.should_revoke", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "should_revoke", "macro_sql": "{% macro should_revoke(existing_relation, full_refresh_mode=True) %}\n\n {% if not existing_relation %}\n {#-- The table doesn't already exist, so no grants to copy over --#}\n {{ return(False) }}\n {% elif full_refresh_mode %}\n {#-- The object is being REPLACED -- whether grants are copied over depends on the value of user config --#}\n {{ return(copy_grants()) }}\n {% else %}\n {#-- The table is being merged/upserted/inserted -- grants will be carried over --#}\n {{ return(True) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.491083, "supported_languages": null}, "macro.dbt.get_show_grant_sql": {"unique_id": "macro.dbt.get_show_grant_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_show_grant_sql", "macro_sql": "{% macro get_show_grant_sql(relation) %}\n {{ return(adapter.dispatch(\"get_show_grant_sql\", \"dbt\")(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_show_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.491717, "supported_languages": null}, "macro.dbt.default__get_show_grant_sql": {"unique_id": "macro.dbt.default__get_show_grant_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_show_grant_sql", "macro_sql": "{% macro default__get_show_grant_sql(relation) %}\n show grants on {{ relation }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4920819, "supported_languages": null}, "macro.dbt.get_grant_sql": {"unique_id": "macro.dbt.get_grant_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_grant_sql", "macro_sql": "{% macro get_grant_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_grant_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.492824, "supported_languages": null}, "macro.dbt.default__get_grant_sql": {"unique_id": "macro.dbt.default__get_grant_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_grant_sql", "macro_sql": "\n\n{%- macro default__get_grant_sql(relation, privilege, grantees) -%}\n grant {{ privilege }} on {{ relation }} to {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.493456, "supported_languages": null}, "macro.dbt.get_revoke_sql": {"unique_id": "macro.dbt.get_revoke_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_revoke_sql", "macro_sql": "{% macro get_revoke_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_revoke_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_revoke_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.494207, "supported_languages": null}, "macro.dbt.default__get_revoke_sql": {"unique_id": "macro.dbt.default__get_revoke_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_revoke_sql", "macro_sql": "\n\n{%- macro default__get_revoke_sql(relation, privilege, grantees) -%}\n revoke {{ privilege }} on {{ relation }} from {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.49486, "supported_languages": null}, "macro.dbt.get_dcl_statement_list": {"unique_id": "macro.dbt.get_dcl_statement_list", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_dcl_statement_list", "macro_sql": "{% macro get_dcl_statement_list(relation, grant_config, get_dcl_macro) %}\n {{ return(adapter.dispatch('get_dcl_statement_list', 'dbt')(relation, grant_config, get_dcl_macro)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_dcl_statement_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4956229, "supported_languages": null}, "macro.dbt.default__get_dcl_statement_list": {"unique_id": "macro.dbt.default__get_dcl_statement_list", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_dcl_statement_list", "macro_sql": "\n\n{%- macro default__get_dcl_statement_list(relation, grant_config, get_dcl_macro) -%}\n {#\n -- Unpack grant_config into specific privileges and the set of users who need them granted/revoked.\n -- Depending on whether this database supports multiple grantees per statement, pass in the list of\n -- all grantees per privilege, or (if not) template one statement per privilege-grantee pair.\n -- `get_dcl_macro` will be either `get_grant_sql` or `get_revoke_sql`\n #}\n {%- set dcl_statements = [] -%}\n {%- for privilege, grantees in grant_config.items() %}\n {%- if support_multiple_grantees_per_dcl_statement() and grantees -%}\n {%- set dcl = get_dcl_macro(relation, privilege, grantees) -%}\n {%- do dcl_statements.append(dcl) -%}\n {%- else -%}\n {%- for grantee in grantees -%}\n {% set dcl = get_dcl_macro(relation, privilege, [grantee]) %}\n {%- do dcl_statements.append(dcl) -%}\n {% endfor -%}\n {%- endif -%}\n {%- endfor -%}\n {{ return(dcl_statements) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.497808, "supported_languages": null}, "macro.dbt.call_dcl_statements": {"unique_id": "macro.dbt.call_dcl_statements", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "call_dcl_statements", "macro_sql": "{% macro call_dcl_statements(dcl_statement_list) %}\n {{ return(adapter.dispatch(\"call_dcl_statements\", \"dbt\")(dcl_statement_list)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.498594, "supported_languages": null}, "macro.dbt.default__call_dcl_statements": {"unique_id": "macro.dbt.default__call_dcl_statements", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__call_dcl_statements", "macro_sql": "{% macro default__call_dcl_statements(dcl_statement_list) %}\n {#\n -- By default, supply all grant + revoke statements in a single semicolon-separated block,\n -- so that they're all processed together.\n\n -- Some databases do not support this. Those adapters will need to override this macro\n -- to run each statement individually.\n #}\n {% call statement('grants') %}\n {% for dcl_statement in dcl_statement_list %}\n {{ dcl_statement }};\n {% endfor %}\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.499413, "supported_languages": null}, "macro.dbt.apply_grants": {"unique_id": "macro.dbt.apply_grants", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "apply_grants", "macro_sql": "{% macro apply_grants(relation, grant_config, should_revoke) %}\n {{ return(adapter.dispatch(\"apply_grants\", \"dbt\")(relation, grant_config, should_revoke)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5001578, "supported_languages": null}, "macro.dbt.default__apply_grants": {"unique_id": "macro.dbt.default__apply_grants", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__apply_grants", "macro_sql": "{% macro default__apply_grants(relation, grant_config, should_revoke=True) %}\n {#-- If grant_config is {} or None, this is a no-op --#}\n {% if grant_config %}\n {% if should_revoke %}\n {#-- We think previous grants may have carried over --#}\n {#-- Show current grants and calculate diffs --#}\n {% set current_grants_table = run_query(get_show_grant_sql(relation)) %}\n {% set current_grants_dict = adapter.standardize_grants_dict(current_grants_table) %}\n {% set needs_granting = diff_of_two_dicts(grant_config, current_grants_dict) %}\n {% set needs_revoking = diff_of_two_dicts(current_grants_dict, grant_config) %}\n {% if not (needs_granting or needs_revoking) %}\n {{ log('On ' ~ relation ~': All grants are in place, no revocation or granting needed.')}}\n {% endif %}\n {% else %}\n {#-- We don't think there's any chance of previous grants having carried over. --#}\n {#-- Jump straight to granting what the user has configured. --#}\n {% set needs_revoking = {} %}\n {% set needs_granting = grant_config %}\n {% endif %}\n {% if needs_granting or needs_revoking %}\n {% set revoke_statement_list = get_dcl_statement_list(relation, needs_revoking, get_revoke_sql) %}\n {% set grant_statement_list = get_dcl_statement_list(relation, needs_granting, get_grant_sql) %}\n {% set dcl_statement_list = revoke_statement_list + grant_statement_list %}\n {% if dcl_statement_list %}\n {{ call_dcl_statements(dcl_statement_list) }}\n {% endif %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_grant_sql", "macro.dbt.get_dcl_statement_list", "macro.dbt.call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.503792, "supported_languages": null}, "macro.dbt.alter_column_comment": {"unique_id": "macro.dbt.alter_column_comment", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment', 'dbt')(relation, column_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.505903, "supported_languages": null}, "macro.dbt.default__alter_column_comment": {"unique_id": "macro.dbt.default__alter_column_comment", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.506481, "supported_languages": null}, "macro.dbt.alter_relation_comment": {"unique_id": "macro.dbt.alter_relation_comment", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment', 'dbt')(relation, relation_comment)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.507159, "supported_languages": null}, "macro.dbt.default__alter_relation_comment": {"unique_id": "macro.dbt.default__alter_relation_comment", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.507722, "supported_languages": null}, "macro.dbt.persist_docs": {"unique_id": "macro.dbt.persist_docs", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs', 'dbt')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5085928, "supported_languages": null}, "macro.dbt.default__persist_docs": {"unique_id": "macro.dbt.default__persist_docs", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do run_query(alter_column_comment(relation, model.columns)) %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5101418, "supported_languages": null}, "macro.dbt.get_catalog": {"unique_id": "macro.dbt.get_catalog", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.514124, "supported_languages": null}, "macro.dbt.default__get_catalog": {"unique_id": "macro.dbt.default__get_catalog", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.514983, "supported_languages": null}, "macro.dbt.information_schema_name": {"unique_id": "macro.dbt.information_schema_name", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.515614, "supported_languages": null}, "macro.dbt.default__information_schema_name": {"unique_id": "macro.dbt.default__information_schema_name", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5161521, "supported_languages": null}, "macro.dbt.list_schemas": {"unique_id": "macro.dbt.list_schemas", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5167649, "supported_languages": null}, "macro.dbt.default__list_schemas": {"unique_id": "macro.dbt.default__list_schemas", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5175989, "supported_languages": null}, "macro.dbt.check_schema_exists": {"unique_id": "macro.dbt.check_schema_exists", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists', 'dbt')(information_schema, schema)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.518281, "supported_languages": null}, "macro.dbt.default__check_schema_exists": {"unique_id": "macro.dbt.default__check_schema_exists", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.519275, "supported_languages": null}, "macro.dbt.list_relations_without_caching": {"unique_id": "macro.dbt.list_relations_without_caching", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.519912, "supported_languages": null}, "macro.dbt.default__list_relations_without_caching": {"unique_id": "macro.dbt.default__list_relations_without_caching", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.520465, "supported_languages": null}, "macro.dbt.get_columns_in_relation": {"unique_id": "macro.dbt.get_columns_in_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.524847, "supported_languages": null}, "macro.dbt.default__get_columns_in_relation": {"unique_id": "macro.dbt.default__get_columns_in_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5258749, "supported_languages": null}, "macro.dbt.sql_convert_columns_in_relation": {"unique_id": "macro.dbt.sql_convert_columns_in_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5269172, "supported_languages": null}, "macro.dbt.get_columns_in_query": {"unique_id": "macro.dbt.get_columns_in_query", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5275252, "supported_languages": null}, "macro.dbt.default__get_columns_in_query": {"unique_id": "macro.dbt.default__get_columns_in_query", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.52863, "supported_languages": null}, "macro.dbt.alter_column_type": {"unique_id": "macro.dbt.alter_column_type", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type', 'dbt')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.529376, "supported_languages": null}, "macro.dbt.default__alter_column_type": {"unique_id": "macro.dbt.default__alter_column_type", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.531296, "supported_languages": null}, "macro.dbt.alter_relation_add_remove_columns": {"unique_id": "macro.dbt.alter_relation_add_remove_columns", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "alter_relation_add_remove_columns", "macro_sql": "{% macro alter_relation_add_remove_columns(relation, add_columns = none, remove_columns = none) -%}\n {{ return(adapter.dispatch('alter_relation_add_remove_columns', 'dbt')(relation, add_columns, remove_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__alter_relation_add_remove_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5321321, "supported_languages": null}, "macro.dbt.default__alter_relation_add_remove_columns": {"unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__alter_relation_add_remove_columns", "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation }}\n\n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n\n {% for column in remove_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.534654, "supported_languages": null}, "macro.dbt.build_ref_function": {"unique_id": "macro.dbt.build_ref_function", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "build_ref_function", "macro_sql": "{% macro build_ref_function(model) %}\n\n {%- set ref_dict = {} -%}\n {%- for _ref in model.refs -%}\n {%- set resolved = ref(*_ref) -%}\n {%- do ref_dict.update({_ref | join(\".\"): resolved.quote(database=False, schema=False, identifier=False) | string}) -%}\n {%- endfor -%}\n\ndef ref(*args,dbt_load_df_function):\n refs = {{ ref_dict | tojson }}\n key = \".\".join(args)\n return dbt_load_df_function(refs[key])\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.53872, "supported_languages": null}, "macro.dbt.build_source_function": {"unique_id": "macro.dbt.build_source_function", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "build_source_function", "macro_sql": "{% macro build_source_function(model) %}\n\n {%- set source_dict = {} -%}\n {%- for _source in model.sources -%}\n {%- set resolved = source(*_source) -%}\n {%- do source_dict.update({_source | join(\".\"): resolved.quote(database=False, schema=False, identifier=False) | string}) -%}\n {%- endfor -%}\n\ndef source(*args, dbt_load_df_function):\n sources = {{ source_dict | tojson }}\n key = \".\".join(args)\n return dbt_load_df_function(sources[key])\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.540236, "supported_languages": null}, "macro.dbt.build_config_dict": {"unique_id": "macro.dbt.build_config_dict", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "build_config_dict", "macro_sql": "{% macro build_config_dict(model) %}\n {%- set config_dict = {} -%}\n {%- for key in model.config.config_keys_used -%}\n {# weird type testing with enum, would be much easier to write this logic in Python! #}\n {%- if key == 'language' -%}\n {%- set value = 'python' -%}\n {%- endif -%}\n {%- set value = model.config[key] -%}\n {%- do config_dict.update({key: value}) -%}\n {%- endfor -%}\nconfig_dict = {{ config_dict }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.541721, "supported_languages": null}, "macro.dbt.py_script_postfix": {"unique_id": "macro.dbt.py_script_postfix", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "py_script_postfix", "macro_sql": "{% macro py_script_postfix(model) %}\n# This part is user provided model code\n# you will need to copy the next section to run the code\n# COMMAND ----------\n# this part is dbt logic for get ref work, do not modify\n\n{{ build_ref_function(model ) }}\n{{ build_source_function(model ) }}\n{{ build_config_dict(model) }}\n\nclass config:\n def __init__(self, *args, **kwargs):\n pass\n\n @staticmethod\n def get(key, default=None):\n return config_dict.get(key, default)\n\nclass this:\n \"\"\"dbt.this() or dbt.this.identifier\"\"\"\n database = '{{ this.database }}'\n schema = '{{ this.schema }}'\n identifier = '{{ this.identifier }}'\n def __repr__(self):\n return '{{ this }}'\n\n\nclass dbtObj:\n def __init__(self, load_df_function) -> None:\n self.source = lambda *args: source(*args, dbt_load_df_function=load_df_function)\n self.ref = lambda *args: ref(*args, dbt_load_df_function=load_df_function)\n self.config = config\n self.this = this()\n self.is_incremental = {{ is_incremental() }}\n\n# COMMAND ----------\n{{py_script_comment()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.build_ref_function", "macro.dbt.build_source_function", "macro.dbt.build_config_dict", "macro.dbt.is_incremental", "macro.dbt.py_script_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5430348, "supported_languages": null}, "macro.dbt.py_script_comment": {"unique_id": "macro.dbt.py_script_comment", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "py_script_comment", "macro_sql": "{%macro py_script_comment()%}\n{%endmacro%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5433002, "supported_languages": null}, "macro.dbt.test_unique": {"unique_id": "macro.dbt.test_unique", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5450509, "supported_languages": null}, "macro.dbt.test_not_null": {"unique_id": "macro.dbt.test_not_null", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.54582, "supported_languages": null}, "macro.dbt.test_accepted_values": {"unique_id": "macro.dbt.test_accepted_values", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values', 'dbt') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.546762, "supported_languages": null}, "macro.dbt.test_relationships": {"unique_id": "macro.dbt.test_relationships", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships', 'dbt') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5476758, "supported_languages": null}, "macro.dbt_utils.xdb_deprecation_warning_without_replacement": {"unique_id": "macro.dbt_utils.xdb_deprecation_warning_without_replacement", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/deprecated/xdb_deprecation_warning.sql", "original_file_path": "macros/cross_db_utils/deprecated/xdb_deprecation_warning.sql", "name": "xdb_deprecation_warning_without_replacement", "macro_sql": "{% macro xdb_deprecation_warning_without_replacement(macro, package, model) %}\n {%- set error_message = \"Warning: the `\" ~ macro ~\"` macro is deprecated and will be removed in a future version of the package, once equivalent functionality is implemented in dbt Core. The \" ~ package ~ \".\" ~ model ~ \" model triggered this warning.\" -%}\n {%- do exceptions.warn(error_message) -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.548939, "supported_languages": null}, "macro.dbt_utils.get_url_host": {"unique_id": "macro.dbt_utils.get_url_host", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "name": "get_url_host", "macro_sql": "{% macro get_url_host(field) -%}\n {{ return(adapter.dispatch('get_url_host', 'dbt_utils')(field)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_host"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.55021, "supported_languages": null}, "macro.dbt_utils.default__get_url_host": {"unique_id": "macro.dbt_utils.default__get_url_host", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "name": "default__get_url_host", "macro_sql": "{% macro default__get_url_host(field) -%}\n\n{%- set parsed =\n split_part(\n split_part(\n replace(\n replace(\n replace(field, \"'android-app://'\", \"''\"\n ), \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n\n-%}\n\n\n {{ dbt.safe_cast(\n parsed,\n type_string()\n )}}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.split_part", "macro.dbt.replace", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.551788, "supported_languages": null}, "macro.dbt_utils.get_url_path": {"unique_id": "macro.dbt_utils.get_url_path", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "name": "get_url_path", "macro_sql": "{% macro get_url_path(field) -%}\n {{ return(adapter.dispatch('get_url_path', 'dbt_utils')(field)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_path"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.55335, "supported_languages": null}, "macro.dbt_utils.default__get_url_path": {"unique_id": "macro.dbt_utils.default__get_url_path", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "name": "default__get_url_path", "macro_sql": "{% macro default__get_url_path(field) -%}\n\n {%- set stripped_url =\n replace(\n replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{ position(\"'/'\", stripped_url) }}, 0),\n {{ position(\"'?'\", stripped_url) }} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n split_part(\n right(\n stripped_url,\n length(stripped_url) ~ \"-\" ~ first_slash_pos\n ),\n \"'?'\", 1\n )\n -%}\n\n {{ safe_cast(\n parsed_path,\n type_string()\n )}}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.position", "macro.dbt.split_part", "macro.dbt.right", "macro.dbt.length", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.555247, "supported_languages": null}, "macro.dbt_utils.get_url_parameter": {"unique_id": "macro.dbt_utils.get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "name": "get_url_parameter", "macro_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n {{ return(adapter.dispatch('get_url_parameter', 'dbt_utils')(field, url_parameter)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.556512, "supported_languages": null}, "macro.dbt_utils.default__get_url_parameter": {"unique_id": "macro.dbt_utils.default__get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "name": "default__get_url_parameter", "macro_sql": "{% macro default__get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = split_part(split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.557517, "supported_languages": null}, "macro.dbt_utils.test_fewer_rows_than": {"unique_id": "macro.dbt_utils.test_fewer_rows_than", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "name": "test_fewer_rows_than", "macro_sql": "{% test fewer_rows_than(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_fewer_rows_than', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_fewer_rows_than"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5605, "supported_languages": null}, "macro.dbt_utils.default__test_fewer_rows_than": {"unique_id": "macro.dbt_utils.default__test_fewer_rows_than", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "name": "default__test_fewer_rows_than", "macro_sql": "{% macro default__test_fewer_rows_than(model, compare_model, group_by_columns) %}\n\n{{ config(fail_calc = 'sum(coalesce(row_count_delta, 0))') }}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in equal_rowcount. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_fewer_rows_than'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_our_model \n from {{ model }}\n {{ groupby_gb_cols }}\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_comparison_model \n from {{ compare_model }}\n {{ groupby_gb_cols }}\n\n),\ncounts as (\n\n select\n\n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_our_model,\n count_comparison_model\n from a\n full join b on \n a.id_dbtutils_test_fewer_rows_than = b.id_dbtutils_test_fewer_rows_than\n {{ join_gb_cols }}\n\n),\nfinal as (\n\n select *,\n case\n -- fail the test if we have more rows than the reference model and return the row count delta\n when count_our_model > count_comparison_model then (count_our_model - count_comparison_model)\n -- fail the test if they are the same number\n when count_our_model = count_comparison_model then 1\n -- pass the test if the delta is positive (i.e. return the number 0)\n else 0\n end as row_count_delta\n from counts\n\n)\n\nselect * from final\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.563772, "supported_languages": null}, "macro.dbt_utils.test_equal_rowcount": {"unique_id": "macro.dbt_utils.test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "name": "test_equal_rowcount", "macro_sql": "{% test equal_rowcount(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_equal_rowcount', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_equal_rowcount"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.566273, "supported_languages": null}, "macro.dbt_utils.default__test_equal_rowcount": {"unique_id": "macro.dbt_utils.default__test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "name": "default__test_equal_rowcount", "macro_sql": "{% macro default__test_equal_rowcount(model, compare_model, group_by_columns) %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = 'sum(coalesce(diff_count, 0))') }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(', ') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in fewer_rows_than. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_equal_rowcount'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_a \n from {{ model }}\n {{groupby_gb_cols}}\n\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_b \n from {{ compare_model }}\n {{groupby_gb_cols}}\n\n),\nfinal as (\n\n select\n \n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_a,\n count_b,\n abs(count_a - count_b) as diff_count\n\n from a\n full join b\n on\n a.id_dbtutils_test_equal_rowcount = b.id_dbtutils_test_equal_rowcount\n {{join_gb_cols}}\n\n\n)\n\nselect * from final\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.569769, "supported_languages": null}, "macro.dbt_utils.test_relationships_where": {"unique_id": "macro.dbt_utils.test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "name": "test_relationships_where", "macro_sql": "{% test relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n {{ return(adapter.dispatch('test_relationships_where', 'dbt_utils')(model, column_name, to, field, from_condition, to_condition)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_relationships_where"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.57184, "supported_languages": null}, "macro.dbt_utils.default__test_relationships_where": {"unique_id": "macro.dbt_utils.default__test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "name": "default__test_relationships_where", "macro_sql": "{% macro default__test_relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n\nwith left_table as (\n\n select\n {{column_name}} as id\n\n from {{model}}\n\n where {{column_name}} is not null\n and {{from_condition}}\n\n),\n\nright_table as (\n\n select\n {{field}} as id\n\n from {{to}}\n\n where {{field}} is not null\n and {{to_condition}}\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.572944, "supported_languages": null}, "macro.dbt_utils.test_recency": {"unique_id": "macro.dbt_utils.test_recency", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "name": "test_recency", "macro_sql": "{% test recency(model, field, datepart, interval, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_recency', 'dbt_utils')(model, field, datepart, interval, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_recency"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.57485, "supported_languages": null}, "macro.dbt_utils.default__test_recency": {"unique_id": "macro.dbt_utils.default__test_recency", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "name": "default__test_recency", "macro_sql": "{% macro default__test_recency(model, field, datepart, interval, group_by_columns) %}\n\n{% set threshold = dateadd(datepart, interval * -1, current_timestamp_backcompat()) %}\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nwith recency as (\n\n select \n\n {{ select_gb_cols }}\n max({{field}}) as most_recent\n\n from {{ model }}\n\n {{ groupby_gb_cols }}\n\n)\n\nselect\n\n {{ select_gb_cols }}\n most_recent,\n {{ threshold }} as threshold\n\nfrom recency\nwhere most_recent < {{ threshold }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5769129, "supported_languages": null}, "macro.dbt_utils.test_not_constant": {"unique_id": "macro.dbt_utils.test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "name": "test_not_constant", "macro_sql": "{% test not_constant(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_constant', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_constant"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.57849, "supported_languages": null}, "macro.dbt_utils.default__test_not_constant": {"unique_id": "macro.dbt_utils.default__test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "name": "default__test_not_constant", "macro_sql": "{% macro default__test_not_constant(model, column_name, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nselect\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count(distinct {{ column_name }}) as filler_column\n\nfrom {{ model }}\n\n {{groupby_gb_cols}}\n\nhaving count(distinct {{ column_name }}) = 1\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5799959, "supported_languages": null}, "macro.dbt_utils.test_accepted_range": {"unique_id": "macro.dbt_utils.test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "name": "test_accepted_range", "macro_sql": "{% test accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n {{ return(adapter.dispatch('test_accepted_range', 'dbt_utils')(model, column_name, min_value, max_value, inclusive)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_accepted_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.581983, "supported_languages": null}, "macro.dbt_utils.default__test_accepted_range": {"unique_id": "macro.dbt_utils.default__test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "name": "default__test_accepted_range", "macro_sql": "{% macro default__test_accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n\nwith meet_condition as(\n select *\n from {{ model }}\n),\n\nvalidation_errors as (\n select *\n from meet_condition\n where\n -- never true, defaults to an empty result set. Exists to ensure any combo of the `or` clauses below succeeds\n 1 = 2\n\n {%- if min_value is not none %}\n -- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} > {{- \"=\" if inclusive }} {{ min_value }}\n {%- endif %}\n\n {%- if max_value is not none %}\n -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} < {{- \"=\" if inclusive }} {{ max_value }}\n {%- endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5834959, "supported_languages": null}, "macro.dbt_utils.test_not_accepted_values": {"unique_id": "macro.dbt_utils.test_not_accepted_values", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "name": "test_not_accepted_values", "macro_sql": "{% test not_accepted_values(model, column_name, values, quote=True) %}\n {{ return(adapter.dispatch('test_not_accepted_values', 'dbt_utils')(model, column_name, values, quote)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5852852, "supported_languages": null}, "macro.dbt_utils.default__test_not_accepted_values": {"unique_id": "macro.dbt_utils.default__test_not_accepted_values", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "name": "default__test_not_accepted_values", "macro_sql": "{% macro default__test_not_accepted_values(model, column_name, values, quote=True) %}\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5867488, "supported_languages": null}, "macro.dbt_utils.test_at_least_one": {"unique_id": "macro.dbt_utils.test_at_least_one", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "name": "test_at_least_one", "macro_sql": "{% test at_least_one(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_at_least_one', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_at_least_one"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5883389, "supported_languages": null}, "macro.dbt_utils.default__test_at_least_one": {"unique_id": "macro.dbt_utils.default__test_at_least_one", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "name": "default__test_at_least_one", "macro_sql": "{% macro default__test_at_least_one(model, column_name, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nselect *\nfrom (\n select\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count({{ column_name }}) as filler_column\n\n from {{ model }}\n\n {{groupby_gb_cols}}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5898519, "supported_languages": null}, "macro.dbt_utils.test_unique_combination_of_columns": {"unique_id": "macro.dbt_utils.test_unique_combination_of_columns", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "name": "test_unique_combination_of_columns", "macro_sql": "{% test unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n {{ return(adapter.dispatch('test_unique_combination_of_columns', 'dbt_utils')(model, combination_of_columns, quote_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_combination_of_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5918112, "supported_languages": null}, "macro.dbt_utils.default__test_unique_combination_of_columns": {"unique_id": "macro.dbt_utils.default__test_unique_combination_of_columns", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "name": "default__test_unique_combination_of_columns", "macro_sql": "{% macro default__test_unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n\n{% if not quote_columns %}\n {%- set column_list=combination_of_columns %}\n{% elif quote_columns %}\n {%- set column_list=[] %}\n {% for column in combination_of_columns -%}\n {% set column_list = column_list.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set columns_csv=column_list | join(', ') %}\n\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5938911, "supported_languages": null}, "macro.dbt_utils.test_cardinality_equality": {"unique_id": "macro.dbt_utils.test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "name": "test_cardinality_equality", "macro_sql": "{% test cardinality_equality(model, column_name, to, field) %}\n {{ return(adapter.dispatch('test_cardinality_equality', 'dbt_utils')(model, column_name, to, field)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_cardinality_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.595635, "supported_languages": null}, "macro.dbt_utils.default__test_cardinality_equality": {"unique_id": "macro.dbt_utils.default__test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "name": "default__test_cardinality_equality", "macro_sql": "{% macro default__test_cardinality_equality(model, column_name, to, field) %}\n\n{# T-SQL does not let you use numbers as aliases for columns #}\n{# Thus, no \"GROUP BY 1\" #}\n\nwith table_a as (\nselect\n {{ column_name }},\n count(*) as num_rows\nfrom {{ model }}\ngroup by {{ column_name }}\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by {{ field }}\n),\n\nexcept_a as (\n select *\n from table_a\n {{ except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ except() }}\n select *\n from table_a\n),\n\nunioned as (\n select *\n from except_a\n union all\n select *\n from except_b\n)\n\nselect *\nfrom unioned\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.596713, "supported_languages": null}, "macro.dbt_utils.test_expression_is_true": {"unique_id": "macro.dbt_utils.test_expression_is_true", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "name": "test_expression_is_true", "macro_sql": "{% test expression_is_true(model, expression, column_name=None, condition='1=1') %}\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n {{ return(adapter.dispatch('test_expression_is_true', 'dbt_utils')(model, expression, column_name, condition)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.598424, "supported_languages": null}, "macro.dbt_utils.default__test_expression_is_true": {"unique_id": "macro.dbt_utils.default__test_expression_is_true", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "name": "default__test_expression_is_true", "macro_sql": "{% macro default__test_expression_is_true(model, expression, column_name, condition) %}\n\n{% set column_list = '*' if should_store_failures() else \"1\" %}\n\nwith meet_condition as (\n select * from {{ model }} where {{ condition }}\n)\n\nselect\n {{ column_list }}\nfrom meet_condition\n{% if column_name is none %}\nwhere not({{ expression }})\n{%- else %}\nwhere not({{ column_name }} {{ expression }})\n{%- endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.599723, "supported_languages": null}, "macro.dbt_utils.test_not_null_proportion": {"unique_id": "macro.dbt_utils.test_not_null_proportion", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "name": "test_not_null_proportion", "macro_sql": "{% macro test_not_null_proportion(model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_null_proportion', 'dbt_utils')(model, group_by_columns, **kwargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_proportion"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.6017249, "supported_languages": null}, "macro.dbt_utils.default__test_not_null_proportion": {"unique_id": "macro.dbt_utils.default__test_not_null_proportion", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "name": "default__test_not_null_proportion", "macro_sql": "{% macro default__test_not_null_proportion(model, group_by_columns) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n{% set at_least = kwargs.get('at_least', kwargs.get('arg')) %}\n{% set at_most = kwargs.get('at_most', kwargs.get('arg', 1)) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith validation as (\n select\n {{select_gb_cols}}\n sum(case when {{ column_name }} is null then 0 else 1 end) / cast(count(*) as numeric) as not_null_proportion\n from {{ model }}\n {{groupby_gb_cols}}\n),\nvalidation_errors as (\n select\n {{select_gb_cols}}\n not_null_proportion\n from validation\n where not_null_proportion < {{ at_least }} or not_null_proportion > {{ at_most }}\n)\nselect\n *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.6043751, "supported_languages": null}, "macro.dbt_utils.test_sequential_values": {"unique_id": "macro.dbt_utils.test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "name": "test_sequential_values", "macro_sql": "{% test sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n {{ return(adapter.dispatch('test_sequential_values', 'dbt_utils')(model, column_name, interval, datepart, group_by_columns)) }}\n\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_sequential_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.60698, "supported_languages": null}, "macro.dbt_utils.default__test_sequential_values": {"unique_id": "macro.dbt_utils.default__test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "name": "default__test_sequential_values", "macro_sql": "{% macro default__test_sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n{% set previous_column_name = \"previous_\" ~ dbt_utils.slugify(column_name) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(',') + ', ' %}\n {% set partition_gb_cols = 'partition by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith windowed as (\n\n select\n {{ select_gb_cols }}\n {{ column_name }},\n lag({{ column_name }}) over (\n {{partition_gb_cols}}\n order by {{ column_name }}\n ) as {{ previous_column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ type_timestamp() }})= cast({{ dateadd(datepart, interval, previous_column_name) }} as {{ type_timestamp() }}))\n {% else %}\n where not({{ column_name }} = {{ previous_column_name }} + {{ interval }})\n {% endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.slugify", "macro.dbt.type_timestamp", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.6098719, "supported_languages": null}, "macro.dbt_utils.test_equality": {"unique_id": "macro.dbt_utils.test_equality", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "name": "test_equality", "macro_sql": "{% test equality(model, compare_model, compare_columns=None) %}\n {{ return(adapter.dispatch('test_equality', 'dbt_utils')(model, compare_model, compare_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.612082, "supported_languages": null}, "macro.dbt_utils.default__test_equality": {"unique_id": "macro.dbt_utils.default__test_equality", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "name": "default__test_equality", "macro_sql": "{% macro default__test_equality(model, compare_model, compare_columns=None) %}\n\n{% set set_diff %}\n count(*) + coalesce(abs(\n sum(case when which_diff = 'a_minus_b' then 1 else 0 end) -\n sum(case when which_diff = 'b_minus_a' then 1 else 0 end)\n ), 0)\n{% endset %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = set_diff) }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n-- setup\n{%- do dbt_utils._is_relation(model, 'test_equality') -%}\n\n{#-\nIf the compare_cols arg is provided, we can run this test without querying the\ninformation schema\u00a0\u2014 this allows the model to be an ephemeral model\n-#}\n\n{%- if not compare_columns -%}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set compare_columns = adapter.get_columns_in_relation(model) | map(attribute='quoted') -%}\n{%- endif -%}\n\n{% set compare_cols_csv = compare_columns | join(', ') %}\n\nwith a as (\n\n select * from {{ model }}\n\n),\n\nb as (\n\n select * from {{ compare_model }}\n\n),\n\na_minus_b as (\n\n select {{compare_cols_csv}} from a\n {{ except() }}\n select {{compare_cols_csv}} from b\n\n),\n\nb_minus_a as (\n\n select {{compare_cols_csv}} from b\n {{ except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select 'a_minus_b' as which_diff, a_minus_b.* from a_minus_b\n union all\n select 'b_minus_a' as which_diff, b_minus_a.* from b_minus_a\n\n)\n\nselect * from unioned\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.6148531, "supported_languages": null}, "macro.dbt_utils.test_not_empty_string": {"unique_id": "macro.dbt_utils.test_not_empty_string", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "name": "test_not_empty_string", "macro_sql": "{% test not_empty_string(model, column_name, trim_whitespace=true) %}\n\n {{ return(adapter.dispatch('test_not_empty_string', 'dbt_utils')(model, column_name, trim_whitespace)) }}\n\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_empty_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.6165178, "supported_languages": null}, "macro.dbt_utils.default__test_not_empty_string": {"unique_id": "macro.dbt_utils.default__test_not_empty_string", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "name": "default__test_not_empty_string", "macro_sql": "{% macro default__test_not_empty_string(model, column_name, trim_whitespace=true) %}\n\n with\n \n all_values as (\n\n select \n\n\n {% if trim_whitespace == true -%}\n\n trim({{ column_name }}) as {{ column_name }}\n\n {%- else -%}\n\n {{ column_name }}\n\n {%- endif %}\n \n from {{ model }}\n\n ),\n\n errors as (\n\n select * from all_values\n where {{ column_name }} = ''\n\n )\n\n select * from errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.617503, "supported_languages": null}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "name": "test_mutually_exclusive_ranges", "macro_sql": "{% test mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', 'dbt_utils')(model, lower_bound_column, upper_bound_column, partition_by, gaps, zero_length_range_allowed)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_mutually_exclusive_ranges"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.6257348, "supported_languages": null}, "macro.dbt_utils.default__test_mutually_exclusive_ranges": {"unique_id": "macro.dbt_utils.default__test_mutually_exclusive_ranges", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "name": "default__test_mutually_exclusive_ranges", "macro_sql": "{% macro default__test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n{% if gaps == 'not_allowed' %}\n {% set allow_gaps_operator='=' %}\n {% set allow_gaps_operator_in_words='equal_to' %}\n{% elif gaps == 'allowed' %}\n {% set allow_gaps_operator='<=' %}\n {% set allow_gaps_operator_in_words='less_than_or_equal_to' %}\n{% elif gaps == 'required' %}\n {% set allow_gaps_operator='<' %}\n {% set allow_gaps_operator_in_words='less_than' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '\" ~ gaps ~\"'.'\"\n ) }}\n{% endif %}\n{% if not zero_length_range_allowed %}\n {% set allow_zero_length_operator='<' %}\n {% set allow_zero_length_operator_in_words='less_than' %}\n{% elif zero_length_range_allowed %}\n {% set allow_zero_length_operator='<=' %}\n {% set allow_zero_length_operator_in_words='less_than_or_equal_to' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`zero_length_range_allowed` argument for mutually_exclusive_ranges test must be one of [true, false] Got: '\" ~ zero_length_range_allowed ~\"'.'\"\n ) }}\n{% endif %}\n\n{% set partition_clause=\"partition by \" ~ partition_by if partition_by else '' %}\n\nwith window_functions as (\n\n select\n {% if partition_by %}\n {{ partition_by }} as partition_by_col,\n {% endif %}\n {{ lower_bound_column }} as lower_bound,\n {{ upper_bound_column }} as upper_bound,\n\n lead({{ lower_bound_column }}) over (\n {{ partition_clause }}\n order by {{ lower_bound_column }}, {{ upper_bound_column }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_bound_column }} desc, {{ upper_bound_column }} desc\n ) = 1 as is_last_record\n\n from {{ model }}\n\n),\n\ncalc as (\n -- We want to return records where one of our assumptions fails, so we'll use\n -- the `not` function with `and` statements so we can write our assumptions more cleanly\n select\n *,\n\n -- For each record: lower_bound should be < upper_bound.\n -- Coalesce it to return an error on the null case (implicit assumption\n -- these columns are not_null)\n coalesce(\n lower_bound {{ allow_zero_length_operator }} upper_bound,\n false\n ) as lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect * from validation_errors\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.630819, "supported_languages": null}, "macro.dbt_utils.pretty_log_format": {"unique_id": "macro.dbt_utils.pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "name": "pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n {{ return(adapter.dispatch('pretty_log_format', 'dbt_utils')(message)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.631938, "supported_languages": null}, "macro.dbt_utils.default__pretty_log_format": {"unique_id": "macro.dbt_utils.default__pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "name": "default__pretty_log_format", "macro_sql": "{% macro default__pretty_log_format(message) %}\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.6324968, "supported_languages": null}, "macro.dbt_utils._is_relation": {"unique_id": "macro.dbt_utils._is_relation", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/_is_relation.sql", "original_file_path": "macros/jinja_helpers/_is_relation.sql", "name": "_is_relation", "macro_sql": "{% macro _is_relation(obj, macro) %}\n {%- if not (obj is mapping and obj.get('metadata', {}).get('type', '').endswith('Relation')) -%}\n {%- do exceptions.raise_compiler_error(\"Macro \" ~ macro ~ \" expected a Relation but received the value: \" ~ obj) -%}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.63417, "supported_languages": null}, "macro.dbt_utils.pretty_time": {"unique_id": "macro.dbt_utils.pretty_time", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "name": "pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n {{ return(adapter.dispatch('pretty_time', 'dbt_utils')(format)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.635308, "supported_languages": null}, "macro.dbt_utils.default__pretty_time": {"unique_id": "macro.dbt_utils.default__pretty_time", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "name": "default__pretty_time", "macro_sql": "{% macro default__pretty_time(format='%H:%M:%S') %}\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.635956, "supported_languages": null}, "macro.dbt_utils.log_info": {"unique_id": "macro.dbt_utils.log_info", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "name": "log_info", "macro_sql": "{% macro log_info(message) %}\n {{ return(adapter.dispatch('log_info', 'dbt_utils')(message)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__log_info"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.637066, "supported_languages": null}, "macro.dbt_utils.default__log_info": {"unique_id": "macro.dbt_utils.default__log_info", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "name": "default__log_info", "macro_sql": "{% macro default__log_info(message) %}\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.6376488, "supported_languages": null}, "macro.dbt_utils.slugify": {"unique_id": "macro.dbt_utils.slugify", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/slugify.sql", "original_file_path": "macros/jinja_helpers/slugify.sql", "name": "slugify", "macro_sql": "{% macro slugify(string) %}\n\n{#- Lower case the string -#}\n{% set string = string | lower %}\n{#- Replace spaces and dashes with underscores -#}\n{% set string = modules.re.sub('[ -]+', '_', string) %}\n{#- Only take letters, numbers, and underscores -#}\n{% set string = modules.re.sub('[^a-z0-9_]+', '', string) %}\n\n{{ return(string) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.639371, "supported_languages": null}, "macro.dbt_utils._is_ephemeral": {"unique_id": "macro.dbt_utils._is_ephemeral", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/_is_ephemeral.sql", "original_file_path": "macros/jinja_helpers/_is_ephemeral.sql", "name": "_is_ephemeral", "macro_sql": "{% macro _is_ephemeral(obj, macro) %}\n {%- if obj.is_cte -%}\n {% set ephemeral_prefix = api.Relation.add_ephemeral_prefix('') %}\n {% if obj.name.startswith(ephemeral_prefix) %}\n {% set model_name = obj.name[(ephemeral_prefix|length):] %}\n {% else %}\n {% set model_name = obj.name %}\n {%- endif -%}\n {% set error_message %}\nThe `{{ macro }}` macro cannot be used with ephemeral models, as it relies on the information schema.\n\n`{{ model_name }}` is an ephemeral model. Consider making it a view or table instead.\n {% endset %}\n {%- do exceptions.raise_compiler_error(error_message) -%}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.642146, "supported_languages": null}, "macro.dbt_utils.get_intervals_between": {"unique_id": "macro.dbt_utils.get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_utils')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.6442711, "supported_languages": null}, "macro.dbt_utils.default__get_intervals_between": {"unique_id": "macro.dbt_utils.default__get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.646158, "supported_languages": null}, "macro.dbt_utils.date_spine": {"unique_id": "macro.dbt_utils.date_spine", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_utils')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.646942, "supported_languages": null}, "macro.dbt_utils.default__date_spine": {"unique_id": "macro.dbt_utils.default__date_spine", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{dbt_utils.generate_series(\n dbt_utils.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n),\n\nall_periods as (\n\n select (\n {{\n dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.generate_series", "macro.dbt_utils.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.648086, "supported_languages": null}, "macro.dbt_utils.nullcheck_table": {"unique_id": "macro.dbt_utils.nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "name": "nullcheck_table", "macro_sql": "{% macro nullcheck_table(relation) %}\n {{ return(adapter.dispatch('nullcheck_table', 'dbt_utils')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.649293, "supported_languages": null}, "macro.dbt_utils.default__nullcheck_table": {"unique_id": "macro.dbt_utils.default__nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "name": "default__nullcheck_table", "macro_sql": "{% macro default__nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(relation, 'nullcheck_table') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'nullcheck_table') -%}\n {% set cols = adapter.get_columns_in_relation(relation) %}\n\n select {{ dbt_utils.nullcheck(cols) }}\n from {{relation}}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.6504252, "supported_languages": null}, "macro.dbt_utils.get_relations_by_pattern": {"unique_id": "macro.dbt_utils.get_relations_by_pattern", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "name": "get_relations_by_pattern", "macro_sql": "{% macro get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_pattern', 'dbt_utils')(schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.65255, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_pattern": {"unique_id": "macro.dbt_utils.default__get_relations_by_pattern", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "name": "default__get_relations_by_pattern", "macro_sql": "{% macro default__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.655469, "supported_languages": null}, "macro.dbt_utils.get_powers_of_two": {"unique_id": "macro.dbt_utils.get_powers_of_two", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.657888, "supported_languages": null}, "macro.dbt_utils.default__get_powers_of_two": {"unique_id": "macro.dbt_utils.default__get_powers_of_two", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.659244, "supported_languages": null}, "macro.dbt_utils.generate_series": {"unique_id": "macro.dbt_utils.generate_series", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.659884, "supported_languages": null}, "macro.dbt_utils.default__generate_series": {"unique_id": "macro.dbt_utils.default__generate_series", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_utils.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.6615949, "supported_languages": null}, "macro.dbt_utils.get_relations_by_prefix": {"unique_id": "macro.dbt_utils.get_relations_by_prefix", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "name": "get_relations_by_prefix", "macro_sql": "{% macro get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_prefix', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.663729, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_prefix": {"unique_id": "macro.dbt_utils.default__get_relations_by_prefix", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "name": "default__get_relations_by_prefix", "macro_sql": "{% macro default__get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_prefix_sql(schema, prefix, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.666463, "supported_languages": null}, "macro.dbt_utils.get_tables_by_prefix_sql": {"unique_id": "macro.dbt_utils.get_tables_by_prefix_sql", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "name": "get_tables_by_prefix_sql", "macro_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_prefix_sql', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.667965, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_prefix_sql": {"unique_id": "macro.dbt_utils.default__get_tables_by_prefix_sql", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "name": "default__get_tables_by_prefix_sql", "macro_sql": "{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(\n schema_pattern = schema,\n table_pattern = prefix ~ '%',\n exclude = exclude,\n database = database\n ) }}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.668894, "supported_languages": null}, "macro.dbt_utils.star": {"unique_id": "macro.dbt_utils.star", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "name": "star", "macro_sql": "{% macro star(from, relation_alias=False, except=[], prefix='', suffix='') -%}\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, prefix, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.6711, "supported_languages": null}, "macro.dbt_utils.default__star": {"unique_id": "macro.dbt_utils.default__star", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "name": "default__star", "macro_sql": "{% macro default__star(from, relation_alias=False, except=[], prefix='', suffix='') -%}\n {%- do dbt_utils._is_relation(from, 'star') -%}\n {%- do dbt_utils._is_ephemeral(from, 'star') -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return('*') }}\n {%- endif -%}\n\n {% set cols = dbt_utils.get_filtered_columns_in_relation(from, except) %}\n\n {%- if cols|length <= 0 -%}\n {{- return('*') -}}\n {%- else -%}\n {%- for col in cols %}\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}{{ adapter.quote(col)|trim }} {%- if prefix!='' or suffix!='' %} as {{ adapter.quote(prefix ~ col ~ suffix)|trim }} {%- endif -%}\n {%- if not loop.last %},{{ '\\n ' }}{% endif %}\n {%- endfor -%}\n {% endif %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.674282, "supported_languages": null}, "macro.dbt_utils.unpivot": {"unique_id": "macro.dbt_utils.unpivot", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "name": "unpivot", "macro_sql": "{% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value') -%}\n {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.677938, "supported_languages": null}, "macro.dbt_utils.default__unpivot": {"unique_id": "macro.dbt_utils.default__unpivot", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "name": "default__unpivot", "macro_sql": "{% macro default__unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value') -%}\n\n {% if not relation %}\n {{ exceptions.raise_compiler_error(\"Error: argument `relation` is required for `unpivot` macro.\") }}\n {% endif %}\n\n {%- set exclude = exclude if exclude is not none else [] %}\n {%- set remove = remove if remove is not none else [] %}\n\n {%- set include_cols = [] %}\n\n {%- set table_columns = {} %}\n\n {%- do table_columns.update({relation: []}) %}\n\n {%- do dbt_utils._is_relation(relation, 'unpivot') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'unpivot') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) %}\n\n {%- for col in cols -%}\n {%- if col.column.lower() not in remove|map('lower') and col.column.lower() not in exclude|map('lower') -%}\n {% do include_cols.append(col) %}\n {%- endif %}\n {%- endfor %}\n\n\n {%- for col in include_cols -%}\n select\n {%- for exclude_col in exclude %}\n {{ exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ type_string() }}) as {{ field_name }},\n cast( {% if col.data_type == 'boolean' %}\n {{ cast_bool_to_text(col.column) }}\n {% else %}\n {{ col.column }}\n {% endif %}\n as {{ cast_to }}) as {{ value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_string", "macro.dbt.cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.683149, "supported_languages": null}, "macro.dbt_utils.union_relations": {"unique_id": "macro.dbt_utils.union_relations", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "name": "union_relations", "macro_sql": "{%- macro union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n {{ return(adapter.dispatch('union_relations', 'dbt_utils')(relations, column_override, include, exclude, source_column_name, where)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.690839, "supported_languages": null}, "macro.dbt_utils.default__union_relations": {"unique_id": "macro.dbt_utils.default__union_relations", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "name": "default__union_relations", "macro_sql": "\n\n{%- macro default__union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n cast({{ string_literal(relation) }} as {{ type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ relation }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7017658, "supported_languages": null}, "macro.dbt_utils.group_by": {"unique_id": "macro.dbt_utils.group_by", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "name": "group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_utils')(n)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.702932, "supported_languages": null}, "macro.dbt_utils.default__group_by": {"unique_id": "macro.dbt_utils.default__group_by", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "name": "default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }} \n {%- endfor -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7037592, "supported_languages": null}, "macro.dbt_utils.deduplicate": {"unique_id": "macro.dbt_utils.deduplicate", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "deduplicate", "macro_sql": "{%- macro deduplicate(relation, partition_by, order_by) -%}\n {{ return(adapter.dispatch('deduplicate', 'dbt_utils')(relation, partition_by, order_by)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.70595, "supported_languages": null}, "macro.dbt_utils.default__deduplicate": {"unique_id": "macro.dbt_utils.default__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "default__deduplicate", "macro_sql": "\n\n{%- macro default__deduplicate(relation, partition_by, order_by) -%}\n\n with row_numbered as (\n select\n _inner.*,\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) as rn\n from {{ relation }} as _inner\n )\n\n select\n distinct data.*\n from {{ relation }} as data\n {#\n -- Not all DBs will support natural joins but the ones that do include:\n -- Oracle, MySQL, SQLite, Redshift, Teradata, Materialize, Databricks\n -- Apache Spark, SingleStore, Vertica\n -- Those that do not appear to support natural joins include:\n -- SQLServer, Trino, Presto, Rockset, Athena\n #}\n natural join row_numbered\n where row_numbered.rn = 1\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.706662, "supported_languages": null}, "macro.dbt_utils.redshift__deduplicate": {"unique_id": "macro.dbt_utils.redshift__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "redshift__deduplicate", "macro_sql": "{% macro redshift__deduplicate(relation, partition_by, order_by) -%}\n\n {{ return(dbt_utils.default__deduplicate(relation, partition_by, order_by=order_by)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7073228, "supported_languages": null}, "macro.dbt_utils.postgres__deduplicate": {"unique_id": "macro.dbt_utils.postgres__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "postgres__deduplicate", "macro_sql": "\n{%- macro postgres__deduplicate(relation, partition_by, order_by) -%}\n\n select\n distinct on ({{ partition_by }}) *\n from {{ relation }}\n order by {{ partition_by }}{{ ',' ~ order_by }}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.707958, "supported_languages": null}, "macro.dbt_utils.snowflake__deduplicate": {"unique_id": "macro.dbt_utils.snowflake__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "snowflake__deduplicate", "macro_sql": "\n{%- macro snowflake__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7085152, "supported_languages": null}, "macro.dbt_utils.bigquery__deduplicate": {"unique_id": "macro.dbt_utils.bigquery__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "bigquery__deduplicate", "macro_sql": "\n{%- macro bigquery__deduplicate(relation, partition_by, order_by) -%}\n\n select unique.*\n from (\n select\n array_agg (\n original\n order by {{ order_by }}\n limit 1\n )[offset(0)] unique\n from {{ relation }} original\n group by {{ partition_by }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.709086, "supported_languages": null}, "macro.dbt_utils.surrogate_key": {"unique_id": "macro.dbt_utils.surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "name": "surrogate_key", "macro_sql": "{%- macro surrogate_key(field_list) -%}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('surrogate_key', 'dbt_utils')(field_list, *varargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7105029, "supported_languages": null}, "macro.dbt_utils.default__surrogate_key": {"unique_id": "macro.dbt_utils.default__surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "name": "default__surrogate_key", "macro_sql": "\n\n{%- macro default__surrogate_key(field_list) -%}\n\n{%- set error_message = '\nWarning: `dbt_utils.surrogate_key` has been replaced by \\\n`dbt_utils.generate_surrogate_key`. The new macro treats null values \\\ndifferently to empty strings. To restore the behaviour of the original \\\nmacro, add a variable scoped to the dbt_utils package called \\\n`surrogate_key_treat_nulls_as_empty_strings` to your \\\ndbt_project.yml file with a value of True. \\\nThe {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7112808, "supported_languages": null}, "macro.dbt_utils.safe_add": {"unique_id": "macro.dbt_utils.safe_add", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "name": "safe_add", "macro_sql": "{%- macro safe_add(field_list) -%}\n {{ return(adapter.dispatch('safe_add', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__safe_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.712651, "supported_languages": null}, "macro.dbt_utils.default__safe_add": {"unique_id": "macro.dbt_utils.default__safe_add", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "name": "default__safe_add", "macro_sql": "\n\n{%- macro default__safe_add(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_add` macro now takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.warn(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.714404, "supported_languages": null}, "macro.dbt_utils.nullcheck": {"unique_id": "macro.dbt_utils.nullcheck", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "name": "nullcheck", "macro_sql": "{% macro nullcheck(cols) %}\n {{ return(adapter.dispatch('nullcheck', 'dbt_utils')(cols)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.715696, "supported_languages": null}, "macro.dbt_utils.default__nullcheck": {"unique_id": "macro.dbt_utils.default__nullcheck", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "name": "default__nullcheck", "macro_sql": "{% macro default__nullcheck(cols) %}\n{%- for col in cols %}\n\n {% if col.is_string() -%}\n\n nullif({{col.name}},'') as {{col.name}}\n\n {%- else -%}\n\n {{col.name}}\n\n {%- endif -%}\n\n{%- if not loop.last -%} , {%- endif -%}\n\n{%- endfor -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7168078, "supported_languages": null}, "macro.dbt_utils.get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "get_tables_by_pattern_sql", "macro_sql": "{% macro get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_pattern_sql', 'dbt_utils')\n (schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.721193, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.default__get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "default__get_tables_by_pattern_sql", "macro_sql": "{% macro default__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7223868, "supported_languages": null}, "macro.dbt_utils.bigquery__get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.bigquery__get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "bigquery__get_tables_by_pattern_sql", "macro_sql": "{% macro bigquery__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% if '%' in schema_pattern %}\n {% set schemata=dbt_utils._bigquery__get_matching_schemata(schema_pattern, database) %}\n {% else %}\n {% set schemata=[schema_pattern] %}\n {% endif %}\n\n {% set sql %}\n {% for schema in schemata %}\n select distinct\n table_schema,\n table_name,\n {{ dbt_utils.get_table_types_sql() }}\n\n from {{ adapter.quote(database) }}.{{ schema }}.INFORMATION_SCHEMA.TABLES\n where lower(table_name) like lower ('{{ table_pattern }}')\n and lower(table_name) not like lower ('{{ exclude }}')\n\n {% if not loop.last %} union all {% endif %}\n\n {% endfor %}\n {% endset %}\n\n {{ return(sql) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._bigquery__get_matching_schemata", "macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.724874, "supported_languages": null}, "macro.dbt_utils._bigquery__get_matching_schemata": {"unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "_bigquery__get_matching_schemata", "macro_sql": "{% macro _bigquery__get_matching_schemata(schema_pattern, database) %}\n {% if execute %}\n\n {% set sql %}\n select schema_name from {{ adapter.quote(database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like lower('{{ schema_pattern }}')\n {% endset %}\n\n {% set results=run_query(sql) %}\n\n {% set schemata=results.columns['schema_name'].values() %}\n\n {{ return(schemata) }}\n\n {% else %}\n\n {{ return([]) }}\n\n {% endif %}\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.726538, "supported_languages": null}, "macro.dbt_utils.get_column_values": {"unique_id": "macro.dbt_utils.get_column_values", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "name": "get_column_values", "macro_sql": "{% macro get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {{ return(adapter.dispatch('get_column_values', 'dbt_utils')(table, column, order_by, max_records, default, where)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_column_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.729702, "supported_languages": null}, "macro.dbt_utils.default__get_column_values": {"unique_id": "macro.dbt_utils.default__get_column_values", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "name": "default__get_column_values", "macro_sql": "{% macro default__get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {% set default = [] if not default %}\n {{ return(default) }}\n {% endif %}\n\n {%- do dbt_utils._is_ephemeral(table, 'get_column_values') -%}\n\n {# Not all relations are tables. Renaming for internal clarity without breaking functionality for anyone using named arguments #}\n {# TODO: Change the method signature in a future 0.x.0 release #}\n {%- set target_relation = table -%}\n\n {# adapter.load_relation is a convenience wrapper to avoid building a Relation when we already have one #}\n {% set relation_exists = (load_relation(target_relation)) is not none %}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not relation_exists and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ target_relation ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not relation_exists and default is not none -%}\n\n {{ log(\"Relation \" ~ target_relation ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n\n {% if where is not none %}\n where {{ where }}\n {% endif %}\n\n group by {{ column }}\n order by {{ order_by }}\n\n {% if max_records is not none %}\n limit {{ max_records }}\n {% endif %}\n\n {% endif %}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_column_values') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values) }}\n {%- else -%}\n {{ return(default) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_ephemeral", "macro.dbt.load_relation", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.734516, "supported_languages": null}, "macro.dbt_utils.pivot": {"unique_id": "macro.dbt_utils.pivot", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "name": "pivot", "macro_sql": "{% macro pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {{ return(adapter.dispatch('pivot', 'dbt_utils')(column, values, alias, agg, cmp, prefix, suffix, then_value, else_value, quote_identifiers, distinct)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7377112, "supported_languages": null}, "macro.dbt_utils.default__pivot": {"unique_id": "macro.dbt_utils.default__pivot", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "name": "default__pivot", "macro_sql": "{% macro default__pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {% for value in values %}\n {{ agg }}(\n {% if distinct %} distinct {% endif %}\n case\n when {{ column }} {{ cmp }} '{{ escape_single_quotes(value) }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ value ~ suffix) }}\n {% else %}\n as {{ dbt_utils.slugify(prefix ~ value ~ suffix) }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.escape_single_quotes", "macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.740417, "supported_languages": null}, "macro.dbt_utils.get_filtered_columns_in_relation": {"unique_id": "macro.dbt_utils.get_filtered_columns_in_relation", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "name": "get_filtered_columns_in_relation", "macro_sql": "{% macro get_filtered_columns_in_relation(from, except=[]) -%}\n {{ return(adapter.dispatch('get_filtered_columns_in_relation', 'dbt_utils')(from, except)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.742027, "supported_languages": null}, "macro.dbt_utils.default__get_filtered_columns_in_relation": {"unique_id": "macro.dbt_utils.default__get_filtered_columns_in_relation", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "name": "default__get_filtered_columns_in_relation", "macro_sql": "{% macro default__get_filtered_columns_in_relation(from, except=[]) -%}\n {%- do dbt_utils._is_relation(from, 'get_filtered_columns_in_relation') -%}\n {%- do dbt_utils._is_ephemeral(from, 'get_filtered_columns_in_relation') -%}\n\n {# -- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return('') }}\n {% endif %}\n\n {%- set include_cols = [] %}\n {%- set cols = adapter.get_columns_in_relation(from) -%}\n {%- set except = except | map(\"lower\") | list %}\n {%- for col in cols -%}\n {%- if col.column|lower not in except -%}\n {% do include_cols.append(col.column) %}\n {%- endif %}\n {%- endfor %}\n\n {{ return(include_cols) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.744384, "supported_languages": null}, "macro.dbt_utils.width_bucket": {"unique_id": "macro.dbt_utils.width_bucket", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "name": "width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ return(adapter.dispatch('width_bucket', 'dbt_utils') (expr, min_value, max_value, num_buckets)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__width_bucket"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7481441, "supported_languages": null}, "macro.dbt_utils.default__width_bucket": {"unique_id": "macro.dbt_utils.default__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "name": "default__width_bucket", "macro_sql": "{% macro default__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is eaxtly at the bucket egde\n case\n when\n mod(\n {{ dbt.safe_cast(expr, type_numeric() ) }},\n {{ dbt.safe_cast(bin_size, type_numeric() ) }}\n ) = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.749609, "supported_languages": null}, "macro.dbt_utils.redshift__width_bucket": {"unique_id": "macro.dbt_utils.redshift__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "name": "redshift__width_bucket", "macro_sql": "{% macro redshift__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is exactly at the bucket edge\n case\n when\n {{ dbt.safe_cast(expr, type_numeric() ) }} %\n {{ dbt.safe_cast(bin_size, type_numeric() ) }}\n = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.751059, "supported_languages": null}, "macro.dbt_utils.snowflake__width_bucket": {"unique_id": "macro.dbt_utils.snowflake__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "name": "snowflake__width_bucket", "macro_sql": "{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.751702, "supported_languages": null}, "macro.dbt_utils.get_query_results_as_dict": {"unique_id": "macro.dbt_utils.get_query_results_as_dict", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "name": "get_query_results_as_dict", "macro_sql": "{% macro get_query_results_as_dict(query) %}\n {{ return(adapter.dispatch('get_query_results_as_dict', 'dbt_utils')(query)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_query_results_as_dict"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7531068, "supported_languages": null}, "macro.dbt_utils.default__get_query_results_as_dict": {"unique_id": "macro.dbt_utils.default__get_query_results_as_dict", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "name": "default__get_query_results_as_dict", "macro_sql": "{% macro default__get_query_results_as_dict(query) %}\n\n{# This macro returns a dictionary of the form {column_name: (tuple_of_results)} #}\n\n {%- call statement('get_query_results', fetch_result=True,auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {% set sql_results={} %}\n\n {%- if execute -%}\n {% set sql_results_table = load_result('get_query_results').table.columns %}\n {% for column_name, column in sql_results_table.items() %}\n {% do sql_results.update({column_name: column.values()}) %}\n {% endfor %}\n {%- endif -%}\n\n {{ return(sql_results) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7550411, "supported_languages": null}, "macro.dbt_utils.generate_surrogate_key": {"unique_id": "macro.dbt_utils.generate_surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "name": "generate_surrogate_key", "macro_sql": "{%- macro generate_surrogate_key(field_list) -%}\n {{ return(adapter.dispatch('generate_surrogate_key', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__generate_surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.756604, "supported_languages": null}, "macro.dbt_utils.default__generate_surrogate_key": {"unique_id": "macro.dbt_utils.default__generate_surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "name": "default__generate_surrogate_key", "macro_sql": "\n\n{%- macro default__generate_surrogate_key(field_list) -%}\n\n{% if var('surrogate_key_treat_nulls_as_empty_strings', False) %}\n {% set default_null_value = \"\" %}\n{% else %}\n {% set default_null_value = '_dbt_utils_surrogate_key_null_'%}\n{% endif %}\n\n{%- set fields = [] -%}\n\n{%- for field in field_list -%}\n\n {%- do fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ type_string() ~ \"), '\" ~ default_null_value ~\"')\"\n ) -%}\n\n {%- if not loop.last %}\n {%- do fields.append(\"'-'\") -%}\n {%- endif -%}\n\n{%- endfor -%}\n\n{{ hash(concat(fields)) }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.hash", "macro.dbt.concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.758677, "supported_languages": null}, "macro.dbt_utils.get_table_types_sql": {"unique_id": "macro.dbt_utils.get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "name": "get_table_types_sql", "macro_sql": "{%- macro get_table_types_sql() -%}\n {{ return(adapter.dispatch('get_table_types_sql', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7600489, "supported_languages": null}, "macro.dbt_utils.default__get_table_types_sql": {"unique_id": "macro.dbt_utils.default__get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "name": "default__get_table_types_sql", "macro_sql": "{% macro default__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7605271, "supported_languages": null}, "macro.dbt_utils.postgres__get_table_types_sql": {"unique_id": "macro.dbt_utils.postgres__get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "name": "postgres__get_table_types_sql", "macro_sql": "{% macro postgres__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'FOREIGN' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.761009, "supported_languages": null}, "macro.dbt_utils.degrees_to_radians": {"unique_id": "macro.dbt_utils.degrees_to_radians", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "degrees_to_radians", "macro_sql": "{% macro degrees_to_radians(degrees) -%}\n acos(-1) * {{degrees}} / 180\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.763941, "supported_languages": null}, "macro.dbt_utils.haversine_distance": {"unique_id": "macro.dbt_utils.haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "haversine_distance", "macro_sql": "{% macro haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n {{ return(adapter.dispatch('haversine_distance', 'dbt_utils')(lat1,lon1,lat2,lon2,unit)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.765026, "supported_languages": null}, "macro.dbt_utils.default__haversine_distance": {"unique_id": "macro.dbt_utils.default__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n\n 2 * 3961 * asin(sqrt(power((sin(radians(({{ lat2 }} - {{ lat1 }}) / 2))), 2) +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n power((sin(radians(({{ lon2 }} - {{ lon1 }}) / 2))), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7676318, "supported_languages": null}, "macro.dbt_utils.bigquery__haversine_distance": {"unique_id": "macro.dbt_utils.bigquery__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "bigquery__haversine_distance", "macro_sql": "{% macro bigquery__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{% set radians_lat1 = dbt_utils.degrees_to_radians(lat1) %}\n{% set radians_lat2 = dbt_utils.degrees_to_radians(lat2) %}\n{% set radians_lon1 = dbt_utils.degrees_to_radians(lon1) %}\n{% set radians_lon2 = dbt_utils.degrees_to_radians(lon2) %}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n 2 * 3961 * asin(sqrt(power(sin(({{ radians_lat2 }} - {{ radians_lat1 }}) / 2), 2) +\n cos({{ radians_lat1 }}) * cos({{ radians_lat2 }}) *\n power(sin(({{ radians_lon2 }} - {{ radians_lon1 }}) / 2), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.degrees_to_radians"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7702882, "supported_languages": null}, "macro.fivetran_utils.enabled_vars": {"unique_id": "macro.fivetran_utils.enabled_vars", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/enabled_vars.sql", "original_file_path": "macros/enabled_vars.sql", "name": "enabled_vars", "macro_sql": "{% macro enabled_vars(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, True) == False %}\n {{ return(False) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(True) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.771927, "supported_languages": null}, "macro.fivetran_utils.percentile": {"unique_id": "macro.fivetran_utils.percentile", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "percentile", "macro_sql": "{% macro percentile(percentile_field, partition_field, percent) -%}\n\n{{ adapter.dispatch('percentile', 'fivetran_utils') (percentile_field, partition_field, percent) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__percentile"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.774545, "supported_languages": null}, "macro.fivetran_utils.default__percentile": {"unique_id": "macro.fivetran_utils.default__percentile", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "default__percentile", "macro_sql": "{% macro default__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.775103, "supported_languages": null}, "macro.fivetran_utils.redshift__percentile": {"unique_id": "macro.fivetran_utils.redshift__percentile", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "redshift__percentile", "macro_sql": "{% macro redshift__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.775661, "supported_languages": null}, "macro.fivetran_utils.bigquery__percentile": {"unique_id": "macro.fivetran_utils.bigquery__percentile", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "bigquery__percentile", "macro_sql": "{% macro bigquery__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.776212, "supported_languages": null}, "macro.fivetran_utils.postgres__percentile": {"unique_id": "macro.fivetran_utils.postgres__percentile", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "postgres__percentile", "macro_sql": "{% macro postgres__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n /* have to group by partition field */\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.776709, "supported_languages": null}, "macro.fivetran_utils.spark__percentile": {"unique_id": "macro.fivetran_utils.spark__percentile", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "spark__percentile", "macro_sql": "{% macro spark__percentile(percentile_field, partition_field, percent) %}\n\n percentile( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7772522, "supported_languages": null}, "macro.fivetran_utils.pivot_json_extract": {"unique_id": "macro.fivetran_utils.pivot_json_extract", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/pivot_json_extract.sql", "original_file_path": "macros/pivot_json_extract.sql", "name": "pivot_json_extract", "macro_sql": "{% macro pivot_json_extract(string, list_of_properties) %}\n\n{%- for property in list_of_properties -%}\n\nreplace( {{ fivetran_utils.json_extract(string, property) }}, '\"', '') as {{ property | replace(' ', '_') | lower }}\n\n{%- if not loop.last -%},{%- endif %}\n{% endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7788339, "supported_languages": null}, "macro.fivetran_utils.persist_pass_through_columns": {"unique_id": "macro.fivetran_utils.persist_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/persist_pass_through_columns.sql", "original_file_path": "macros/persist_pass_through_columns.sql", "name": "persist_pass_through_columns", "macro_sql": "{% macro persist_pass_through_columns(pass_through_variable, identifier=none, transform='') %}\n\n{% if var(pass_through_variable, none) %}\n {% for field in var(pass_through_variable) %}\n , {{ transform ~ '(' ~ (identifier ~ '.' if identifier else '') ~ (field.alias if field.alias else field.name) ~ ')' }} as {{ field.alias if field.alias else field.name }}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.781069, "supported_languages": null}, "macro.fivetran_utils.json_parse": {"unique_id": "macro.fivetran_utils.json_parse", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "json_parse", "macro_sql": "{% macro json_parse(string, string_path) -%}\n\n{{ adapter.dispatch('json_parse', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__json_parse"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.784142, "supported_languages": null}, "macro.fivetran_utils.default__json_parse": {"unique_id": "macro.fivetran_utils.default__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "default__json_parse", "macro_sql": "{% macro default__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.784975, "supported_languages": null}, "macro.fivetran_utils.redshift__json_parse": {"unique_id": "macro.fivetran_utils.redshift__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "redshift__json_parse", "macro_sql": "{% macro redshift__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.785814, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_parse": {"unique_id": "macro.fivetran_utils.bigquery__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "bigquery__json_parse", "macro_sql": "{% macro bigquery__json_parse(string, string_path) %}\n\n \n json_extract_scalar({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.78662, "supported_languages": null}, "macro.fivetran_utils.postgres__json_parse": {"unique_id": "macro.fivetran_utils.postgres__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "postgres__json_parse", "macro_sql": "{% macro postgres__json_parse(string, string_path) %}\n\n {{string}}::json #>> '{ {%- for s in string_path -%}{{ s }}{%- if not loop.last -%},{%- endif -%}{%- endfor -%} }'\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7874188, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_parse": {"unique_id": "macro.fivetran_utils.snowflake__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "snowflake__json_parse", "macro_sql": "{% macro snowflake__json_parse(string, string_path) %}\n\n parse_json( {{string}} ) {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7883039, "supported_languages": null}, "macro.fivetran_utils.spark__json_parse": {"unique_id": "macro.fivetran_utils.spark__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "spark__json_parse", "macro_sql": "{% macro spark__json_parse(string, string_path) %}\n\n {{string}} : {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.789184, "supported_languages": null}, "macro.fivetran_utils.max_bool": {"unique_id": "macro.fivetran_utils.max_bool", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "max_bool", "macro_sql": "{% macro max_bool(boolean_field) -%}\n\n{{ adapter.dispatch('max_bool', 'fivetran_utils') (boolean_field) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__max_bool"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7903922, "supported_languages": null}, "macro.fivetran_utils.default__max_bool": {"unique_id": "macro.fivetran_utils.default__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "default__max_bool", "macro_sql": "{% macro default__max_bool(boolean_field) %}\n\n bool_or( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.790764, "supported_languages": null}, "macro.fivetran_utils.snowflake__max_bool": {"unique_id": "macro.fivetran_utils.snowflake__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "snowflake__max_bool", "macro_sql": "{% macro snowflake__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.791307, "supported_languages": null}, "macro.fivetran_utils.bigquery__max_bool": {"unique_id": "macro.fivetran_utils.bigquery__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "bigquery__max_bool", "macro_sql": "{% macro bigquery__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.791667, "supported_languages": null}, "macro.fivetran_utils.calculated_fields": {"unique_id": "macro.fivetran_utils.calculated_fields", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/calculated_fields.sql", "original_file_path": "macros/calculated_fields.sql", "name": "calculated_fields", "macro_sql": "{% macro calculated_fields(variable) -%}\n\n{% if var(variable, none) %}\n {% for field in var(variable) %}\n , {{ field.transform_sql }} as {{ field.name }} \n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.79309, "supported_languages": null}, "macro.fivetran_utils.seed_data_helper": {"unique_id": "macro.fivetran_utils.seed_data_helper", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/seed_data_helper.sql", "original_file_path": "macros/seed_data_helper.sql", "name": "seed_data_helper", "macro_sql": "{% macro seed_data_helper(seed_name, warehouses) %}\n\n{% if target.type in warehouses %}\n {% for w in warehouses %}\n {% if target.type == w %}\n {{ return(ref(seed_name ~ \"_\" ~ w ~ \"\")) }}\n {% endif %}\n {% endfor %}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.795137, "supported_languages": null}, "macro.fivetran_utils.fill_pass_through_columns": {"unique_id": "macro.fivetran_utils.fill_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/fill_pass_through_columns.sql", "original_file_path": "macros/fill_pass_through_columns.sql", "name": "fill_pass_through_columns", "macro_sql": "{% macro fill_pass_through_columns(pass_through_variable) %}\n\n{% if var(pass_through_variable) %}\n {% for field in var(pass_through_variable) %}\n {% if field.transform_sql %}\n , {{ field.transform_sql }} as {{ field.alias if field.alias else field.name }}\n {% else %}\n , {{ field.alias if field.alias else field.name }}\n {% endif %}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7972639, "supported_languages": null}, "macro.fivetran_utils.string_agg": {"unique_id": "macro.fivetran_utils.string_agg", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "string_agg", "macro_sql": "{% macro string_agg(field_to_agg, delimiter) -%}\n\n{{ adapter.dispatch('string_agg', 'fivetran_utils') (field_to_agg, delimiter) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__string_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.79883, "supported_languages": null}, "macro.fivetran_utils.default__string_agg": {"unique_id": "macro.fivetran_utils.default__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "default__string_agg", "macro_sql": "{% macro default__string_agg(field_to_agg, delimiter) %}\n string_agg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.799284, "supported_languages": null}, "macro.fivetran_utils.snowflake__string_agg": {"unique_id": "macro.fivetran_utils.snowflake__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "snowflake__string_agg", "macro_sql": "{% macro snowflake__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7997298, "supported_languages": null}, "macro.fivetran_utils.redshift__string_agg": {"unique_id": "macro.fivetran_utils.redshift__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "redshift__string_agg", "macro_sql": "{% macro redshift__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.800171, "supported_languages": null}, "macro.fivetran_utils.spark__string_agg": {"unique_id": "macro.fivetran_utils.spark__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "spark__string_agg", "macro_sql": "{% macro spark__string_agg(field_to_agg, delimiter) %}\n -- collect set will remove duplicates\n replace(replace(replace(cast( collect_set({{ field_to_agg }}) as string), '[', ''), ']', ''), ', ', {{ delimiter }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.80063, "supported_languages": null}, "macro.fivetran_utils.timestamp_diff": {"unique_id": "macro.fivetran_utils.timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "timestamp_diff", "macro_sql": "{% macro timestamp_diff(first_date, second_date, datepart) %}\n {{ adapter.dispatch('timestamp_diff', 'fivetran_utils')(first_date, second_date, datepart) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__timestamp_diff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.807853, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_diff": {"unique_id": "macro.fivetran_utils.default__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "default__timestamp_diff", "macro_sql": "{% macro default__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.8084202, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_diff": {"unique_id": "macro.fivetran_utils.redshift__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "redshift__timestamp_diff", "macro_sql": "{% macro redshift__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.808964, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_diff": {"unique_id": "macro.fivetran_utils.bigquery__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "bigquery__timestamp_diff", "macro_sql": "{% macro bigquery__timestamp_diff(first_date, second_date, datepart) %}\n\n timestamp_diff(\n {{second_date}},\n {{first_date}},\n {{datepart}}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.809485, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_diff": {"unique_id": "macro.fivetran_utils.postgres__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "postgres__timestamp_diff", "macro_sql": "{% macro postgres__timestamp_diff(first_date, second_date, datepart) %}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ dbt.datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.815081, "supported_languages": null}, "macro.fivetran_utils.try_cast": {"unique_id": "macro.fivetran_utils.try_cast", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "try_cast", "macro_sql": "{% macro try_cast(field, type) %}\n {{ adapter.dispatch('try_cast', 'fivetran_utils') (field, type) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__try_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.8175519, "supported_languages": null}, "macro.fivetran_utils.default__safe_cast": {"unique_id": "macro.fivetran_utils.default__safe_cast", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.818024, "supported_languages": null}, "macro.fivetran_utils.redshift__try_cast": {"unique_id": "macro.fivetran_utils.redshift__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "redshift__try_cast", "macro_sql": "{% macro redshift__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when trim({{field}}) ~ '^(0|[1-9][0-9]*)$' then trim({{field}})\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.8189352, "supported_languages": null}, "macro.fivetran_utils.postgres__try_cast": {"unique_id": "macro.fivetran_utils.postgres__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "postgres__try_cast", "macro_sql": "{% macro postgres__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar)) ~ '^(0|[1-9][0-9]*)$' \n then replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar))\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.8198771, "supported_languages": null}, "macro.fivetran_utils.snowflake__try_cast": {"unique_id": "macro.fivetran_utils.snowflake__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "snowflake__try_cast", "macro_sql": "{% macro snowflake__try_cast(field, type) %}\n try_cast(cast({{field}} as varchar) as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.820322, "supported_languages": null}, "macro.fivetran_utils.bigquery__try_cast": {"unique_id": "macro.fivetran_utils.bigquery__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "bigquery__try_cast", "macro_sql": "{% macro bigquery__try_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.8207529, "supported_languages": null}, "macro.fivetran_utils.spark__try_cast": {"unique_id": "macro.fivetran_utils.spark__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "spark__try_cast", "macro_sql": "{% macro spark__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.821179, "supported_languages": null}, "macro.fivetran_utils.source_relation": {"unique_id": "macro.fivetran_utils.source_relation", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "name": "source_relation", "macro_sql": "{% macro source_relation(union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('source_relation', 'fivetran_utils') (union_schema_variable, union_database_variable) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.822816, "supported_languages": null}, "macro.fivetran_utils.default__source_relation": {"unique_id": "macro.fivetran_utils.default__source_relation", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "name": "default__source_relation", "macro_sql": "{% macro default__source_relation(union_schema_variable, union_database_variable) %}\n\n{% if var(union_schema_variable, none) %}\n, case\n {% for schema in var(union_schema_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%.{{ schema|lower }}.%' then '{{ schema|lower }}'\n {% endfor %}\n end as source_relation\n{% elif var(union_database_variable, none) %}\n, case\n {% for database in var(union_database_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%{{ database|lower }}.%' then '{{ database|lower }}'\n {% endfor %}\n end as source_relation\n{% else %}\n, cast('' as {{ dbt.type_string() }}) as source_relation\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.824681, "supported_languages": null}, "macro.fivetran_utils.first_value": {"unique_id": "macro.fivetran_utils.first_value", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "first_value", "macro_sql": "{% macro first_value(first_value_field, partition_field, order_by_field, order=\"asc\") -%}\n\n{{ adapter.dispatch('first_value', 'fivetran_utils') (first_value_field, partition_field, order_by_field, order) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__first_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.826349, "supported_languages": null}, "macro.fivetran_utils.default__first_value": {"unique_id": "macro.fivetran_utils.default__first_value", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "default__first_value", "macro_sql": "{% macro default__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.827039, "supported_languages": null}, "macro.fivetran_utils.redshift__first_value": {"unique_id": "macro.fivetran_utils.redshift__first_value", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "redshift__first_value", "macro_sql": "{% macro redshift__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} , {{ partition_field }} rows unbounded preceding )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.827771, "supported_languages": null}, "macro.fivetran_utils.add_dbt_source_relation": {"unique_id": "macro.fivetran_utils.add_dbt_source_relation", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/add_dbt_source_relation.sql", "original_file_path": "macros/add_dbt_source_relation.sql", "name": "add_dbt_source_relation", "macro_sql": "{% macro add_dbt_source_relation() %}\n\n{% if var('union_schemas', none) or var('union_databases', none) %}\n, _dbt_source_relation\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.82885, "supported_languages": null}, "macro.fivetran_utils.add_pass_through_columns": {"unique_id": "macro.fivetran_utils.add_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/add_pass_through_columns.sql", "original_file_path": "macros/add_pass_through_columns.sql", "name": "add_pass_through_columns", "macro_sql": "{% macro add_pass_through_columns(base_columns, pass_through_var) %}\n\n {% if pass_through_var %}\n\n {% for column in pass_through_var %}\n\n {% if column.alias %}\n\n {% do base_columns.append({ \"name\": column.name, \"alias\": column.alias, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column.name, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n \n {% endif %}\n\n {% endfor %}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.831614, "supported_languages": null}, "macro.fivetran_utils.union_relations": {"unique_id": "macro.fivetran_utils.union_relations", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "name": "union_relations", "macro_sql": "{%- macro union_relations(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n {%- set source_column_name = source_column_name if source_column_name is not none else '_dbt_source_relation' -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt_utils.string_literal(relation) }} as {{ dbt_utils.type_string() }}) as {{ source_column_name }},\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ aliases[loop.index0] if aliases else relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.843192, "supported_languages": null}, "macro.fivetran_utils.union_tables": {"unique_id": "macro.fivetran_utils.union_tables", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "name": "union_tables", "macro_sql": "{%- macro union_tables(tables, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_table') -%}\n\n {%- do exceptions.warn(\"Warning: the `union_tables` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use the `union_relations` macro instead\") -%}\n\n {{ return(dbt_utils.union_relations(tables, column_override, include, exclude, source_column_name)) }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.844327, "supported_languages": null}, "macro.fivetran_utils.snowflake_seed_data": {"unique_id": "macro.fivetran_utils.snowflake_seed_data", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/snowflake_seed_data.sql", "original_file_path": "macros/snowflake_seed_data.sql", "name": "snowflake_seed_data", "macro_sql": "{% macro snowflake_seed_data(seed_name) %}\n\n{% if target.type == 'snowflake' %}\n{{ return(ref(seed_name ~ '_snowflake')) }}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.845765, "supported_languages": null}, "macro.fivetran_utils.fill_staging_columns": {"unique_id": "macro.fivetran_utils.fill_staging_columns", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "name": "fill_staging_columns", "macro_sql": "{% macro fill_staging_columns(source_columns, staging_columns) -%}\n\n{%- set source_column_names = source_columns|map(attribute='name')|map('lower')|list -%}\n\n{%- for column in staging_columns %}\n {% if column.name|lower in source_column_names -%}\n {{ fivetran_utils.quote_column(column) }} as \n {%- if 'alias' in column %} {{ column.alias }} {% else %} {{ fivetran_utils.quote_column(column) }} {%- endif -%}\n {%- else -%}\n cast(null as {{ column.datatype }})\n {%- if 'alias' in column %} as {{ column.alias }} {% else %} as {{ fivetran_utils.quote_column(column) }} {% endif -%}\n {%- endif -%}\n {%- if not loop.last -%} , {% endif -%}\n{% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.quote_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.850337, "supported_languages": null}, "macro.fivetran_utils.quote_column": {"unique_id": "macro.fivetran_utils.quote_column", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "name": "quote_column", "macro_sql": "{% macro quote_column(column) %}\n {% if 'quote' in column %}\n {% if column.quote %}\n {% if target.type in ('bigquery', 'spark') %}\n `{{ column.name }}`\n {% elif target.type == 'snowflake' %}\n \"{{ column.name | upper }}\"\n {% else %}\n \"{{ column.name }}\"\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.852114, "supported_languages": null}, "macro.fivetran_utils.json_extract": {"unique_id": "macro.fivetran_utils.json_extract", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "json_extract", "macro_sql": "{% macro json_extract(string, string_path) -%}\n\n{{ adapter.dispatch('json_extract', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.8539038, "supported_languages": null}, "macro.fivetran_utils.default__json_extract": {"unique_id": "macro.fivetran_utils.default__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "default__json_extract", "macro_sql": "{% macro default__json_extract(string, string_path) %}\n\n json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} )\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.8544278, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_extract": {"unique_id": "macro.fivetran_utils.snowflake__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "snowflake__json_extract", "macro_sql": "{% macro snowflake__json_extract(string, string_path) %}\n\n json_extract_path_text(try_parse_json( {{string}} ), {{ \"'\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.8549492, "supported_languages": null}, "macro.fivetran_utils.redshift__json_extract": {"unique_id": "macro.fivetran_utils.redshift__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "redshift__json_extract", "macro_sql": "{% macro redshift__json_extract(string, string_path) %}\n\n case when is_valid_json( {{string}} ) then json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} ) else null end\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.855529, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_extract": {"unique_id": "macro.fivetran_utils.bigquery__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "bigquery__json_extract", "macro_sql": "{% macro bigquery__json_extract(string, string_path) %}\n\n json_extract_scalar({{string}}, {{ \"'$.\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.8560472, "supported_languages": null}, "macro.fivetran_utils.postgres__json_extract": {"unique_id": "macro.fivetran_utils.postgres__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "postgres__json_extract", "macro_sql": "{% macro postgres__json_extract(string, string_path) %}\n\n {{string}}::json->>{{\"'\" ~ string_path ~ \"'\" }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.856565, "supported_languages": null}, "macro.fivetran_utils.collect_freshness": {"unique_id": "macro.fivetran_utils.collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "name": "collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness')(source, loaded_at_field, filter))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.858701, "supported_languages": null}, "macro.fivetran_utils.default__collect_freshness": {"unique_id": "macro.fivetran_utils.default__collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "name": "default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n\n {%- set enabled_array = [] -%}\n {% for node in graph.sources.values() %}\n {% if node.identifier == source.identifier %}\n {% if (node.meta['is_enabled'] | default(true)) %}\n {%- do enabled_array.append(1) -%}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% set is_enabled = (enabled_array != []) %}\n\n select\n {% if is_enabled %}\n max({{ loaded_at_field }})\n {% else %} \n {{ current_timestamp() }} {% endif %} as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n\n {% if is_enabled %}\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endif %}\n\n {% endcall %}\n {{ return(load_result('collect_freshness').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.861823, "supported_languages": null}, "macro.fivetran_utils.timestamp_add": {"unique_id": "macro.fivetran_utils.timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "timestamp_add", "macro_sql": "{% macro timestamp_add(datepart, interval, from_timestamp) -%}\n\n{{ adapter.dispatch('timestamp_add', 'fivetran_utils') (datepart, interval, from_timestamp) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__timestamp_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.863909, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_add": {"unique_id": "macro.fivetran_utils.default__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "default__timestamp_add", "macro_sql": "{% macro default__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestampadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.864463, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_add": {"unique_id": "macro.fivetran_utils.bigquery__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "bigquery__timestamp_add", "macro_sql": "{% macro bigquery__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestamp_add({{ from_timestamp }}, interval {{ interval }} {{ datepart }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.865, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_add": {"unique_id": "macro.fivetran_utils.redshift__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "redshift__timestamp_add", "macro_sql": "{% macro redshift__timestamp_add(datepart, interval, from_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.865556, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_add": {"unique_id": "macro.fivetran_utils.postgres__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "postgres__timestamp_add", "macro_sql": "{% macro postgres__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ from_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.866095, "supported_languages": null}, "macro.fivetran_utils.spark__timestamp_add": {"unique_id": "macro.fivetran_utils.spark__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "spark__timestamp_add", "macro_sql": "{% macro spark__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ dbt.dateadd(datepart, interval, from_timestamp) }}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.8666828, "supported_languages": null}, "macro.fivetran_utils.ceiling": {"unique_id": "macro.fivetran_utils.ceiling", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "ceiling", "macro_sql": "{% macro ceiling(num) -%}\n\n{{ adapter.dispatch('ceiling', 'fivetran_utils') (num) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__ceiling"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.867723, "supported_languages": null}, "macro.fivetran_utils.default__ceiling": {"unique_id": "macro.fivetran_utils.default__ceiling", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "default__ceiling", "macro_sql": "{% macro default__ceiling(num) %}\n ceiling({{ num }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.868098, "supported_languages": null}, "macro.fivetran_utils.snowflake__ceiling": {"unique_id": "macro.fivetran_utils.snowflake__ceiling", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "snowflake__ceiling", "macro_sql": "{% macro snowflake__ceiling(num) %}\n ceil({{ num }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.868958, "supported_languages": null}, "macro.fivetran_utils.remove_prefix_from_columns": {"unique_id": "macro.fivetran_utils.remove_prefix_from_columns", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/remove_prefix_from_columns.sql", "original_file_path": "macros/remove_prefix_from_columns.sql", "name": "remove_prefix_from_columns", "macro_sql": "{% macro remove_prefix_from_columns(columns, prefix='', exclude=[]) %}\n\n {%- for col in columns if col.name not in exclude -%}\n {%- if col.name[:prefix|length]|lower == prefix -%}\n {{ col.name }} as {{ col.name[prefix|length:] }}\n {%- else -%}\n {{ col.name }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {% endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.871159, "supported_languages": null}, "macro.fivetran_utils.union_data": {"unique_id": "macro.fivetran_utils.union_data", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "name": "union_data", "macro_sql": "{% macro union_data(table_identifier, database_variable, schema_variable, default_database, default_schema, default_variable, union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('union_data', 'fivetran_utils') (\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__union_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.874975, "supported_languages": null}, "macro.fivetran_utils.default__union_data": {"unique_id": "macro.fivetran_utils.default__union_data", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "name": "default__union_data", "macro_sql": "{% macro default__union_data(\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) %}\n\n{% if var(union_schema_variable, none) %}\n\n {% set relations = [] %}\n \n {% if var(union_schema_variable) is string %}\n {% set trimmed = var(union_schema_variable)|trim('[')|trim(']') %}\n {% set schemas = trimmed.split(',')|map('trim',\" \")|map('trim','\"')|map('trim',\"'\") %}\n {% else %}\n {% set schemas = var(union_schema_variable) %}\n {% endif %}\n\n {% for schema in var(union_schema_variable) %}\n {% set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else var(database_variable, default_database),\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else schema,\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n \n {% set relation_exists=relation is not none %}\n\n {% if relation_exists %}\n\n {% do relations.append(relation) %}\n \n {% endif %}\n\n {% endfor %}\n\n {{ dbt_utils.union_relations(relations) }}\n\n{% elif var(union_database_variable, none) %}\n\n {% set relations = [] %}\n\n {% for database in var(union_database_variable) %}\n\n {% set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else database,\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else var(schema_variable, default_schema),\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n\n {% set relation_exists=relation is not none %}\n\n {% if relation_exists %}\n\n {% do relations.append(relation) %}\n \n {% endif %}\n\n {% endfor %}\n\n {{ dbt_utils.union_relations(relations) }}\n\n{% else %}\n\n select * \n from {{ var(default_variable) }}\n\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.882499, "supported_languages": null}, "macro.fivetran_utils.dummy_coalesce_value": {"unique_id": "macro.fivetran_utils.dummy_coalesce_value", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/dummy_coalesce_value.sql", "original_file_path": "macros/dummy_coalesce_value.sql", "name": "dummy_coalesce_value", "macro_sql": "{% macro dummy_coalesce_value(column) %}\n\n{% set coalesce_value = {\n 'STRING': \"'DUMMY_STRING'\",\n 'BOOLEAN': 'null',\n 'INT': 999999999,\n 'FLOAT': 999999999.99,\n 'TIMESTAMP': 'cast(\"2099-12-31\" as timestamp)',\n 'DATE': 'cast(\"2099-12-31\" as date)',\n} %}\n\n{% if column.is_float() %}\n{{ return(coalesce_value['FLOAT']) }}\n\n{% elif column.is_numeric() %}\n{{ return(coalesce_value['INT']) }}\n\n{% elif column.is_string() %}\n{{ return(coalesce_value['STRING']) }}\n\n{% elif column.data_type|lower == 'boolean' %}\n{{ return(coalesce_value['BOOLEAN']) }}\n\n{% elif 'timestamp' in column.data_type|lower %}\n{{ return(coalesce_value['TIMESTAMP']) }}\n\n{% elif 'date' in column.data_type|lower %}\n{{ return(coalesce_value['DATE']) }}\n\n{% elif 'int' in column.data_type|lower %}\n{{ return(coalesce_value['INT']) }}\n\n{% endif %}\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.887088, "supported_languages": null}, "macro.fivetran_utils.array_agg": {"unique_id": "macro.fivetran_utils.array_agg", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "array_agg", "macro_sql": "{% macro array_agg(field_to_agg) -%}\n\n{{ adapter.dispatch('array_agg', 'fivetran_utils') (field_to_agg) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__array_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.88818, "supported_languages": null}, "macro.fivetran_utils.default__array_agg": {"unique_id": "macro.fivetran_utils.default__array_agg", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "default__array_agg", "macro_sql": "{% macro default__array_agg(field_to_agg) %}\n array_agg({{ field_to_agg }})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.888541, "supported_languages": null}, "macro.fivetran_utils.redshift__array_agg": {"unique_id": "macro.fivetran_utils.redshift__array_agg", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "redshift__array_agg", "macro_sql": "{% macro redshift__array_agg(field_to_agg) %}\n listagg({{ field_to_agg }}, ',')\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.888895, "supported_languages": null}, "macro.fivetran_utils.empty_variable_warning": {"unique_id": "macro.fivetran_utils.empty_variable_warning", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/empty_variable_warning.sql", "original_file_path": "macros/empty_variable_warning.sql", "name": "empty_variable_warning", "macro_sql": "{% macro empty_variable_warning(variable, downstream_model) %}\n\n{% if not var(variable) %}\n{{ log(\n \"\"\"\n Warning: You have passed an empty list to the \"\"\" ~ variable ~ \"\"\".\n As a result, you won't see the history of any columns in the \"\"\" ~ downstream_model ~ \"\"\" model.\n \"\"\",\n info=True\n) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.890385, "supported_languages": null}, "macro.fivetran_utils.enabled_vars_one_true": {"unique_id": "macro.fivetran_utils.enabled_vars_one_true", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/enabled_vars_one_true.sql", "original_file_path": "macros/enabled_vars_one_true.sql", "name": "enabled_vars_one_true", "macro_sql": "{% macro enabled_vars_one_true(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, False) == True %}\n {{ return(True) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(False) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.891885, "supported_languages": null}, "macro.github_source.get_issue_columns": {"unique_id": "macro.github_source.get_issue_columns", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_columns.sql", "original_file_path": "macros/get_issue_columns.sql", "name": "get_issue_columns", "macro_sql": "{% macro get_issue_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"body\", \"datatype\": dbt.type_string()},\n {\"name\": \"closed_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"locked\", \"datatype\": \"boolean\"},\n {\"name\": \"milestone_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"number\", \"datatype\": dbt.type_int()},\n {\"name\": \"pull_request\", \"datatype\": \"boolean\"},\n {\"name\": \"repository_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"state\", \"datatype\": dbt.type_string()},\n {\"name\": \"title\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"user_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.896749, "supported_languages": null}, "macro.github_source.get_issue_comment_columns": {"unique_id": "macro.github_source.get_issue_comment_columns", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_comment_columns.sql", "original_file_path": "macros/get_issue_comment_columns.sql", "name": "get_issue_comment_columns", "macro_sql": "{% macro get_issue_comment_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"body\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"user_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.899654, "supported_languages": null}, "macro.github_source.get_repository_columns": {"unique_id": "macro.github_source.get_repository_columns", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_repository_columns.sql", "original_file_path": "macros/get_repository_columns.sql", "name": "get_repository_columns", "macro_sql": "{% macro get_repository_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"archived\", \"datatype\": \"boolean\"},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"default_branch\", \"datatype\": dbt.type_string()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"fork\", \"datatype\": \"boolean\"},\n {\"name\": \"full_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"homepage\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"language\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"owner_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"private\", \"datatype\": \"boolean\"}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.904137, "supported_languages": null}, "macro.github_source.get_issue_merged_columns": {"unique_id": "macro.github_source.get_issue_merged_columns", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_merged_columns.sql", "original_file_path": "macros/get_issue_merged_columns.sql", "name": "get_issue_merged_columns", "macro_sql": "{% macro get_issue_merged_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"actor_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"commit_sha\", \"datatype\": dbt.type_string()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"merged_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.9064882, "supported_languages": null}, "macro.github_source.get_pull_request_review_columns": {"unique_id": "macro.github_source.get_pull_request_review_columns", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_pull_request_review_columns.sql", "original_file_path": "macros/get_pull_request_review_columns.sql", "name": "get_pull_request_review_columns", "macro_sql": "{% macro get_pull_request_review_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"body\", \"datatype\": dbt.type_string()},\n {\"name\": \"commit_sha\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"pull_request_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"state\", \"datatype\": dbt.type_string()},\n {\"name\": \"submitted_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"user_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.909672, "supported_languages": null}, "macro.github_source.get_team_columns": {"unique_id": "macro.github_source.get_team_columns", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_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_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"org_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"parent_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"privacy\", \"datatype\": dbt.type_string()},\n {\"name\": \"slug\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.912838, "supported_languages": null}, "macro.github_source.get_issue_assignee_columns": {"unique_id": "macro.github_source.get_issue_assignee_columns", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_assignee_columns.sql", "original_file_path": "macros/get_issue_assignee_columns.sql", "name": "get_issue_assignee_columns", "macro_sql": "{% macro get_issue_assignee_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"user_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.914619, "supported_languages": null}, "macro.github_source.get_user_columns": {"unique_id": "macro.github_source.get_user_columns", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_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\": \"company\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"login\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.916675, "supported_languages": null}, "macro.github_source.get_label_columns": {"unique_id": "macro.github_source.get_label_columns", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_label_columns.sql", "original_file_path": "macros/get_label_columns.sql", "name": "get_label_columns", "macro_sql": "{% macro get_label_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"color\", \"datatype\": dbt.type_string()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"is_default\", \"datatype\": \"boolean\"},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"url\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.919534, "supported_languages": null}, "macro.github_source.get_pull_request_columns": {"unique_id": "macro.github_source.get_pull_request_columns", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_pull_request_columns.sql", "original_file_path": "macros/get_pull_request_columns.sql", "name": "get_pull_request_columns", "macro_sql": "{% macro get_pull_request_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"base_label\", \"datatype\": dbt.type_string()},\n {\"name\": \"base_ref\", \"datatype\": dbt.type_string()},\n {\"name\": \"base_repo_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"base_sha\", \"datatype\": dbt.type_string()},\n {\"name\": \"base_user_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"head_label\", \"datatype\": dbt.type_string()},\n {\"name\": \"head_ref\", \"datatype\": dbt.type_string()},\n {\"name\": \"head_repo_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"head_sha\", \"datatype\": dbt.type_string()},\n {\"name\": \"head_user_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"merge_commit_sha\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.924618, "supported_languages": null}, "macro.github_source.get_requested_reviewer_history_columns": {"unique_id": "macro.github_source.get_requested_reviewer_history_columns", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_requested_reviewer_history_columns.sql", "original_file_path": "macros/get_requested_reviewer_history_columns.sql", "name": "get_requested_reviewer_history_columns", "macro_sql": "{% macro get_requested_reviewer_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"actor_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"pull_request_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"removed\", \"datatype\": \"boolean\"},\n {\"name\": \"requested_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.9272199, "supported_languages": null}, "macro.github_source.get_issue_closed_history_columns": {"unique_id": "macro.github_source.get_issue_closed_history_columns", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_closed_history_columns.sql", "original_file_path": "macros/get_issue_closed_history_columns.sql", "name": "get_issue_closed_history_columns", "macro_sql": "{% macro get_issue_closed_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"actor_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"closed\", \"datatype\": \"boolean\"},\n {\"name\": \"commit_sha\", \"datatype\": dbt.type_string()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.929792, "supported_languages": null}, "macro.github_source.get_repo_team_columns": {"unique_id": "macro.github_source.get_repo_team_columns", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_repo_team_columns.sql", "original_file_path": "macros/get_repo_team_columns.sql", "name": "get_repo_team_columns", "macro_sql": "{% macro get_repo_team_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"permission\", \"datatype\": dbt.type_string()},\n {\"name\": \"repository_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"team_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.931854, "supported_languages": null}, "macro.github_source.get_issue_label_columns": {"unique_id": "macro.github_source.get_issue_label_columns", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_label_columns.sql", "original_file_path": "macros/get_issue_label_columns.sql", "name": "get_issue_label_columns", "macro_sql": "{% macro get_issue_label_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"label_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.933633, "supported_languages": null}}, "docs": {"dbt.__overview__": {"unique_id": "dbt.__overview__", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "overview.md", "original_file_path": "docs/overview.md", "name": "__overview__", "block_contents": "### Welcome!\n\nWelcome to the auto-generated documentation for your dbt project!\n\n### Navigation\n\nYou can use the `Project` and `Database` navigation tabs on the left side of the window to explore the models\nin your project.\n\n#### Project Tab\nThe `Project` tab mirrors the directory structure of your dbt project. In this tab, you can see all of the\nmodels defined in your dbt project, as well as models imported from dbt packages.\n\n#### Database Tab\nThe `Database` tab also exposes your models, but in a format that looks more like a database explorer. This view\nshows relations (tables and views) grouped into database schemas. Note that ephemeral models are _not_ shown\nin this interface, as they do not exist in the database.\n\n### Graph Exploration\nYou can click the blue icon on the bottom-right corner of the page to view the lineage graph of your models.\n\nOn model pages, you'll see the immediate parents and children of the model you're exploring. By clicking the `Expand`\nbutton at the top-right of this lineage pane, you'll be able to see all of the models that are used to build,\nor are built from, the model you're exploring.\n\nOnce expanded, you'll be able to use the `--select` and `--exclude` model selection syntax to filter the\nmodels in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax).\n\nNote that you can also right-click on models to interactively filter and explore the graph.\n\n---\n\n### More information\n\n- [What is dbt](https://docs.getdbt.com/docs/introduction)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [dbt Community](https://www.getdbt.com/community/) for questions and discussion"}}, "exposures": {}, "metrics": {}, "selectors": {}, "disabled": {}, "parent_map": {"seed.github_integration_tests.github_pull_request_review_data": [], "seed.github_integration_tests.github_label_data": [], "seed.github_integration_tests.github_repository_data": [], "seed.github_integration_tests.github_issue_merged_data": [], "seed.github_integration_tests.github_issue_data": [], "seed.github_integration_tests.github_repo_team_data": [], "seed.github_integration_tests.github_requested_reviewer_history_data": [], "seed.github_integration_tests.github_issue_label_data": [], "seed.github_integration_tests.github_issue_comment_data": [], "seed.github_integration_tests.github_issue_assignee_data": [], "seed.github_integration_tests.github_issue_closed_history_data": [], "seed.github_integration_tests.github_pull_request_data": [], "seed.github_integration_tests.github_team_data": [], "seed.github_integration_tests.github_user_data": [], "model.github.github__weekly_metrics": ["model.github.github__daily_metrics"], "model.github.github__monthly_metrics": ["model.github.github__daily_metrics"], "model.github.github__quarterly_metrics": ["model.github.github__daily_metrics"], "model.github.github__pull_requests": ["model.github.int_github__issue_joined"], "model.github.github__daily_metrics": ["model.github.github__issues", "model.github.github__pull_requests"], "model.github.github__issues": ["model.github.int_github__issue_joined"], "model.github.int_github__pull_request_times": ["model.github_source.stg_github__issue", "model.github_source.stg_github__issue_merged", "model.github_source.stg_github__pull_request", "model.github_source.stg_github__pull_request_review", "model.github_source.stg_github__requested_reviewer_history"], "model.github.int_github__pull_request_reviewers": ["model.github_source.stg_github__pull_request_review", "model.github_source.stg_github__user"], "model.github.int_github__issue_label_joined": ["model.github_source.stg_github__issue_label", "model.github_source.stg_github__label"], "model.github.int_github__issue_joined": ["model.github.int_github__issue_assignees", "model.github.int_github__issue_comments", "model.github.int_github__issue_labels", "model.github.int_github__issue_open_length", "model.github.int_github__pull_request_reviewers", "model.github.int_github__pull_request_times", "model.github.int_github__repository_teams", "model.github_source.stg_github__issue", "model.github_source.stg_github__pull_request", "model.github_source.stg_github__user"], "model.github.int_github__issue_labels": ["model.github.int_github__issue_label_joined"], "model.github.int_github__issue_assignees": ["model.github_source.stg_github__issue_assignee", "model.github_source.stg_github__user"], "model.github.int_github__issue_comments": ["model.github_source.stg_github__issue_comment"], "model.github.int_github__issue_open_length": ["model.github_source.stg_github__issue", "model.github_source.stg_github__issue_closed_history"], "model.github.int_github__repository_teams": ["model.github_source.stg_github__repo_team", "model.github_source.stg_github__repository", "model.github_source.stg_github__team"], "model.github_source.stg_github__issue_comment": ["model.github_source.stg_github__issue_comment_tmp", "model.github_source.stg_github__issue_comment_tmp"], "model.github_source.stg_github__requested_reviewer_history": ["model.github_source.stg_github__requested_reviewer_history_tmp", "model.github_source.stg_github__requested_reviewer_history_tmp"], "model.github_source.stg_github__issue_label": ["model.github_source.stg_github__issue_label_tmp", "model.github_source.stg_github__issue_label_tmp"], "model.github_source.stg_github__issue_merged": ["model.github_source.stg_github__issue_merged_tmp", "model.github_source.stg_github__issue_merged_tmp"], "model.github_source.stg_github__issue_closed_history": ["model.github_source.stg_github__issue_closed_history_tmp", "model.github_source.stg_github__issue_closed_history_tmp"], "model.github_source.stg_github__issue_assignee": ["model.github_source.stg_github__issue_assignee_tmp", "model.github_source.stg_github__issue_assignee_tmp"], "model.github_source.stg_github__repository": ["model.github_source.stg_github__repository_tmp", "model.github_source.stg_github__repository_tmp"], "model.github_source.stg_github__user": ["model.github_source.stg_github__user_tmp", "model.github_source.stg_github__user_tmp"], "model.github_source.stg_github__pull_request_review": ["model.github_source.stg_github__pull_request_review_tmp", "model.github_source.stg_github__pull_request_review_tmp"], "model.github_source.stg_github__repo_team": ["model.github_source.stg_github__repo_team_tmp", "model.github_source.stg_github__repo_team_tmp"], "model.github_source.stg_github__label": ["model.github_source.stg_github__label_tmp", "model.github_source.stg_github__label_tmp"], "model.github_source.stg_github__issue": ["model.github_source.stg_github__issue_tmp", "model.github_source.stg_github__issue_tmp"], "model.github_source.stg_github__team": ["model.github_source.stg_github__team_tmp", "model.github_source.stg_github__team_tmp"], "model.github_source.stg_github__pull_request": ["model.github_source.stg_github__pull_request_tmp", "model.github_source.stg_github__pull_request_tmp"], "model.github_source.stg_github__repository_tmp": ["source.github_source.github.repository"], "model.github_source.stg_github__label_tmp": ["source.github_source.github.label"], "model.github_source.stg_github__requested_reviewer_history_tmp": ["source.github_source.github.requested_reviewer_history"], "model.github_source.stg_github__issue_comment_tmp": ["source.github_source.github.issue_comment"], "model.github_source.stg_github__pull_request_review_tmp": ["source.github_source.github.pull_request_review"], "model.github_source.stg_github__issue_label_tmp": ["source.github_source.github.issue_label"], "model.github_source.stg_github__team_tmp": ["source.github_source.github.team"], "model.github_source.stg_github__pull_request_tmp": ["source.github_source.github.pull_request"], "model.github_source.stg_github__issue_merged_tmp": ["source.github_source.github.issue_merged"], "model.github_source.stg_github__user_tmp": ["source.github_source.github.user"], "model.github_source.stg_github__issue_closed_history_tmp": ["source.github_source.github.issue_closed_history"], "model.github_source.stg_github__issue_assignee_tmp": ["source.github_source.github.issue_assignee"], "model.github_source.stg_github__issue_tmp": ["source.github_source.github.issue"], "model.github_source.stg_github__repo_team_tmp": ["source.github_source.github.repo_team"], "test.github.unique_github__issues_issue_id.6723b9b1db": ["model.github.github__issues"], "test.github.not_null_github__issues_issue_id.fed0631e25": ["model.github.github__issues"], "test.github.unique_github__pull_requests_issue_id.ce23997907": ["model.github.github__pull_requests"], "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f": ["model.github.github__pull_requests"], "test.github.unique_github__daily_metrics_day.f98cab9456": ["model.github.github__daily_metrics"], "test.github.not_null_github__daily_metrics_day.647e494434": ["model.github.github__daily_metrics"], "test.github.unique_github__weekly_metrics_week.6794858a8e": ["model.github.github__weekly_metrics"], "test.github.not_null_github__weekly_metrics_week.4b0b928243": ["model.github.github__weekly_metrics"], "test.github.unique_github__monthly_metrics_month.3076284fbb": ["model.github.github__monthly_metrics"], "test.github.not_null_github__monthly_metrics_month.9e4fba84df": ["model.github.github__monthly_metrics"], "test.github.unique_github__quarterly_metrics_quarter.9165a921c1": ["model.github.github__quarterly_metrics"], "test.github.not_null_github__quarterly_metrics_quarter.92394d46dc": ["model.github.github__quarterly_metrics"], "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4": ["model.github_source.stg_github__issue_assignee"], "test.github_source.not_null_stg_github__label_label_id.9f07379974": ["model.github_source.stg_github__label"], "test.github_source.unique_stg_github__label_label_id.74d3c21466": ["model.github_source.stg_github__label"], "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d": ["model.github_source.stg_github__issue_closed_history"], "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a": ["model.github_source.stg_github__issue_comment"], "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f": ["model.github_source.stg_github__issue_comment"], "test.github_source.unique_stg_github__issue_issue_id.84891aeece": ["model.github_source.stg_github__issue"], "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7": ["model.github_source.stg_github__issue"], "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508": ["model.github_source.stg_github__pull_request_review"], "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790": ["model.github_source.stg_github__pull_request_review"], "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa": ["model.github_source.stg_github__pull_request"], "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71": ["model.github_source.stg_github__pull_request"], "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503": ["model.github_source.stg_github__repo_team"], "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c": ["model.github_source.stg_github__repo_team"], "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d": ["model.github_source.stg_github__repository"], "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f": ["model.github_source.stg_github__repository"], "test.github_source.unique_stg_github__team_team_id.94e9716ab4": ["model.github_source.stg_github__team"], "test.github_source.not_null_stg_github__team_team_id.440aefe7a7": ["model.github_source.stg_github__team"], "test.github_source.unique_stg_github__user_user_id.5c1a00cd90": ["model.github_source.stg_github__user"], "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b": ["model.github_source.stg_github__user"], "source.github_source.github.issue_assignee": [], "source.github_source.github.label": [], "source.github_source.github.issue_closed_history": [], "source.github_source.github.issue_label": [], "source.github_source.github.issue_comment": [], "source.github_source.github.issue_merged": [], "source.github_source.github.issue": [], "source.github_source.github.pull_request_review": [], "source.github_source.github.pull_request": [], "source.github_source.github.repo_team": [], "source.github_source.github.repository": [], "source.github_source.github.requested_reviewer_history": [], "source.github_source.github.team": [], "source.github_source.github.user": []}, "child_map": {"seed.github_integration_tests.github_pull_request_review_data": [], "seed.github_integration_tests.github_label_data": [], "seed.github_integration_tests.github_repository_data": [], "seed.github_integration_tests.github_issue_merged_data": [], "seed.github_integration_tests.github_issue_data": [], "seed.github_integration_tests.github_repo_team_data": [], "seed.github_integration_tests.github_requested_reviewer_history_data": [], "seed.github_integration_tests.github_issue_label_data": [], "seed.github_integration_tests.github_issue_comment_data": [], "seed.github_integration_tests.github_issue_assignee_data": [], "seed.github_integration_tests.github_issue_closed_history_data": [], "seed.github_integration_tests.github_pull_request_data": [], "seed.github_integration_tests.github_team_data": [], "seed.github_integration_tests.github_user_data": [], "model.github.github__weekly_metrics": ["test.github.not_null_github__weekly_metrics_week.4b0b928243", "test.github.unique_github__weekly_metrics_week.6794858a8e"], "model.github.github__monthly_metrics": ["test.github.not_null_github__monthly_metrics_month.9e4fba84df", "test.github.unique_github__monthly_metrics_month.3076284fbb"], "model.github.github__quarterly_metrics": ["test.github.not_null_github__quarterly_metrics_quarter.92394d46dc", "test.github.unique_github__quarterly_metrics_quarter.9165a921c1"], "model.github.github__pull_requests": ["model.github.github__daily_metrics", "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f", "test.github.unique_github__pull_requests_issue_id.ce23997907"], "model.github.github__daily_metrics": ["model.github.github__monthly_metrics", "model.github.github__quarterly_metrics", "model.github.github__weekly_metrics", "test.github.not_null_github__daily_metrics_day.647e494434", "test.github.unique_github__daily_metrics_day.f98cab9456"], "model.github.github__issues": ["model.github.github__daily_metrics", "test.github.not_null_github__issues_issue_id.fed0631e25", "test.github.unique_github__issues_issue_id.6723b9b1db"], "model.github.int_github__pull_request_times": ["model.github.int_github__issue_joined"], "model.github.int_github__pull_request_reviewers": ["model.github.int_github__issue_joined"], "model.github.int_github__issue_label_joined": ["model.github.int_github__issue_labels"], "model.github.int_github__issue_joined": ["model.github.github__issues", "model.github.github__pull_requests"], "model.github.int_github__issue_labels": ["model.github.int_github__issue_joined"], "model.github.int_github__issue_assignees": ["model.github.int_github__issue_joined"], "model.github.int_github__issue_comments": ["model.github.int_github__issue_joined"], "model.github.int_github__issue_open_length": ["model.github.int_github__issue_joined"], "model.github.int_github__repository_teams": ["model.github.int_github__issue_joined"], "model.github_source.stg_github__issue_comment": ["model.github.int_github__issue_comments", "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f", "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a"], "model.github_source.stg_github__requested_reviewer_history": ["model.github.int_github__pull_request_times"], "model.github_source.stg_github__issue_label": ["model.github.int_github__issue_label_joined"], "model.github_source.stg_github__issue_merged": ["model.github.int_github__pull_request_times"], "model.github_source.stg_github__issue_closed_history": ["model.github.int_github__issue_open_length", "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d"], "model.github_source.stg_github__issue_assignee": ["model.github.int_github__issue_assignees", "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4"], "model.github_source.stg_github__repository": ["model.github.int_github__repository_teams", "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f", "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d"], "model.github_source.stg_github__user": ["model.github.int_github__issue_assignees", "model.github.int_github__issue_joined", "model.github.int_github__pull_request_reviewers", "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b", "test.github_source.unique_stg_github__user_user_id.5c1a00cd90"], "model.github_source.stg_github__pull_request_review": ["model.github.int_github__pull_request_reviewers", "model.github.int_github__pull_request_times", "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790", "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508"], "model.github_source.stg_github__repo_team": ["model.github.int_github__repository_teams", "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503", "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c"], "model.github_source.stg_github__label": ["model.github.int_github__issue_label_joined", "test.github_source.not_null_stg_github__label_label_id.9f07379974", "test.github_source.unique_stg_github__label_label_id.74d3c21466"], "model.github_source.stg_github__issue": ["model.github.int_github__issue_joined", "model.github.int_github__issue_open_length", "model.github.int_github__pull_request_times", "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7", "test.github_source.unique_stg_github__issue_issue_id.84891aeece"], "model.github_source.stg_github__team": ["model.github.int_github__repository_teams", "test.github_source.not_null_stg_github__team_team_id.440aefe7a7", "test.github_source.unique_stg_github__team_team_id.94e9716ab4"], "model.github_source.stg_github__pull_request": ["model.github.int_github__issue_joined", "model.github.int_github__pull_request_times", "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71", "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa"], "model.github_source.stg_github__repository_tmp": ["model.github_source.stg_github__repository", "model.github_source.stg_github__repository"], "model.github_source.stg_github__label_tmp": ["model.github_source.stg_github__label", "model.github_source.stg_github__label"], "model.github_source.stg_github__requested_reviewer_history_tmp": ["model.github_source.stg_github__requested_reviewer_history", "model.github_source.stg_github__requested_reviewer_history"], "model.github_source.stg_github__issue_comment_tmp": ["model.github_source.stg_github__issue_comment", "model.github_source.stg_github__issue_comment"], "model.github_source.stg_github__pull_request_review_tmp": ["model.github_source.stg_github__pull_request_review", "model.github_source.stg_github__pull_request_review"], "model.github_source.stg_github__issue_label_tmp": ["model.github_source.stg_github__issue_label", "model.github_source.stg_github__issue_label"], "model.github_source.stg_github__team_tmp": ["model.github_source.stg_github__team", "model.github_source.stg_github__team"], "model.github_source.stg_github__pull_request_tmp": ["model.github_source.stg_github__pull_request", "model.github_source.stg_github__pull_request"], "model.github_source.stg_github__issue_merged_tmp": ["model.github_source.stg_github__issue_merged", "model.github_source.stg_github__issue_merged"], "model.github_source.stg_github__user_tmp": ["model.github_source.stg_github__user", "model.github_source.stg_github__user"], "model.github_source.stg_github__issue_closed_history_tmp": ["model.github_source.stg_github__issue_closed_history", "model.github_source.stg_github__issue_closed_history"], "model.github_source.stg_github__issue_assignee_tmp": ["model.github_source.stg_github__issue_assignee", "model.github_source.stg_github__issue_assignee"], "model.github_source.stg_github__issue_tmp": ["model.github_source.stg_github__issue", "model.github_source.stg_github__issue"], "model.github_source.stg_github__repo_team_tmp": ["model.github_source.stg_github__repo_team", "model.github_source.stg_github__repo_team"], "test.github.unique_github__issues_issue_id.6723b9b1db": [], "test.github.not_null_github__issues_issue_id.fed0631e25": [], "test.github.unique_github__pull_requests_issue_id.ce23997907": [], "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f": [], "test.github.unique_github__daily_metrics_day.f98cab9456": [], "test.github.not_null_github__daily_metrics_day.647e494434": [], "test.github.unique_github__weekly_metrics_week.6794858a8e": [], "test.github.not_null_github__weekly_metrics_week.4b0b928243": [], "test.github.unique_github__monthly_metrics_month.3076284fbb": [], "test.github.not_null_github__monthly_metrics_month.9e4fba84df": [], "test.github.unique_github__quarterly_metrics_quarter.9165a921c1": [], "test.github.not_null_github__quarterly_metrics_quarter.92394d46dc": [], "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4": [], "test.github_source.not_null_stg_github__label_label_id.9f07379974": [], "test.github_source.unique_stg_github__label_label_id.74d3c21466": [], "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d": [], "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a": [], "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f": [], "test.github_source.unique_stg_github__issue_issue_id.84891aeece": [], "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7": [], "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508": [], "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790": [], "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa": [], "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71": [], "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503": [], "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c": [], "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d": [], "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f": [], "test.github_source.unique_stg_github__team_team_id.94e9716ab4": [], "test.github_source.not_null_stg_github__team_team_id.440aefe7a7": [], "test.github_source.unique_stg_github__user_user_id.5c1a00cd90": [], "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b": [], "source.github_source.github.issue_assignee": ["model.github_source.stg_github__issue_assignee_tmp"], "source.github_source.github.label": ["model.github_source.stg_github__label_tmp"], "source.github_source.github.issue_closed_history": ["model.github_source.stg_github__issue_closed_history_tmp"], "source.github_source.github.issue_label": ["model.github_source.stg_github__issue_label_tmp"], "source.github_source.github.issue_comment": ["model.github_source.stg_github__issue_comment_tmp"], "source.github_source.github.issue_merged": ["model.github_source.stg_github__issue_merged_tmp"], "source.github_source.github.issue": ["model.github_source.stg_github__issue_tmp"], "source.github_source.github.pull_request_review": ["model.github_source.stg_github__pull_request_review_tmp"], "source.github_source.github.pull_request": ["model.github_source.stg_github__pull_request_tmp"], "source.github_source.github.repo_team": ["model.github_source.stg_github__repo_team_tmp"], "source.github_source.github.repository": ["model.github_source.stg_github__repository_tmp"], "source.github_source.github.requested_reviewer_history": ["model.github_source.stg_github__requested_reviewer_history_tmp"], "source.github_source.github.team": ["model.github_source.stg_github__team_tmp"], "source.github_source.github.user": ["model.github_source.stg_github__user_tmp"]}} \ No newline at end of file diff --git a/docs/run_results.json b/docs/run_results.json index e756900..8a4ad35 100644 --- a/docs/run_results.json +++ b/docs/run_results.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v4.json", "dbt_version": "1.3.0", "generated_at": "2022-11-01T00:40:18.609937Z", "invocation_id": "581c3815-414c-47e3-91e9-f6b3f49621e9", "env": {}}, "results": [{"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.571082Z", "completed_at": "2022-11-01T00:40:13.578373Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.578690Z", "completed_at": "2022-11-01T00:40:13.578715Z"}], "thread_id": "Thread-1", "execution_time": 0.008991003036499023, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_assignee_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.580365Z", "completed_at": "2022-11-01T00:40:13.583873Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.584014Z", "completed_at": "2022-11-01T00:40:13.584020Z"}], "thread_id": "Thread-1", "execution_time": 0.00457000732421875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_closed_history_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.584924Z", "completed_at": "2022-11-01T00:40:13.591818Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.592040Z", "completed_at": "2022-11-01T00:40:13.592048Z"}], "thread_id": "Thread-1", "execution_time": 0.0077667236328125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_comment_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.593272Z", "completed_at": "2022-11-01T00:40:13.596521Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.596704Z", "completed_at": "2022-11-01T00:40:13.596716Z"}], "thread_id": "Thread-1", "execution_time": 0.0042760372161865234, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_label_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.597768Z", "completed_at": "2022-11-01T00:40:13.600909Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.601092Z", "completed_at": "2022-11-01T00:40:13.601097Z"}], "thread_id": "Thread-1", "execution_time": 0.004021167755126953, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_merged_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.602072Z", "completed_at": "2022-11-01T00:40:13.604759Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.604938Z", "completed_at": "2022-11-01T00:40:13.604943Z"}], "thread_id": "Thread-1", "execution_time": 0.0034749507904052734, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.605822Z", "completed_at": "2022-11-01T00:40:13.608400Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.608558Z", "completed_at": "2022-11-01T00:40:13.608562Z"}], "thread_id": "Thread-1", "execution_time": 0.0032999515533447266, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__label_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.609405Z", "completed_at": "2022-11-01T00:40:13.612007Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.612153Z", "completed_at": "2022-11-01T00:40:13.612157Z"}], "thread_id": "Thread-1", "execution_time": 0.003298044204711914, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__pull_request_review_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.612923Z", "completed_at": "2022-11-01T00:40:13.615990Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.616136Z", "completed_at": "2022-11-01T00:40:13.616140Z"}], "thread_id": "Thread-1", "execution_time": 0.003735780715942383, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__pull_request_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.616925Z", "completed_at": "2022-11-01T00:40:13.619516Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.619660Z", "completed_at": "2022-11-01T00:40:13.619664Z"}], "thread_id": "Thread-1", "execution_time": 0.003245830535888672, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__repo_team_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.620428Z", "completed_at": "2022-11-01T00:40:13.622747Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.622894Z", "completed_at": "2022-11-01T00:40:13.622898Z"}], "thread_id": "Thread-1", "execution_time": 0.002978086471557617, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__repository_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.623658Z", "completed_at": "2022-11-01T00:40:13.625786Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.625917Z", "completed_at": "2022-11-01T00:40:13.625921Z"}], "thread_id": "Thread-1", "execution_time": 0.0027489662170410156, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__requested_reviewer_history_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.626608Z", "completed_at": "2022-11-01T00:40:13.628740Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.628871Z", "completed_at": "2022-11-01T00:40:13.628874Z"}], "thread_id": "Thread-1", "execution_time": 0.0027260780334472656, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__team_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.629572Z", "completed_at": "2022-11-01T00:40:13.631678Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.631804Z", "completed_at": "2022-11-01T00:40:13.631810Z"}], "thread_id": "Thread-1", "execution_time": 0.0027060508728027344, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__user_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.632507Z", "completed_at": "2022-11-01T00:40:13.634246Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.634367Z", "completed_at": "2022-11-01T00:40:13.634371Z"}], "thread_id": "Thread-1", "execution_time": 0.0023381710052490234, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_assignee_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.635060Z", "completed_at": "2022-11-01T00:40:13.636080Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.636194Z", "completed_at": "2022-11-01T00:40:13.636198Z"}], "thread_id": "Thread-1", "execution_time": 0.0016369819641113281, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_closed_history_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.636880Z", "completed_at": "2022-11-01T00:40:13.637859Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.637967Z", "completed_at": "2022-11-01T00:40:13.637971Z"}], "thread_id": "Thread-1", "execution_time": 0.0015239715576171875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_comment_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.638606Z", "completed_at": "2022-11-01T00:40:13.639628Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.639734Z", "completed_at": "2022-11-01T00:40:13.639737Z"}], "thread_id": "Thread-1", "execution_time": 0.0015606880187988281, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.640360Z", "completed_at": "2022-11-01T00:40:13.641322Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.641438Z", "completed_at": "2022-11-01T00:40:13.641441Z"}], "thread_id": "Thread-1", "execution_time": 0.0015130043029785156, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_label_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.642061Z", "completed_at": "2022-11-01T00:40:13.643068Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.643175Z", "completed_at": "2022-11-01T00:40:13.643178Z"}], "thread_id": "Thread-1", "execution_time": 0.00154876708984375, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_merged_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.643780Z", "completed_at": "2022-11-01T00:40:13.644763Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.644870Z", "completed_at": "2022-11-01T00:40:13.644872Z"}], "thread_id": "Thread-1", "execution_time": 0.0015082359313964844, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_label_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.645483Z", "completed_at": "2022-11-01T00:40:13.647068Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.647177Z", "completed_at": "2022-11-01T00:40:13.647180Z"}], "thread_id": "Thread-1", "execution_time": 0.0021271705627441406, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_pull_request_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.647747Z", "completed_at": "2022-11-01T00:40:13.648667Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.648776Z", "completed_at": "2022-11-01T00:40:13.648778Z"}], "thread_id": "Thread-1", "execution_time": 0.001438140869140625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_pull_request_review_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.649334Z", "completed_at": "2022-11-01T00:40:13.650279Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.650387Z", "completed_at": "2022-11-01T00:40:13.650389Z"}], "thread_id": "Thread-1", "execution_time": 0.00152587890625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_repo_team_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.651023Z", "completed_at": "2022-11-01T00:40:13.652005Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.652116Z", "completed_at": "2022-11-01T00:40:13.652119Z"}], "thread_id": "Thread-1", "execution_time": 0.0015091896057128906, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_repository_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.652681Z", "completed_at": "2022-11-01T00:40:13.653637Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.653746Z", "completed_at": "2022-11-01T00:40:13.653749Z"}], "thread_id": "Thread-1", "execution_time": 0.0014758110046386719, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_requested_reviewer_history_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.654305Z", "completed_at": "2022-11-01T00:40:13.655262Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.655380Z", "completed_at": "2022-11-01T00:40:13.655383Z"}], "thread_id": "Thread-1", "execution_time": 0.001486063003540039, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_team_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.655943Z", "completed_at": "2022-11-01T00:40:13.657464Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.657574Z", "completed_at": "2022-11-01T00:40:13.657576Z"}], "thread_id": "Thread-1", "execution_time": 0.0020427703857421875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_user_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.658138Z", "completed_at": "2022-11-01T00:40:13.951350Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:13.951678Z", "completed_at": "2022-11-01T00:40:13.951691Z"}], "thread_id": "Thread-1", "execution_time": 0.2942469120025635, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_assignee"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:13.953443Z", "completed_at": "2022-11-01T00:40:14.197304Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:14.197606Z", "completed_at": "2022-11-01T00:40:14.197626Z"}], "thread_id": "Thread-1", "execution_time": 0.24542617797851562, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_closed_history"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:14.199441Z", "completed_at": "2022-11-01T00:40:14.616456Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:14.616689Z", "completed_at": "2022-11-01T00:40:14.616700Z"}], "thread_id": "Thread-1", "execution_time": 0.41841793060302734, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_comment"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:14.618206Z", "completed_at": "2022-11-01T00:40:14.967416Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:14.967790Z", "completed_at": "2022-11-01T00:40:14.967809Z"}], "thread_id": "Thread-1", "execution_time": 0.3507547378540039, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_label"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:14.969855Z", "completed_at": "2022-11-01T00:40:15.324537Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:15.324729Z", "completed_at": "2022-11-01T00:40:15.324744Z"}], "thread_id": "Thread-1", "execution_time": 0.35609006881713867, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_merged"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:15.325792Z", "completed_at": "2022-11-01T00:40:15.732804Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:15.733083Z", "completed_at": "2022-11-01T00:40:15.733099Z"}], "thread_id": "Thread-1", "execution_time": 0.40821099281311035, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:15.734927Z", "completed_at": "2022-11-01T00:40:15.994527Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:15.994739Z", "completed_at": "2022-11-01T00:40:15.994752Z"}], "thread_id": "Thread-1", "execution_time": 0.26086997985839844, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__label"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:15.995805Z", "completed_at": "2022-11-01T00:40:16.366730Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:16.367017Z", "completed_at": "2022-11-01T00:40:16.367033Z"}], "thread_id": "Thread-1", "execution_time": 0.37206196784973145, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__pull_request_review"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:16.368722Z", "completed_at": "2022-11-01T00:40:16.698972Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:16.699269Z", "completed_at": "2022-11-01T00:40:16.699286Z"}], "thread_id": "Thread-1", "execution_time": 0.3317391872406006, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__pull_request"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:16.701094Z", "completed_at": "2022-11-01T00:40:17.084362Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:17.084744Z", "completed_at": "2022-11-01T00:40:17.084763Z"}], "thread_id": "Thread-1", "execution_time": 0.3849673271179199, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__repo_team"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:17.087013Z", "completed_at": "2022-11-01T00:40:17.405737Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:17.406007Z", "completed_at": "2022-11-01T00:40:17.406027Z"}], "thread_id": "Thread-1", "execution_time": 0.32043027877807617, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__repository"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:17.407659Z", "completed_at": "2022-11-01T00:40:17.705030Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:17.705429Z", "completed_at": "2022-11-01T00:40:17.705445Z"}], "thread_id": "Thread-1", "execution_time": 0.29900479316711426, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__requested_reviewer_history"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:17.707456Z", "completed_at": "2022-11-01T00:40:18.130219Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.130541Z", "completed_at": "2022-11-01T00:40:18.130562Z"}], "thread_id": "Thread-1", "execution_time": 0.42454099655151367, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__team"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.132548Z", "completed_at": "2022-11-01T00:40:18.357974Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.358287Z", "completed_at": "2022-11-01T00:40:18.358301Z"}], "thread_id": "Thread-1", "execution_time": 0.22687911987304688, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__user"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.360072Z", "completed_at": "2022-11-01T00:40:18.374253Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.374460Z", "completed_at": "2022-11-01T00:40:18.374467Z"}], "thread_id": "Thread-1", "execution_time": 0.015462160110473633, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.375572Z", "completed_at": "2022-11-01T00:40:18.385335Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.385503Z", "completed_at": "2022-11-01T00:40:18.385508Z"}], "thread_id": "Thread-1", "execution_time": 0.010631799697875977, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.389783Z", "completed_at": "2022-11-01T00:40:18.395664Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.395822Z", "completed_at": "2022-11-01T00:40:18.395827Z"}], "thread_id": "Thread-1", "execution_time": 0.00658416748046875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.396599Z", "completed_at": "2022-11-01T00:40:18.400741Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.400888Z", "completed_at": "2022-11-01T00:40:18.400892Z"}], "thread_id": "Thread-1", "execution_time": 0.00482487678527832, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.409030Z", "completed_at": "2022-11-01T00:40:18.412371Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.412506Z", "completed_at": "2022-11-01T00:40:18.412510Z"}], "thread_id": "Thread-1", "execution_time": 0.003959178924560547, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.413187Z", "completed_at": "2022-11-01T00:40:18.454000Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.454137Z", "completed_at": "2022-11-01T00:40:18.454142Z"}], "thread_id": "Thread-1", "execution_time": 0.04142189025878906, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__issue_issue_id.84891aeece"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.458004Z", "completed_at": "2022-11-01T00:40:18.460441Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.460564Z", "completed_at": "2022-11-01T00:40:18.460569Z"}], "thread_id": "Thread-1", "execution_time": 0.0030269622802734375, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__label_label_id.9f07379974"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.461214Z", "completed_at": "2022-11-01T00:40:18.463475Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.463598Z", "completed_at": "2022-11-01T00:40:18.463601Z"}], "thread_id": "Thread-1", "execution_time": 0.002821683883666992, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__label_label_id.74d3c21466"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.464231Z", "completed_at": "2022-11-01T00:40:18.466552Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.466672Z", "completed_at": "2022-11-01T00:40:18.466676Z"}], "thread_id": "Thread-1", "execution_time": 0.002875804901123047, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.467296Z", "completed_at": "2022-11-01T00:40:18.469546Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.469661Z", "completed_at": "2022-11-01T00:40:18.469664Z"}], "thread_id": "Thread-1", "execution_time": 0.0028018951416015625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.470324Z", "completed_at": "2022-11-01T00:40:18.473398Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.473523Z", "completed_at": "2022-11-01T00:40:18.473526Z"}], "thread_id": "Thread-1", "execution_time": 0.0036652088165283203, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.474168Z", "completed_at": "2022-11-01T00:40:18.476615Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.476742Z", "completed_at": "2022-11-01T00:40:18.476746Z"}], "thread_id": "Thread-1", "execution_time": 0.003025054931640625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.477439Z", "completed_at": "2022-11-01T00:40:18.480005Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.480156Z", "completed_at": "2022-11-01T00:40:18.480160Z"}], "thread_id": "Thread-1", "execution_time": 0.0032019615173339844, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.480838Z", "completed_at": "2022-11-01T00:40:18.483176Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.483298Z", "completed_at": "2022-11-01T00:40:18.483302Z"}], "thread_id": "Thread-1", "execution_time": 0.002920866012573242, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.483923Z", "completed_at": "2022-11-01T00:40:18.486273Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.486405Z", "completed_at": "2022-11-01T00:40:18.486408Z"}], "thread_id": "Thread-1", "execution_time": 0.0029230117797851562, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.487038Z", "completed_at": "2022-11-01T00:40:18.489284Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.489404Z", "completed_at": "2022-11-01T00:40:18.489407Z"}], "thread_id": "Thread-1", "execution_time": 0.0027990341186523438, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.502409Z", "completed_at": "2022-11-01T00:40:18.504739Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.504861Z", "completed_at": "2022-11-01T00:40:18.504865Z"}], "thread_id": "Thread-1", "execution_time": 0.002892017364501953, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__team_team_id.440aefe7a7"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.505484Z", "completed_at": "2022-11-01T00:40:18.507762Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.507897Z", "completed_at": "2022-11-01T00:40:18.507900Z"}], "thread_id": "Thread-1", "execution_time": 0.002856016159057617, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__team_team_id.94e9716ab4"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.515762Z", "completed_at": "2022-11-01T00:40:18.518809Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.518931Z", "completed_at": "2022-11-01T00:40:18.518934Z"}], "thread_id": "Thread-1", "execution_time": 0.003622293472290039, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.519589Z", "completed_at": "2022-11-01T00:40:18.521882Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.522018Z", "completed_at": "2022-11-01T00:40:18.522022Z"}], "thread_id": "Thread-1", "execution_time": 0.002873659133911133, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__user_user_id.5c1a00cd90"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.546657Z", "completed_at": "2022-11-01T00:40:18.552787Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.552915Z", "completed_at": "2022-11-01T00:40:18.552919Z"}], "thread_id": "Thread-1", "execution_time": 0.006721019744873047, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__issues"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.553674Z", "completed_at": "2022-11-01T00:40:18.557005Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.557147Z", "completed_at": "2022-11-01T00:40:18.557151Z"}], "thread_id": "Thread-1", "execution_time": 0.003959178924560547, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__pull_requests"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.557918Z", "completed_at": "2022-11-01T00:40:18.560357Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.560481Z", "completed_at": "2022-11-01T00:40:18.560485Z"}], "thread_id": "Thread-1", "execution_time": 0.0030171871185302734, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__issues_issue_id.fed0631e25"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.561126Z", "completed_at": "2022-11-01T00:40:18.563368Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.563491Z", "completed_at": "2022-11-01T00:40:18.563494Z"}], "thread_id": "Thread-1", "execution_time": 0.002804994583129883, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__issues_issue_id.6723b9b1db"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.564112Z", "completed_at": "2022-11-01T00:40:18.568488Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.568616Z", "completed_at": "2022-11-01T00:40:18.568619Z"}], "thread_id": "Thread-1", "execution_time": 0.004947185516357422, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__daily_metrics"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.569356Z", "completed_at": "2022-11-01T00:40:18.572407Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.572551Z", "completed_at": "2022-11-01T00:40:18.572555Z"}], "thread_id": "Thread-1", "execution_time": 0.0036606788635253906, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.573191Z", "completed_at": "2022-11-01T00:40:18.575461Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.575582Z", "completed_at": "2022-11-01T00:40:18.575585Z"}], "thread_id": "Thread-1", "execution_time": 0.002830028533935547, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__pull_requests_issue_id.ce23997907"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.576197Z", "completed_at": "2022-11-01T00:40:18.578404Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.578522Z", "completed_at": "2022-11-01T00:40:18.578526Z"}], "thread_id": "Thread-1", "execution_time": 0.0027611255645751953, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__monthly_metrics"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.579220Z", "completed_at": "2022-11-01T00:40:18.581158Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.581276Z", "completed_at": "2022-11-01T00:40:18.581280Z"}], "thread_id": "Thread-1", "execution_time": 0.002516031265258789, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__quarterly_metrics"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.581948Z", "completed_at": "2022-11-01T00:40:18.583850Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.583965Z", "completed_at": "2022-11-01T00:40:18.583969Z"}], "thread_id": "Thread-1", "execution_time": 0.0024518966674804688, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__weekly_metrics"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.584621Z", "completed_at": "2022-11-01T00:40:18.586912Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.587032Z", "completed_at": "2022-11-01T00:40:18.587035Z"}], "thread_id": "Thread-1", "execution_time": 0.002852201461791992, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__daily_metrics_day.647e494434"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.587656Z", "completed_at": "2022-11-01T00:40:18.590537Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.590659Z", "completed_at": "2022-11-01T00:40:18.590662Z"}], "thread_id": "Thread-1", "execution_time": 0.0034427642822265625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__daily_metrics_day.f98cab9456"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.591271Z", "completed_at": "2022-11-01T00:40:18.593578Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.593699Z", "completed_at": "2022-11-01T00:40:18.593702Z"}], "thread_id": "Thread-1", "execution_time": 0.0028600692749023438, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__monthly_metrics_month.9e4fba84df"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.594305Z", "completed_at": "2022-11-01T00:40:18.596497Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.596614Z", "completed_at": "2022-11-01T00:40:18.596618Z"}], "thread_id": "Thread-1", "execution_time": 0.0027420520782470703, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__monthly_metrics_month.3076284fbb"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.597225Z", "completed_at": "2022-11-01T00:40:18.599497Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.599615Z", "completed_at": "2022-11-01T00:40:18.599619Z"}], "thread_id": "Thread-1", "execution_time": 0.0028247833251953125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__quarterly_metrics_quarter.92394d46dc"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.600221Z", "completed_at": "2022-11-01T00:40:18.602426Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.602545Z", "completed_at": "2022-11-01T00:40:18.602549Z"}], "thread_id": "Thread-1", "execution_time": 0.002756834030151367, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__quarterly_metrics_quarter.9165a921c1"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.603161Z", "completed_at": "2022-11-01T00:40:18.605433Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.605552Z", "completed_at": "2022-11-01T00:40:18.605556Z"}], "thread_id": "Thread-1", "execution_time": 0.002824068069458008, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__weekly_metrics_week.4b0b928243"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-01T00:40:18.606241Z", "completed_at": "2022-11-01T00:40:18.609115Z"}, {"name": "execute", "started_at": "2022-11-01T00:40:18.609236Z", "completed_at": "2022-11-01T00:40:18.609241Z"}], "thread_id": "Thread-1", "execution_time": 0.0035119056701660156, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__weekly_metrics_week.6794858a8e"}], "elapsed_time": 6.8091840744018555, "args": {"write_json": true, "use_colors": true, "printer_width": 80, "version_check": true, "partial_parse": true, "static_parser": true, "profiles_dir": "/Users/catherinefritz/.dbt", "send_anonymous_usage_stats": true, "event_buffer_size": 100000, "quiet": false, "no_print": false, "compile": true, "which": "generate", "rpc_method": "docs.generate", "indirect_selection": "eager"}} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v4.json", "dbt_version": "1.3.0", "generated_at": "2022-11-07T19:30:39.722706Z", "invocation_id": "373a774a-fbd2-4652-b5ce-ec2e726cba75", "env": {}}, "results": [{"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.619525Z", "completed_at": "2022-11-07T19:30:33.627499Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.628064Z", "completed_at": "2022-11-07T19:30:33.628767Z"}], "thread_id": "Thread-1", "execution_time": 0.011052131652832031, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_assignee_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.631007Z", "completed_at": "2022-11-07T19:30:33.636719Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.637195Z", "completed_at": "2022-11-07T19:30:33.637208Z"}], "thread_id": "Thread-1", "execution_time": 0.007628917694091797, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_closed_history_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.639578Z", "completed_at": "2022-11-07T19:30:33.645961Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.646429Z", "completed_at": "2022-11-07T19:30:33.646442Z"}], "thread_id": "Thread-1", "execution_time": 0.008515119552612305, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_comment_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.648395Z", "completed_at": "2022-11-07T19:30:33.659976Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.660432Z", "completed_at": "2022-11-07T19:30:33.660445Z"}], "thread_id": "Thread-1", "execution_time": 0.013390064239501953, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_label_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.662393Z", "completed_at": "2022-11-07T19:30:33.668094Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.668526Z", "completed_at": "2022-11-07T19:30:33.668537Z"}], "thread_id": "Thread-1", "execution_time": 0.0074596405029296875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_merged_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.670611Z", "completed_at": "2022-11-07T19:30:33.675488Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.675907Z", "completed_at": "2022-11-07T19:30:33.675917Z"}], "thread_id": "Thread-1", "execution_time": 0.006683826446533203, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.678008Z", "completed_at": "2022-11-07T19:30:33.682772Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.683174Z", "completed_at": "2022-11-07T19:30:33.683182Z"}], "thread_id": "Thread-1", "execution_time": 0.006666898727416992, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__label_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.685122Z", "completed_at": "2022-11-07T19:30:33.689468Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.689832Z", "completed_at": "2022-11-07T19:30:33.689839Z"}], "thread_id": "Thread-1", "execution_time": 0.005878925323486328, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__pull_request_review_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.691499Z", "completed_at": "2022-11-07T19:30:33.695414Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.695759Z", "completed_at": "2022-11-07T19:30:33.695767Z"}], "thread_id": "Thread-1", "execution_time": 0.005321979522705078, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__pull_request_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.697446Z", "completed_at": "2022-11-07T19:30:33.702741Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.703087Z", "completed_at": "2022-11-07T19:30:33.703094Z"}], "thread_id": "Thread-1", "execution_time": 0.0068781375885009766, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__repo_team_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.704797Z", "completed_at": "2022-11-07T19:30:33.771078Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.771665Z", "completed_at": "2022-11-07T19:30:33.771679Z"}], "thread_id": "Thread-1", "execution_time": 0.06832265853881836, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__repository_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.774509Z", "completed_at": "2022-11-07T19:30:33.780461Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.781010Z", "completed_at": "2022-11-07T19:30:33.781021Z"}], "thread_id": "Thread-1", "execution_time": 0.008328914642333984, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__requested_reviewer_history_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.783662Z", "completed_at": "2022-11-07T19:30:33.789236Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.789706Z", "completed_at": "2022-11-07T19:30:33.789716Z"}], "thread_id": "Thread-1", "execution_time": 0.007778167724609375, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__team_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.791942Z", "completed_at": "2022-11-07T19:30:33.796882Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.797328Z", "completed_at": "2022-11-07T19:30:33.797337Z"}], "thread_id": "Thread-1", "execution_time": 0.0067751407623291016, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__user_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.799507Z", "completed_at": "2022-11-07T19:30:33.802037Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.802450Z", "completed_at": "2022-11-07T19:30:33.802459Z"}], "thread_id": "Thread-1", "execution_time": 0.004419088363647461, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_assignee_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.804439Z", "completed_at": "2022-11-07T19:30:33.806875Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.807267Z", "completed_at": "2022-11-07T19:30:33.807276Z"}], "thread_id": "Thread-1", "execution_time": 0.00411534309387207, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_closed_history_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.809196Z", "completed_at": "2022-11-07T19:30:33.812936Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.813338Z", "completed_at": "2022-11-07T19:30:33.813347Z"}], "thread_id": "Thread-1", "execution_time": 0.0054492950439453125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_comment_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.815295Z", "completed_at": "2022-11-07T19:30:33.817642Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.818030Z", "completed_at": "2022-11-07T19:30:33.818039Z"}], "thread_id": "Thread-1", "execution_time": 0.004122018814086914, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.819977Z", "completed_at": "2022-11-07T19:30:33.822261Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.822648Z", "completed_at": "2022-11-07T19:30:33.822657Z"}], "thread_id": "Thread-1", "execution_time": 0.004009246826171875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_label_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.824398Z", "completed_at": "2022-11-07T19:30:33.826457Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.826788Z", "completed_at": "2022-11-07T19:30:33.826795Z"}], "thread_id": "Thread-1", "execution_time": 0.003511190414428711, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_merged_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.828396Z", "completed_at": "2022-11-07T19:30:33.830313Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.830640Z", "completed_at": "2022-11-07T19:30:33.830647Z"}], "thread_id": "Thread-1", "execution_time": 0.003320932388305664, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_label_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.832368Z", "completed_at": "2022-11-07T19:30:33.834256Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.834587Z", "completed_at": "2022-11-07T19:30:33.834594Z"}], "thread_id": "Thread-1", "execution_time": 0.003443002700805664, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_pull_request_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.836288Z", "completed_at": "2022-11-07T19:30:33.839304Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.839633Z", "completed_at": "2022-11-07T19:30:33.839640Z"}], "thread_id": "Thread-1", "execution_time": 0.004427194595336914, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_pull_request_review_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.841265Z", "completed_at": "2022-11-07T19:30:33.843255Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.843584Z", "completed_at": "2022-11-07T19:30:33.843592Z"}], "thread_id": "Thread-1", "execution_time": 0.0034189224243164062, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_repo_team_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.845183Z", "completed_at": "2022-11-07T19:30:33.847045Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.847343Z", "completed_at": "2022-11-07T19:30:33.847350Z"}], "thread_id": "Thread-1", "execution_time": 0.003203868865966797, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_repository_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.848799Z", "completed_at": "2022-11-07T19:30:33.850501Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.850784Z", "completed_at": "2022-11-07T19:30:33.850791Z"}], "thread_id": "Thread-1", "execution_time": 0.0029947757720947266, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_requested_reviewer_history_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.852040Z", "completed_at": "2022-11-07T19:30:33.853569Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.853828Z", "completed_at": "2022-11-07T19:30:33.853834Z"}], "thread_id": "Thread-1", "execution_time": 0.002716064453125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_team_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.855664Z", "completed_at": "2022-11-07T19:30:33.857610Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.857894Z", "completed_at": "2022-11-07T19:30:33.857901Z"}], "thread_id": "Thread-1", "execution_time": 0.0036928653717041016, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_user_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.859316Z", "completed_at": "2022-11-07T19:30:34.223739Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:34.224120Z", "completed_at": "2022-11-07T19:30:34.224131Z"}], "thread_id": "Thread-1", "execution_time": 0.3659529685974121, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_assignee"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:34.225954Z", "completed_at": "2022-11-07T19:30:34.552097Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:34.552466Z", "completed_at": "2022-11-07T19:30:34.552477Z"}], "thread_id": "Thread-1", "execution_time": 0.32767510414123535, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_closed_history"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:34.554302Z", "completed_at": "2022-11-07T19:30:34.964976Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:34.965466Z", "completed_at": "2022-11-07T19:30:34.965479Z"}], "thread_id": "Thread-1", "execution_time": 0.41246700286865234, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_comment"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:34.968083Z", "completed_at": "2022-11-07T19:30:35.319765Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:35.320264Z", "completed_at": "2022-11-07T19:30:35.320277Z"}], "thread_id": "Thread-1", "execution_time": 0.35375523567199707, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_label"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:35.322570Z", "completed_at": "2022-11-07T19:30:35.648027Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:35.648474Z", "completed_at": "2022-11-07T19:30:35.648486Z"}], "thread_id": "Thread-1", "execution_time": 0.32740306854248047, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_merged"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:35.650610Z", "completed_at": "2022-11-07T19:30:36.089539Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:36.089973Z", "completed_at": "2022-11-07T19:30:36.089985Z"}], "thread_id": "Thread-1", "execution_time": 0.4407308101654053, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:36.092281Z", "completed_at": "2022-11-07T19:30:36.518484Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:36.518958Z", "completed_at": "2022-11-07T19:30:36.518970Z"}], "thread_id": "Thread-1", "execution_time": 0.42825913429260254, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__label"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:36.521413Z", "completed_at": "2022-11-07T19:30:36.913951Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:36.914411Z", "completed_at": "2022-11-07T19:30:36.914423Z"}], "thread_id": "Thread-1", "execution_time": 0.3946530818939209, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__pull_request_review"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:36.916755Z", "completed_at": "2022-11-07T19:30:37.345344Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:37.345816Z", "completed_at": "2022-11-07T19:30:37.345829Z"}], "thread_id": "Thread-1", "execution_time": 0.43045592308044434, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__pull_request"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:37.348147Z", "completed_at": "2022-11-07T19:30:37.733769Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:37.734219Z", "completed_at": "2022-11-07T19:30:37.734231Z"}], "thread_id": "Thread-1", "execution_time": 0.38764095306396484, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__repo_team"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:37.736386Z", "completed_at": "2022-11-07T19:30:38.129363Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:38.129739Z", "completed_at": "2022-11-07T19:30:38.129750Z"}], "thread_id": "Thread-1", "execution_time": 0.3945930004119873, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__repository"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:38.131596Z", "completed_at": "2022-11-07T19:30:38.529213Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:38.529660Z", "completed_at": "2022-11-07T19:30:38.529672Z"}], "thread_id": "Thread-1", "execution_time": 0.3992478847503662, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__requested_reviewer_history"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:38.531557Z", "completed_at": "2022-11-07T19:30:38.873428Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:38.873806Z", "completed_at": "2022-11-07T19:30:38.873817Z"}], "thread_id": "Thread-1", "execution_time": 0.34338808059692383, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__team"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:38.875705Z", "completed_at": "2022-11-07T19:30:39.266104Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.266550Z", "completed_at": "2022-11-07T19:30:39.266563Z"}], "thread_id": "Thread-1", "execution_time": 0.39222073554992676, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__user"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.268905Z", "completed_at": "2022-11-07T19:30:39.288047Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.288553Z", "completed_at": "2022-11-07T19:30:39.288568Z"}], "thread_id": "Thread-1", "execution_time": 0.02110600471496582, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.290948Z", "completed_at": "2022-11-07T19:30:39.299352Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.299811Z", "completed_at": "2022-11-07T19:30:39.299824Z"}], "thread_id": "Thread-1", "execution_time": 0.010382890701293945, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.316251Z", "completed_at": "2022-11-07T19:30:39.328447Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.328877Z", "completed_at": "2022-11-07T19:30:39.328889Z"}], "thread_id": "Thread-1", "execution_time": 0.013937950134277344, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.330937Z", "completed_at": "2022-11-07T19:30:39.340474Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.340925Z", "completed_at": "2022-11-07T19:30:39.340937Z"}], "thread_id": "Thread-1", "execution_time": 0.011406898498535156, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.357140Z", "completed_at": "2022-11-07T19:30:39.362561Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.362936Z", "completed_at": "2022-11-07T19:30:39.362946Z"}], "thread_id": "Thread-1", "execution_time": 0.006936073303222656, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.364640Z", "completed_at": "2022-11-07T19:30:39.371246Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.371617Z", "completed_at": "2022-11-07T19:30:39.371627Z"}], "thread_id": "Thread-1", "execution_time": 0.008098125457763672, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__issue_issue_id.84891aeece"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.380426Z", "completed_at": "2022-11-07T19:30:39.385529Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.385896Z", "completed_at": "2022-11-07T19:30:39.385905Z"}], "thread_id": "Thread-1", "execution_time": 0.006596088409423828, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__label_label_id.9f07379974"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.387547Z", "completed_at": "2022-11-07T19:30:39.392545Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.392910Z", "completed_at": "2022-11-07T19:30:39.392919Z"}], "thread_id": "Thread-1", "execution_time": 0.006479024887084961, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__label_label_id.74d3c21466"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.394600Z", "completed_at": "2022-11-07T19:30:39.399667Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.400027Z", "completed_at": "2022-11-07T19:30:39.400035Z"}], "thread_id": "Thread-1", "execution_time": 0.006531953811645508, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.401651Z", "completed_at": "2022-11-07T19:30:39.406500Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.406859Z", "completed_at": "2022-11-07T19:30:39.406867Z"}], "thread_id": "Thread-1", "execution_time": 0.006375789642333984, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.408578Z", "completed_at": "2022-11-07T19:30:39.415279Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.415658Z", "completed_at": "2022-11-07T19:30:39.415669Z"}], "thread_id": "Thread-1", "execution_time": 0.008278131484985352, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.417380Z", "completed_at": "2022-11-07T19:30:39.422855Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.423253Z", "completed_at": "2022-11-07T19:30:39.423266Z"}], "thread_id": "Thread-1", "execution_time": 0.00705409049987793, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.425053Z", "completed_at": "2022-11-07T19:30:39.430618Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.431026Z", "completed_at": "2022-11-07T19:30:39.431039Z"}], "thread_id": "Thread-1", "execution_time": 0.007278919219970703, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.432891Z", "completed_at": "2022-11-07T19:30:39.438233Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.438608Z", "completed_at": "2022-11-07T19:30:39.438618Z"}], "thread_id": "Thread-1", "execution_time": 0.006883144378662109, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.440353Z", "completed_at": "2022-11-07T19:30:39.445691Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.446073Z", "completed_at": "2022-11-07T19:30:39.446085Z"}], "thread_id": "Thread-1", "execution_time": 0.006863117218017578, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.447797Z", "completed_at": "2022-11-07T19:30:39.452961Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.453327Z", "completed_at": "2022-11-07T19:30:39.453336Z"}], "thread_id": "Thread-1", "execution_time": 0.006639957427978516, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.482598Z", "completed_at": "2022-11-07T19:30:39.487778Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.488153Z", "completed_at": "2022-11-07T19:30:39.488163Z"}], "thread_id": "Thread-1", "execution_time": 0.0067861080169677734, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__team_team_id.440aefe7a7"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.489932Z", "completed_at": "2022-11-07T19:30:39.495300Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.495690Z", "completed_at": "2022-11-07T19:30:39.495702Z"}], "thread_id": "Thread-1", "execution_time": 0.00693202018737793, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__team_team_id.94e9716ab4"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.513498Z", "completed_at": "2022-11-07T19:30:39.520099Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.520473Z", "completed_at": "2022-11-07T19:30:39.520484Z"}], "thread_id": "Thread-1", "execution_time": 0.008114814758300781, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.522162Z", "completed_at": "2022-11-07T19:30:39.527712Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.528084Z", "completed_at": "2022-11-07T19:30:39.528095Z"}], "thread_id": "Thread-1", "execution_time": 0.007068157196044922, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__user_user_id.5c1a00cd90"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.579211Z", "completed_at": "2022-11-07T19:30:39.588662Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.589145Z", "completed_at": "2022-11-07T19:30:39.589156Z"}], "thread_id": "Thread-1", "execution_time": 0.011059045791625977, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__issues"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.591112Z", "completed_at": "2022-11-07T19:30:39.598858Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.599354Z", "completed_at": "2022-11-07T19:30:39.599364Z"}], "thread_id": "Thread-1", "execution_time": 0.00948786735534668, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__pull_requests"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.601230Z", "completed_at": "2022-11-07T19:30:39.606702Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.607074Z", "completed_at": "2022-11-07T19:30:39.607084Z"}], "thread_id": "Thread-1", "execution_time": 0.007153987884521484, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__issues_issue_id.fed0631e25"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.608845Z", "completed_at": "2022-11-07T19:30:39.614113Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.614500Z", "completed_at": "2022-11-07T19:30:39.614511Z"}], "thread_id": "Thread-1", "execution_time": 0.006802082061767578, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__issues_issue_id.6723b9b1db"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.616251Z", "completed_at": "2022-11-07T19:30:39.625768Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.626139Z", "completed_at": "2022-11-07T19:30:39.626150Z"}], "thread_id": "Thread-1", "execution_time": 0.011004924774169922, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__daily_metrics"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.628063Z", "completed_at": "2022-11-07T19:30:39.633271Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.633638Z", "completed_at": "2022-11-07T19:30:39.633648Z"}], "thread_id": "Thread-1", "execution_time": 0.006861209869384766, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.635298Z", "completed_at": "2022-11-07T19:30:39.641674Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.642059Z", "completed_at": "2022-11-07T19:30:39.642069Z"}], "thread_id": "Thread-1", "execution_time": 0.007893085479736328, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__pull_requests_issue_id.ce23997907"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.643775Z", "completed_at": "2022-11-07T19:30:39.648299Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.648673Z", "completed_at": "2022-11-07T19:30:39.648684Z"}], "thread_id": "Thread-1", "execution_time": 0.006093740463256836, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__monthly_metrics"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.650478Z", "completed_at": "2022-11-07T19:30:39.654697Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.655050Z", "completed_at": "2022-11-07T19:30:39.655059Z"}], "thread_id": "Thread-1", "execution_time": 0.005679130554199219, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__quarterly_metrics"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.656981Z", "completed_at": "2022-11-07T19:30:39.661494Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.661853Z", "completed_at": "2022-11-07T19:30:39.661863Z"}], "thread_id": "Thread-1", "execution_time": 0.006061077117919922, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__weekly_metrics"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.663654Z", "completed_at": "2022-11-07T19:30:39.668805Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.669186Z", "completed_at": "2022-11-07T19:30:39.669196Z"}], "thread_id": "Thread-1", "execution_time": 0.00665593147277832, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__daily_metrics_day.647e494434"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.670894Z", "completed_at": "2022-11-07T19:30:39.676101Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.676473Z", "completed_at": "2022-11-07T19:30:39.676484Z"}], "thread_id": "Thread-1", "execution_time": 0.006702899932861328, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__daily_metrics_day.f98cab9456"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.678139Z", "completed_at": "2022-11-07T19:30:39.684604Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.684979Z", "completed_at": "2022-11-07T19:30:39.684990Z"}], "thread_id": "Thread-1", "execution_time": 0.007952213287353516, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__monthly_metrics_month.9e4fba84df"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.686672Z", "completed_at": "2022-11-07T19:30:39.691914Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.692281Z", "completed_at": "2022-11-07T19:30:39.692292Z"}], "thread_id": "Thread-1", "execution_time": 0.006731986999511719, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__monthly_metrics_month.3076284fbb"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.693927Z", "completed_at": "2022-11-07T19:30:39.699064Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.699449Z", "completed_at": "2022-11-07T19:30:39.699459Z"}], "thread_id": "Thread-1", "execution_time": 0.0067059993743896484, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__quarterly_metrics_quarter.92394d46dc"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.701137Z", "completed_at": "2022-11-07T19:30:39.706213Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.706579Z", "completed_at": "2022-11-07T19:30:39.706588Z"}], "thread_id": "Thread-1", "execution_time": 0.006558895111083984, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__quarterly_metrics_quarter.9165a921c1"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.708247Z", "completed_at": "2022-11-07T19:30:39.713426Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.713799Z", "completed_at": "2022-11-07T19:30:39.713809Z"}], "thread_id": "Thread-1", "execution_time": 0.0066699981689453125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__weekly_metrics_week.4b0b928243"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.715505Z", "completed_at": "2022-11-07T19:30:39.720579Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.720935Z", "completed_at": "2022-11-07T19:30:39.720945Z"}], "thread_id": "Thread-1", "execution_time": 0.006564140319824219, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__weekly_metrics_week.6794858a8e"}], "elapsed_time": 9.378747940063477, "args": {"write_json": true, "use_colors": true, "printer_width": 80, "version_check": true, "partial_parse": true, "static_parser": true, "profiles_dir": "/Users/sheri.nguyen/.dbt", "send_anonymous_usage_stats": true, "event_buffer_size": 100000, "quiet": false, "no_print": false, "compile": true, "which": "generate", "rpc_method": "docs.generate", "indirect_selection": "eager"}} \ No newline at end of file From f8b8421a523e3fceb7972ddf78d0d4b2ec8c469a Mon Sep 17 00:00:00 2001 From: fivetran-sheringuyen <94874400+fivetran-sheringuyen@users.noreply.github.com> Date: Tue, 8 Nov 2022 14:06:04 -0900 Subject: [PATCH 27/30] readme update --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 41e94e5..1913301 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,15 @@ The following table provides a detailed list of all models materialized within t To use this dbt package, you must have the following: - At least one Fivetran Github connector syncing data into your destination. -- A **BigQuery**, **Snowflake**, or **Redshift*** destination. +- A **BigQuery**, **Snowflake**, **Redshift**, or **Databricks** destination. + +### Databricks Dispatch Configuration +If you are using a Databricks destination with this package you will need to add the below (or a variation of the below) dispatch configuration within your `dbt_project.yml`. This is required in order for the package to accurately search for macros within the `dbt-labs/spark_utils` then the `dbt-labs/dbt_utils` packages respectively. +```yml +dispatch: + - macro_namespace: dbt_utils + search_order: ['spark_utils', 'dbt_utils'] +``` ## Step 2: Install the package Include the following github package version in your `packages.yml` file. From 9e6fcca1b75b673648e6627d3daa5da2edde1a5b Mon Sep 17 00:00:00 2001 From: fivetran-sheringuyen <94874400+fivetran-sheringuyen@users.noreply.github.com> Date: Mon, 14 Nov 2022 12:22:07 -0900 Subject: [PATCH 28/30] pr updates --- .github/pull_request_template.md | 1 - README.md | 3 +++ packages.yml | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 1b75bc7..50ee0df 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,4 +1,3 @@ -Pull Request **Are you a current Fivetran customer?** diff --git a/README.md b/README.md index 1913301..0626797 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,9 @@ packages: - package: fivetran/github_source version: [">=0.6.0", "<0.7.0"] + + - package: dbt-labs/spark_utils + version: [">=0.3.0", "<0.4.0"] ``` # 🙌 How is this package maintained and can I contribute? ## Package Maintenance diff --git a/packages.yml b/packages.yml index dae2587..e4157ef 100644 --- a/packages.yml +++ b/packages.yml @@ -4,4 +4,4 @@ packages: # Update before merge - git: https://github.com/fivetran/dbt_github_source.git - revision: feature/databricks-compat \ No newline at end of file + revision: MagicBot/dbt-utils-cross-db-migration \ No newline at end of file From 6f96292795529ef0185a052cdb98aa0525fd4579 Mon Sep 17 00:00:00 2001 From: fivetran-joemarkiewicz Date: Mon, 19 Dec 2022 14:26:01 -0600 Subject: [PATCH 29/30] docs regen --- docs/catalog.json | 2 +- docs/manifest.json | 2 +- docs/run_results.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/catalog.json b/docs/catalog.json index 1d0fc34..58fa8a1 100644 --- a/docs/catalog.json +++ b/docs/catalog.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "1.3.0", "generated_at": "2022-11-07T19:30:44.248132Z", "invocation_id": "373a774a-fbd2-4652-b5ce-ec2e726cba75", "env": {}}, "nodes": {"seed.github_integration_tests.github_pull_request_review_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_pull_request_review_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "commit_sha": {"type": "STRING", "index": 4, "name": "commit_sha", "comment": null}, "pull_request_id": {"type": "INT64", "index": 5, "name": "pull_request_id", "comment": null}, "state": {"type": "STRING", "index": 6, "name": "state", "comment": null}, "submitted_at": {"type": "TIMESTAMP", "index": 7, "name": "submitted_at", "comment": null}, "user_id": {"type": "INT64", "index": 8, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 18059.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 114.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_pull_request_review_data"}, "model.github_source.stg_github__team": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__team", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"team_id": {"type": "INT64", "index": 1, "name": "team_id", "comment": null}, "description": {"type": "STRING", "index": 2, "name": "description", "comment": null}, "name": {"type": "STRING", "index": 3, "name": "name", "comment": null}, "parent_id": {"type": "INT64", "index": 4, "name": "parent_id", "comment": null}, "privacy": {"type": "STRING", "index": 5, "name": "privacy", "comment": null}, "slug": {"type": "STRING", "index": 6, "name": "slug", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2042.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 19.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__team"}, "seed.github_integration_tests.github_issue_comment_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_comment_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "created_at": {"type": "DATETIME", "index": 4, "name": "created_at", "comment": null}, "issue_id": {"type": "INT64", "index": 5, "name": "issue_id", "comment": null}, "updated_at": {"type": "DATETIME", "index": 6, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 7, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 4902.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 43.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_comment_data"}, "model.github.github__quarterly_metrics": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github__quarterly_metrics", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"quarter": {"type": "TIMESTAMP", "index": 1, "name": "quarter", "comment": null}, "number_issues_opened": {"type": "INT64", "index": 2, "name": "number_issues_opened", "comment": null}, "number_issues_closed": {"type": "INT64", "index": 3, "name": "number_issues_closed", "comment": null}, "avg_days_issue_open": {"type": "FLOAT64", "index": 4, "name": "avg_days_issue_open", "comment": null}, "longest_days_issue_open": {"type": "FLOAT64", "index": 5, "name": "longest_days_issue_open", "comment": null}, "number_prs_opened": {"type": "INT64", "index": 6, "name": "number_prs_opened", "comment": null}, "number_prs_merged": {"type": "INT64", "index": 7, "name": "number_prs_merged", "comment": null}, "number_prs_closed_without_merge": {"type": "INT64", "index": 8, "name": "number_prs_closed_without_merge", "comment": null}, "avg_days_pr_open": {"type": "FLOAT64", "index": 9, "name": "avg_days_pr_open", "comment": null}, "longest_days_pr_open": {"type": "FLOAT64", "index": 10, "name": "longest_days_pr_open", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 720.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 9.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__quarterly_metrics"}, "model.github_source.stg_github__pull_request_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__pull_request_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "base_label": {"type": "STRING", "index": 3, "name": "base_label", "comment": null}, "base_ref": {"type": "STRING", "index": 4, "name": "base_ref", "comment": null}, "base_repo_id": {"type": "INT64", "index": 5, "name": "base_repo_id", "comment": null}, "base_sha": {"type": "STRING", "index": 6, "name": "base_sha", "comment": null}, "base_user_id": {"type": "INT64", "index": 7, "name": "base_user_id", "comment": null}, "head_label": {"type": "STRING", "index": 8, "name": "head_label", "comment": null}, "head_ref": {"type": "STRING", "index": 9, "name": "head_ref", "comment": null}, "head_repo_id": {"type": "INT64", "index": 10, "name": "head_repo_id", "comment": null}, "head_sha": {"type": "STRING", "index": 11, "name": "head_sha", "comment": null}, "head_user_id": {"type": "INT64", "index": 12, "name": "head_user_id", "comment": null}, "issue_id": {"type": "INT64", "index": 13, "name": "issue_id", "comment": null}, "merge_commit_sha": {"type": "STRING", "index": 14, "name": "merge_commit_sha", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__pull_request_tmp"}, "model.github_source.stg_github__user": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__user", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"user_id": {"type": "INT64", "index": 1, "name": "user_id", "comment": null}, "login_name": {"type": "STRING", "index": 2, "name": "login_name", "comment": null}, "name": {"type": "STRING", "index": 3, "name": "name", "comment": null}, "company": {"type": "STRING", "index": 4, "name": "company", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 3502.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 17.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__user"}, "model.github_source.stg_github__issue_label": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__issue_label", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "label_id": {"type": "INT64", "index": 2, "name": "label_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 736.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 46.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_label"}, "model.github_source.stg_github__repo_team_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__repo_team_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"repository_id": {"type": "INT64", "index": 1, "name": "repository_id", "comment": null}, "team_id": {"type": "INT64", "index": 2, "name": "team_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "permission": {"type": "STRING", "index": 4, "name": "permission", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__repo_team_tmp"}, "seed.github_integration_tests.github_repository_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_repository_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "archived": {"type": "BOOL", "index": 3, "name": "archived", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "default_branch": {"type": "STRING", "index": 5, "name": "default_branch", "comment": null}, "description": {"type": "STRING", "index": 6, "name": "description", "comment": null}, "fork": {"type": "BOOL", "index": 7, "name": "fork", "comment": null}, "full_name": {"type": "STRING", "index": 8, "name": "full_name", "comment": null}, "homepage": {"type": "INT64", "index": 9, "name": "homepage", "comment": null}, "language": {"type": "STRING", "index": 10, "name": "language", "comment": null}, "name": {"type": "STRING", "index": 11, "name": "name", "comment": null}, "owner_id": {"type": "INT64", "index": 12, "name": "owner_id", "comment": null}, "private": {"type": "BOOL", "index": 13, "name": "private", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 5793.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 24.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_repository_data"}, "model.github_source.stg_github__repository": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__repository", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"repository_id": {"type": "INT64", "index": 1, "name": "repository_id", "comment": null}, "full_name": {"type": "STRING", "index": 2, "name": "full_name", "comment": null}, "is_private": {"type": "BOOL", "index": 3, "name": "is_private", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1800.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 24.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__repository"}, "seed.github_integration_tests.github_issue_merged_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_merged_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"commit_sha": {"type": "STRING", "index": 1, "name": "commit_sha", "comment": null}, "issue_id": {"type": "INT64", "index": 2, "name": "issue_id", "comment": null}, "merged_at": {"type": "TIMESTAMP", "index": 3, "name": "merged_at", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 5, "name": "actor_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 8140.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 110.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_merged_data"}, "model.github_source.stg_github__label_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__label_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "color": {"type": "STRING", "index": 3, "name": "color", "comment": null}, "description": {"type": "STRING", "index": 4, "name": "description", "comment": null}, "is_default": {"type": "BOOL", "index": 5, "name": "is_default", "comment": null}, "name": {"type": "STRING", "index": 6, "name": "name", "comment": null}, "url": {"type": "STRING", "index": 7, "name": "url", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__label_tmp"}, "model.github_source.stg_github__pull_request": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__pull_request", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"pull_request_id": {"type": "INT64", "index": 1, "name": "pull_request_id", "comment": null}, "issue_id": {"type": "INT64", "index": 2, "name": "issue_id", "comment": null}, "head_repo_id": {"type": "INT64", "index": 3, "name": "head_repo_id", "comment": null}, "head_user_id": {"type": "INT64", "index": 4, "name": "head_user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 5320.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 167.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__pull_request"}, "seed.github_integration_tests.github_issue_label_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_label_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "label_id": {"type": "INT64", "index": 2, "name": "label_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1104.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 46.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_label_data"}, "model.github_source.stg_github__issue_comment_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__issue_comment_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "created_at": {"type": "DATETIME", "index": 4, "name": "created_at", "comment": null}, "issue_id": {"type": "INT64", "index": 5, "name": "issue_id", "comment": null}, "updated_at": {"type": "DATETIME", "index": 6, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 7, "name": "user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_comment_tmp"}, "model.github_source.stg_github__issue_comment": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__issue_comment", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_comment_id": {"type": "INT64", "index": 1, "name": "issue_comment_id", "comment": null}, "issue_id": {"type": "INT64", "index": 2, "name": "issue_id", "comment": null}, "user_id": {"type": "INT64", "index": 3, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1032.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 43.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_comment"}, "model.github_source.stg_github__pull_request_review": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__pull_request_review", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"pull_request_review_id": {"type": "INT64", "index": 1, "name": "pull_request_review_id", "comment": null}, "pull_request_id": {"type": "INT64", "index": 2, "name": "pull_request_id", "comment": null}, "submitted_at": {"type": "TIMESTAMP", "index": 3, "name": "submitted_at", "comment": null}, "state": {"type": "STRING", "index": 4, "name": "state", "comment": null}, "user_id": {"type": "INT64", "index": 5, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 4835.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 114.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__pull_request_review"}, "model.github.github__monthly_metrics": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github__monthly_metrics", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"month": {"type": "TIMESTAMP", "index": 1, "name": "month", "comment": null}, "number_issues_opened": {"type": "INT64", "index": 2, "name": "number_issues_opened", "comment": null}, "number_issues_closed": {"type": "INT64", "index": 3, "name": "number_issues_closed", "comment": null}, "avg_days_issue_open": {"type": "FLOAT64", "index": 4, "name": "avg_days_issue_open", "comment": null}, "longest_days_issue_open": {"type": "FLOAT64", "index": 5, "name": "longest_days_issue_open", "comment": null}, "number_prs_opened": {"type": "INT64", "index": 6, "name": "number_prs_opened", "comment": null}, "number_prs_merged": {"type": "INT64", "index": 7, "name": "number_prs_merged", "comment": null}, "number_prs_closed_without_merge": {"type": "INT64", "index": 8, "name": "number_prs_closed_without_merge", "comment": null}, "avg_days_pr_open": {"type": "FLOAT64", "index": 9, "name": "avg_days_pr_open", "comment": null}, "longest_days_pr_open": {"type": "FLOAT64", "index": 10, "name": "longest_days_pr_open", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1888.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 25.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__monthly_metrics"}, "model.github.github__pull_requests": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github__pull_requests", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "body": {"type": "STRING", "index": 2, "name": "body", "comment": null}, "closed_at": {"type": "TIMESTAMP", "index": 3, "name": "closed_at", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "is_locked": {"type": "BOOL", "index": 5, "name": "is_locked", "comment": null}, "milestone_id": {"type": "INT64", "index": 6, "name": "milestone_id", "comment": null}, "issue_number": {"type": "INT64", "index": 7, "name": "issue_number", "comment": null}, "is_pull_request": {"type": "BOOL", "index": 8, "name": "is_pull_request", "comment": null}, "repository_id": {"type": "INT64", "index": 9, "name": "repository_id", "comment": null}, "state": {"type": "STRING", "index": 10, "name": "state", "comment": null}, "title": {"type": "STRING", "index": 11, "name": "title", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 12, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 13, "name": "user_id", "comment": null}, "url_link": {"type": "STRING", "index": 14, "name": "url_link", "comment": null}, "days_issue_open": {"type": "FLOAT64", "index": 15, "name": "days_issue_open", "comment": null}, "number_of_times_reopened": {"type": "INT64", "index": 16, "name": "number_of_times_reopened", "comment": null}, "labels": {"type": "STRING", "index": 17, "name": "labels", "comment": null}, "number_of_comments": {"type": "INT64", "index": 18, "name": "number_of_comments", "comment": null}, "repository": {"type": "STRING", "index": 19, "name": "repository", "comment": null}, "repository_team_names": {"type": "STRING", "index": 20, "name": "repository_team_names", "comment": null}, "assignees": {"type": "STRING", "index": 21, "name": "assignees", "comment": null}, "creator_login_name": {"type": "STRING", "index": 22, "name": "creator_login_name", "comment": null}, "creator_name": {"type": "STRING", "index": 23, "name": "creator_name", "comment": null}, "creator_company": {"type": "STRING", "index": 24, "name": "creator_company", "comment": null}, "hours_request_review_to_first_review": {"type": "FLOAT64", "index": 25, "name": "hours_request_review_to_first_review", "comment": null}, "hours_request_review_to_first_action": {"type": "FLOAT64", "index": 26, "name": "hours_request_review_to_first_action", "comment": null}, "hours_request_review_to_merge": {"type": "FLOAT64", "index": 27, "name": "hours_request_review_to_merge", "comment": null}, "merged_at": {"type": "TIMESTAMP", "index": 28, "name": "merged_at", "comment": null}, "reviewers": {"type": "STRING", "index": 29, "name": "reviewers", "comment": null}, "number_of_reviews": {"type": "INT64", "index": 30, "name": "number_of_reviews", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 106809.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 167.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__pull_requests"}, "model.github.github__issues": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github__issues", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "body": {"type": "STRING", "index": 2, "name": "body", "comment": null}, "closed_at": {"type": "TIMESTAMP", "index": 3, "name": "closed_at", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "is_locked": {"type": "BOOL", "index": 5, "name": "is_locked", "comment": null}, "milestone_id": {"type": "INT64", "index": 6, "name": "milestone_id", "comment": null}, "issue_number": {"type": "INT64", "index": 7, "name": "issue_number", "comment": null}, "is_pull_request": {"type": "BOOL", "index": 8, "name": "is_pull_request", "comment": null}, "repository_id": {"type": "INT64", "index": 9, "name": "repository_id", "comment": null}, "state": {"type": "STRING", "index": 10, "name": "state", "comment": null}, "title": {"type": "STRING", "index": 11, "name": "title", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 12, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 13, "name": "user_id", "comment": null}, "url_link": {"type": "STRING", "index": 14, "name": "url_link", "comment": null}, "days_issue_open": {"type": "FLOAT64", "index": 15, "name": "days_issue_open", "comment": null}, "number_of_times_reopened": {"type": "INT64", "index": 16, "name": "number_of_times_reopened", "comment": null}, "labels": {"type": "STRING", "index": 17, "name": "labels", "comment": null}, "number_of_comments": {"type": "INT64", "index": 18, "name": "number_of_comments", "comment": null}, "repository": {"type": "STRING", "index": 19, "name": "repository", "comment": null}, "repository_team_names": {"type": "STRING", "index": 20, "name": "repository_team_names", "comment": null}, "assignees": {"type": "STRING", "index": 21, "name": "assignees", "comment": null}, "creator_login_name": {"type": "STRING", "index": 22, "name": "creator_login_name", "comment": null}, "creator_name": {"type": "STRING", "index": 23, "name": "creator_name", "comment": null}, "creator_company": {"type": "STRING", "index": 24, "name": "creator_company", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 16053.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 30.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__issues"}, "seed.github_integration_tests.github_issue_assignee_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_assignee_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "user_id": {"type": "INT64", "index": 2, "name": "user_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 4800.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 200.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_assignee_data"}, "model.github.github__weekly_metrics": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github__weekly_metrics", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"week": {"type": "TIMESTAMP", "index": 1, "name": "week", "comment": null}, "number_issues_opened": {"type": "INT64", "index": 2, "name": "number_issues_opened", "comment": null}, "number_issues_closed": {"type": "INT64", "index": 3, "name": "number_issues_closed", "comment": null}, "avg_days_issue_open": {"type": "FLOAT64", "index": 4, "name": "avg_days_issue_open", "comment": null}, "longest_days_issue_open": {"type": "FLOAT64", "index": 5, "name": "longest_days_issue_open", "comment": null}, "number_prs_opened": {"type": "INT64", "index": 6, "name": "number_prs_opened", "comment": null}, "number_prs_merged": {"type": "INT64", "index": 7, "name": "number_prs_merged", "comment": null}, "number_prs_closed_without_merge": {"type": "INT64", "index": 8, "name": "number_prs_closed_without_merge", "comment": null}, "avg_days_pr_open": {"type": "FLOAT64", "index": 9, "name": "avg_days_pr_open", "comment": null}, "longest_days_pr_open": {"type": "FLOAT64", "index": 10, "name": "longest_days_pr_open", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 6672.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 102.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__weekly_metrics"}, "model.github_source.stg_github__issue_assignee": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__issue_assignee", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "user_id": {"type": "INT64", "index": 2, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 3200.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 200.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_assignee"}, "model.github_source.stg_github__issue": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__issue", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "body": {"type": "STRING", "index": 2, "name": "body", "comment": null}, "closed_at": {"type": "TIMESTAMP", "index": 3, "name": "closed_at", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "is_locked": {"type": "BOOL", "index": 5, "name": "is_locked", "comment": null}, "milestone_id": {"type": "INT64", "index": 6, "name": "milestone_id", "comment": null}, "issue_number": {"type": "INT64", "index": 7, "name": "issue_number", "comment": null}, "is_pull_request": {"type": "BOOL", "index": 8, "name": "is_pull_request", "comment": null}, "repository_id": {"type": "INT64", "index": 9, "name": "repository_id", "comment": null}, "state": {"type": "STRING", "index": 10, "name": "state", "comment": null}, "title": {"type": "STRING", "index": 11, "name": "title", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 12, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 13, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 38954.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 197.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue"}, "model.github.github__daily_metrics": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github__daily_metrics", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"day": {"type": "TIMESTAMP", "index": 1, "name": "day", "comment": null}, "number_issues_opened": {"type": "INT64", "index": 2, "name": "number_issues_opened", "comment": null}, "number_issues_closed": {"type": "INT64", "index": 3, "name": "number_issues_closed", "comment": null}, "sum_days_issue_open": {"type": "FLOAT64", "index": 4, "name": "sum_days_issue_open", "comment": null}, "longest_days_issue_open": {"type": "FLOAT64", "index": 5, "name": "longest_days_issue_open", "comment": null}, "number_prs_opened": {"type": "INT64", "index": 6, "name": "number_prs_opened", "comment": null}, "number_prs_merged": {"type": "INT64", "index": 7, "name": "number_prs_merged", "comment": null}, "number_prs_closed_without_merge": {"type": "INT64", "index": 8, "name": "number_prs_closed_without_merge", "comment": null}, "sum_days_pr_open": {"type": "FLOAT64", "index": 9, "name": "sum_days_pr_open", "comment": null}, "longest_days_pr_open": {"type": "FLOAT64", "index": 10, "name": "longest_days_pr_open", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 17552.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 305.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__daily_metrics"}, "model.github_source.stg_github__repo_team": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__repo_team", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"repository_id": {"type": "INT64", "index": 1, "name": "repository_id", "comment": null}, "team_id": {"type": "INT64", "index": 2, "name": "team_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 128.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 8.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__repo_team"}, "model.github_source.stg_github__label": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__label", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"label_id": {"type": "INT64", "index": 1, "name": "label_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "color": {"type": "STRING", "index": 3, "name": "color", "comment": null}, "description": {"type": "STRING", "index": 4, "name": "description", "comment": null}, "is_default": {"type": "BOOL", "index": 5, "name": "is_default", "comment": null}, "label": {"type": "STRING", "index": 6, "name": "label", "comment": null}, "url": {"type": "STRING", "index": 7, "name": "url", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2016.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 15.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__label"}, "model.github_source.stg_github__issue_label_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__issue_label_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "label_id": {"type": "INT64", "index": 2, "name": "label_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_label_tmp"}, "model.github_source.stg_github__issue_closed_history_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__issue_closed_history_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 2, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 4, "name": "actor_id", "comment": null}, "closed": {"type": "BOOL", "index": 5, "name": "closed", "comment": null}, "commit_sha": {"type": "INT64", "index": 6, "name": "commit_sha", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_closed_history_tmp"}, "model.github_source.stg_github__issue_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__issue_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "closed_at": {"type": "TIMESTAMP", "index": 4, "name": "closed_at", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 5, "name": "created_at", "comment": null}, "locked": {"type": "BOOL", "index": 6, "name": "locked", "comment": null}, "milestone_id": {"type": "INT64", "index": 7, "name": "milestone_id", "comment": null}, "number": {"type": "INT64", "index": 8, "name": "number", "comment": null}, "pull_request": {"type": "BOOL", "index": 9, "name": "pull_request", "comment": null}, "repository_id": {"type": "INT64", "index": 10, "name": "repository_id", "comment": null}, "state": {"type": "STRING", "index": 11, "name": "state", "comment": null}, "title": {"type": "STRING", "index": 12, "name": "title", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 13, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 14, "name": "user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_tmp"}, "model.github_source.stg_github__user_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__user_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "bio": {"type": "STRING", "index": 3, "name": "bio", "comment": null}, "blog": {"type": "STRING", "index": 4, "name": "blog", "comment": null}, "company": {"type": "STRING", "index": 5, "name": "company", "comment": null}, "created_at": {"type": "DATETIME", "index": 6, "name": "created_at", "comment": null}, "hireable": {"type": "BOOL", "index": 7, "name": "hireable", "comment": null}, "location": {"type": "STRING", "index": 8, "name": "location", "comment": null}, "login": {"type": "STRING", "index": 9, "name": "login", "comment": null}, "name": {"type": "STRING", "index": 10, "name": "name", "comment": null}, "site_admin": {"type": "BOOL", "index": 11, "name": "site_admin", "comment": null}, "type": {"type": "STRING", "index": 12, "name": "type", "comment": null}, "updated_at": {"type": "DATETIME", "index": 13, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__user_tmp"}, "model.github_source.stg_github__issue_merged_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__issue_merged_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"commit_sha": {"type": "STRING", "index": 1, "name": "commit_sha", "comment": null}, "issue_id": {"type": "INT64", "index": 2, "name": "issue_id", "comment": null}, "merged_at": {"type": "TIMESTAMP", "index": 3, "name": "merged_at", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 5, "name": "actor_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_merged_tmp"}, "seed.github_integration_tests.github_label_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_label_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "color": {"type": "STRING", "index": 3, "name": "color", "comment": null}, "description": {"type": "STRING", "index": 4, "name": "description", "comment": null}, "is_default": {"type": "BOOL", "index": 5, "name": "is_default", "comment": null}, "name": {"type": "STRING", "index": 6, "name": "name", "comment": null}, "url": {"type": "STRING", "index": 7, "name": "url", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2016.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 15.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_label_data"}, "model.github_source.stg_github__repository_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__repository_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "archived": {"type": "BOOL", "index": 3, "name": "archived", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "default_branch": {"type": "STRING", "index": 5, "name": "default_branch", "comment": null}, "description": {"type": "STRING", "index": 6, "name": "description", "comment": null}, "fork": {"type": "BOOL", "index": 7, "name": "fork", "comment": null}, "full_name": {"type": "STRING", "index": 8, "name": "full_name", "comment": null}, "homepage": {"type": "INT64", "index": 9, "name": "homepage", "comment": null}, "language": {"type": "STRING", "index": 10, "name": "language", "comment": null}, "name": {"type": "STRING", "index": 11, "name": "name", "comment": null}, "owner_id": {"type": "INT64", "index": 12, "name": "owner_id", "comment": null}, "private": {"type": "BOOL", "index": 13, "name": "private", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__repository_tmp"}, "model.github_source.stg_github__requested_reviewer_history": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__requested_reviewer_history", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"pull_request_id": {"type": "INT64", "index": 1, "name": "pull_request_id", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 2, "name": "created_at", "comment": null}, "requested_id": {"type": "INT64", "index": 3, "name": "requested_id", "comment": null}, "removed": {"type": "BOOL", "index": 4, "name": "removed", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1025.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 41.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__requested_reviewer_history"}, "model.github_source.stg_github__issue_merged": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__issue_merged", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "merged_at": {"type": "TIMESTAMP", "index": 2, "name": "merged_at", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1760.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 110.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_merged"}, "seed.github_integration_tests.github_repo_team_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_repo_team_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"repository_id": {"type": "INT64", "index": 1, "name": "repository_id", "comment": null}, "team_id": {"type": "INT64", "index": 2, "name": "team_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "permission": {"type": "STRING", "index": 4, "name": "permission", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 464.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 8.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_repo_team_data"}, "model.github_source.stg_github__team_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__team_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "description": {"type": "STRING", "index": 3, "name": "description", "comment": null}, "name": {"type": "STRING", "index": 4, "name": "name", "comment": null}, "org_id": {"type": "INT64", "index": 5, "name": "org_id", "comment": null}, "parent_id": {"type": "INT64", "index": 6, "name": "parent_id", "comment": null}, "privacy": {"type": "STRING", "index": 7, "name": "privacy", "comment": null}, "slug": {"type": "STRING", "index": 8, "name": "slug", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__team_tmp"}, "seed.github_integration_tests.github_pull_request_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_pull_request_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "base_label": {"type": "STRING", "index": 3, "name": "base_label", "comment": null}, "base_ref": {"type": "STRING", "index": 4, "name": "base_ref", "comment": null}, "base_repo_id": {"type": "INT64", "index": 5, "name": "base_repo_id", "comment": null}, "base_sha": {"type": "STRING", "index": 6, "name": "base_sha", "comment": null}, "base_user_id": {"type": "INT64", "index": 7, "name": "base_user_id", "comment": null}, "head_label": {"type": "STRING", "index": 8, "name": "head_label", "comment": null}, "head_ref": {"type": "STRING", "index": 9, "name": "head_ref", "comment": null}, "head_repo_id": {"type": "INT64", "index": 10, "name": "head_repo_id", "comment": null}, "head_sha": {"type": "STRING", "index": 11, "name": "head_sha", "comment": null}, "head_user_id": {"type": "INT64", "index": 12, "name": "head_user_id", "comment": null}, "issue_id": {"type": "INT64", "index": 13, "name": "issue_id", "comment": null}, "merge_commit_sha": {"type": "STRING", "index": 14, "name": "merge_commit_sha", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 56627.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 167.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_pull_request_data"}, "seed.github_integration_tests.github_issue_closed_history_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_closed_history_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 2, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 4, "name": "actor_id", "comment": null}, "closed": {"type": "BOOL", "index": 5, "name": "closed", "comment": null}, "commit_sha": {"type": "INT64", "index": 6, "name": "commit_sha", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 5643.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 171.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_closed_history_data"}, "seed.github_integration_tests.github_user_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_user_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "bio": {"type": "STRING", "index": 3, "name": "bio", "comment": null}, "blog": {"type": "STRING", "index": 4, "name": "blog", "comment": null}, "company": {"type": "STRING", "index": 5, "name": "company", "comment": null}, "created_at": {"type": "DATETIME", "index": 6, "name": "created_at", "comment": null}, "hireable": {"type": "BOOL", "index": 7, "name": "hireable", "comment": null}, "location": {"type": "STRING", "index": 8, "name": "location", "comment": null}, "login": {"type": "STRING", "index": 9, "name": "login", "comment": null}, "name": {"type": "STRING", "index": 10, "name": "name", "comment": null}, "site_admin": {"type": "BOOL", "index": 11, "name": "site_admin", "comment": null}, "type": {"type": "STRING", "index": 12, "name": "type", "comment": null}, "updated_at": {"type": "DATETIME", "index": 13, "name": "updated_at", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 7405.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 17.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_user_data"}, "model.github_source.stg_github__pull_request_review_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__pull_request_review_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "commit_sha": {"type": "STRING", "index": 4, "name": "commit_sha", "comment": null}, "pull_request_id": {"type": "INT64", "index": 5, "name": "pull_request_id", "comment": null}, "state": {"type": "STRING", "index": 6, "name": "state", "comment": null}, "submitted_at": {"type": "TIMESTAMP", "index": 7, "name": "submitted_at", "comment": null}, "user_id": {"type": "INT64", "index": 8, "name": "user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__pull_request_review_tmp"}, "seed.github_integration_tests.github_requested_reviewer_history_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_requested_reviewer_history_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"created_at": {"type": "TIMESTAMP", "index": 1, "name": "created_at", "comment": null}, "pull_request_id": {"type": "INT64", "index": 2, "name": "pull_request_id", "comment": null}, "requested_id": {"type": "INT64", "index": 3, "name": "requested_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 5, "name": "actor_id", "comment": null}, "removed": {"type": "BOOL", "index": 6, "name": "removed", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1681.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 41.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_requested_reviewer_history_data"}, "model.github_source.stg_github__requested_reviewer_history_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__requested_reviewer_history_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"created_at": {"type": "TIMESTAMP", "index": 1, "name": "created_at", "comment": null}, "pull_request_id": {"type": "INT64", "index": 2, "name": "pull_request_id", "comment": null}, "requested_id": {"type": "INT64", "index": 3, "name": "requested_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 5, "name": "actor_id", "comment": null}, "removed": {"type": "BOOL", "index": 6, "name": "removed", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__requested_reviewer_history_tmp"}, "seed.github_integration_tests.github_issue_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "closed_at": {"type": "TIMESTAMP", "index": 4, "name": "closed_at", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 5, "name": "created_at", "comment": null}, "locked": {"type": "BOOL", "index": 6, "name": "locked", "comment": null}, "milestone_id": {"type": "INT64", "index": 7, "name": "milestone_id", "comment": null}, "number": {"type": "INT64", "index": 8, "name": "number", "comment": null}, "pull_request": {"type": "BOOL", "index": 9, "name": "pull_request", "comment": null}, "repository_id": {"type": "INT64", "index": 10, "name": "repository_id", "comment": null}, "state": {"type": "STRING", "index": 11, "name": "state", "comment": null}, "title": {"type": "STRING", "index": 12, "name": "title", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 13, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 14, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 40530.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 197.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_data"}, "model.github_source.stg_github__issue_assignee_tmp": {"metadata": {"type": "view", "schema": "github_integration_tests", "name": "stg_github__issue_assignee_tmp", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "user_id": {"type": "INT64", "index": 2, "name": "user_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_assignee_tmp"}, "seed.github_integration_tests.github_team_data": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_team_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "description": {"type": "STRING", "index": 3, "name": "description", "comment": null}, "name": {"type": "STRING", "index": 4, "name": "name", "comment": null}, "org_id": {"type": "INT64", "index": 5, "name": "org_id", "comment": null}, "parent_id": {"type": "INT64", "index": 6, "name": "parent_id", "comment": null}, "privacy": {"type": "STRING", "index": 7, "name": "privacy", "comment": null}, "slug": {"type": "STRING", "index": 8, "name": "slug", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2346.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 19.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_team_data"}, "model.github_source.stg_github__issue_closed_history": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "stg_github__issue_closed_history", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 2, "name": "updated_at", "comment": null}, "is_closed": {"type": "BOOL", "index": 3, "name": "is_closed", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2907.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 171.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_closed_history"}}, "sources": {"source.github_source.github.pull_request_review": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_pull_request_review_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "commit_sha": {"type": "STRING", "index": 4, "name": "commit_sha", "comment": null}, "pull_request_id": {"type": "INT64", "index": 5, "name": "pull_request_id", "comment": null}, "state": {"type": "STRING", "index": 6, "name": "state", "comment": null}, "submitted_at": {"type": "TIMESTAMP", "index": 7, "name": "submitted_at", "comment": null}, "user_id": {"type": "INT64", "index": 8, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 18059.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 114.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.pull_request_review"}, "source.github_source.github.issue_comment": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_comment_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "created_at": {"type": "DATETIME", "index": 4, "name": "created_at", "comment": null}, "issue_id": {"type": "INT64", "index": 5, "name": "issue_id", "comment": null}, "updated_at": {"type": "DATETIME", "index": 6, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 7, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 4902.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 43.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.issue_comment"}, "source.github_source.github.repository": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_repository_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "archived": {"type": "BOOL", "index": 3, "name": "archived", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 4, "name": "created_at", "comment": null}, "default_branch": {"type": "STRING", "index": 5, "name": "default_branch", "comment": null}, "description": {"type": "STRING", "index": 6, "name": "description", "comment": null}, "fork": {"type": "BOOL", "index": 7, "name": "fork", "comment": null}, "full_name": {"type": "STRING", "index": 8, "name": "full_name", "comment": null}, "homepage": {"type": "INT64", "index": 9, "name": "homepage", "comment": null}, "language": {"type": "STRING", "index": 10, "name": "language", "comment": null}, "name": {"type": "STRING", "index": 11, "name": "name", "comment": null}, "owner_id": {"type": "INT64", "index": 12, "name": "owner_id", "comment": null}, "private": {"type": "BOOL", "index": 13, "name": "private", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 5793.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 24.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.repository"}, "source.github_source.github.issue_merged": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_merged_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"commit_sha": {"type": "STRING", "index": 1, "name": "commit_sha", "comment": null}, "issue_id": {"type": "INT64", "index": 2, "name": "issue_id", "comment": null}, "merged_at": {"type": "TIMESTAMP", "index": 3, "name": "merged_at", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 5, "name": "actor_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 8140.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 110.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.issue_merged"}, "source.github_source.github.issue_label": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_label_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "label_id": {"type": "INT64", "index": 2, "name": "label_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1104.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 46.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.issue_label"}, "source.github_source.github.issue_assignee": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_assignee_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "user_id": {"type": "INT64", "index": 2, "name": "user_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 4800.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 200.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.issue_assignee"}, "source.github_source.github.label": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_label_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "color": {"type": "STRING", "index": 3, "name": "color", "comment": null}, "description": {"type": "STRING", "index": 4, "name": "description", "comment": null}, "is_default": {"type": "BOOL", "index": 5, "name": "is_default", "comment": null}, "name": {"type": "STRING", "index": 6, "name": "name", "comment": null}, "url": {"type": "STRING", "index": 7, "name": "url", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2016.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 15.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.label"}, "source.github_source.github.repo_team": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_repo_team_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"repository_id": {"type": "INT64", "index": 1, "name": "repository_id", "comment": null}, "team_id": {"type": "INT64", "index": 2, "name": "team_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "permission": {"type": "STRING", "index": 4, "name": "permission", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 464.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 8.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.repo_team"}, "source.github_source.github.pull_request": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_pull_request_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "base_label": {"type": "STRING", "index": 3, "name": "base_label", "comment": null}, "base_ref": {"type": "STRING", "index": 4, "name": "base_ref", "comment": null}, "base_repo_id": {"type": "INT64", "index": 5, "name": "base_repo_id", "comment": null}, "base_sha": {"type": "STRING", "index": 6, "name": "base_sha", "comment": null}, "base_user_id": {"type": "INT64", "index": 7, "name": "base_user_id", "comment": null}, "head_label": {"type": "STRING", "index": 8, "name": "head_label", "comment": null}, "head_ref": {"type": "STRING", "index": 9, "name": "head_ref", "comment": null}, "head_repo_id": {"type": "INT64", "index": 10, "name": "head_repo_id", "comment": null}, "head_sha": {"type": "STRING", "index": 11, "name": "head_sha", "comment": null}, "head_user_id": {"type": "INT64", "index": 12, "name": "head_user_id", "comment": null}, "issue_id": {"type": "INT64", "index": 13, "name": "issue_id", "comment": null}, "merge_commit_sha": {"type": "STRING", "index": 14, "name": "merge_commit_sha", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 56627.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 167.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.pull_request"}, "source.github_source.github.issue_closed_history": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_closed_history_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"issue_id": {"type": "INT64", "index": 1, "name": "issue_id", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 2, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 3, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 4, "name": "actor_id", "comment": null}, "closed": {"type": "BOOL", "index": 5, "name": "closed", "comment": null}, "commit_sha": {"type": "INT64", "index": 6, "name": "commit_sha", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 5643.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 171.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.issue_closed_history"}, "source.github_source.github.user": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_user_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "bio": {"type": "STRING", "index": 3, "name": "bio", "comment": null}, "blog": {"type": "STRING", "index": 4, "name": "blog", "comment": null}, "company": {"type": "STRING", "index": 5, "name": "company", "comment": null}, "created_at": {"type": "DATETIME", "index": 6, "name": "created_at", "comment": null}, "hireable": {"type": "BOOL", "index": 7, "name": "hireable", "comment": null}, "location": {"type": "STRING", "index": 8, "name": "location", "comment": null}, "login": {"type": "STRING", "index": 9, "name": "login", "comment": null}, "name": {"type": "STRING", "index": 10, "name": "name", "comment": null}, "site_admin": {"type": "BOOL", "index": 11, "name": "site_admin", "comment": null}, "type": {"type": "STRING", "index": 12, "name": "type", "comment": null}, "updated_at": {"type": "DATETIME", "index": 13, "name": "updated_at", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 7405.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 17.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.user"}, "source.github_source.github.requested_reviewer_history": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_requested_reviewer_history_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"created_at": {"type": "TIMESTAMP", "index": 1, "name": "created_at", "comment": null}, "pull_request_id": {"type": "INT64", "index": 2, "name": "pull_request_id", "comment": null}, "requested_id": {"type": "INT64", "index": 3, "name": "requested_id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "INT64", "index": 5, "name": "actor_id", "comment": null}, "removed": {"type": "BOOL", "index": 6, "name": "removed", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 1681.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 41.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.requested_reviewer_history"}, "source.github_source.github.issue": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_issue_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "STRING", "index": 3, "name": "body", "comment": null}, "closed_at": {"type": "TIMESTAMP", "index": 4, "name": "closed_at", "comment": null}, "created_at": {"type": "TIMESTAMP", "index": 5, "name": "created_at", "comment": null}, "locked": {"type": "BOOL", "index": 6, "name": "locked", "comment": null}, "milestone_id": {"type": "INT64", "index": 7, "name": "milestone_id", "comment": null}, "number": {"type": "INT64", "index": 8, "name": "number", "comment": null}, "pull_request": {"type": "BOOL", "index": 9, "name": "pull_request", "comment": null}, "repository_id": {"type": "INT64", "index": 10, "name": "repository_id", "comment": null}, "state": {"type": "STRING", "index": 11, "name": "state", "comment": null}, "title": {"type": "STRING", "index": 12, "name": "title", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 13, "name": "updated_at", "comment": null}, "user_id": {"type": "INT64", "index": 14, "name": "user_id", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 40530.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 197.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.issue"}, "source.github_source.github.team": {"metadata": {"type": "table", "schema": "github_integration_tests", "name": "github_team_data", "database": "dbt-package-testing", "comment": null, "owner": null}, "columns": {"id": {"type": "INT64", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "TIMESTAMP", "index": 2, "name": "_fivetran_synced", "comment": null}, "description": {"type": "STRING", "index": 3, "name": "description", "comment": null}, "name": {"type": "STRING", "index": 4, "name": "name", "comment": null}, "org_id": {"type": "INT64", "index": 5, "name": "org_id", "comment": null}, "parent_id": {"type": "INT64", "index": 6, "name": "parent_id", "comment": null}, "privacy": {"type": "STRING", "index": 7, "name": "privacy", "comment": null}, "slug": {"type": "STRING", "index": 8, "name": "slug", "comment": null}}, "stats": {"num_bytes": {"id": "num_bytes", "label": "Approximate Size", "value": 2346.0, "include": true, "description": "Approximate size of table as reported by BigQuery"}, "num_rows": {"id": "num_rows", "label": "# Rows", "value": 19.0, "include": true, "description": "Approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.team"}}, "errors": null} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "1.3.0", "generated_at": "2022-12-19T20:25:29.508014Z", "invocation_id": "a5b4f899-7713-4d70-b134-5ae04769f65c", "env": {}}, "nodes": {"model.github.github__daily_metrics": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "github__daily_metrics", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"day": {"type": "timestamp without time zone", "index": 1, "name": "day", "comment": null}, "number_issues_opened": {"type": "bigint", "index": 2, "name": "number_issues_opened", "comment": null}, "number_issues_closed": {"type": "bigint", "index": 3, "name": "number_issues_closed", "comment": null}, "sum_days_issue_open": {"type": "double precision", "index": 4, "name": "sum_days_issue_open", "comment": null}, "longest_days_issue_open": {"type": "double precision", "index": 5, "name": "longest_days_issue_open", "comment": null}, "number_prs_opened": {"type": "bigint", "index": 6, "name": "number_prs_opened", "comment": null}, "number_prs_merged": {"type": "bigint", "index": 7, "name": "number_prs_merged", "comment": null}, "number_prs_closed_without_merge": {"type": "bigint", "index": 8, "name": "number_prs_closed_without_merge", "comment": null}, "sum_days_pr_open": {"type": "double precision", "index": 9, "name": "sum_days_pr_open", "comment": null}, "longest_days_pr_open": {"type": "double precision", "index": 10, "name": "longest_days_pr_open", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__daily_metrics"}, "model.github.github__issues": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "github__issues", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"issue_id": {"type": "integer", "index": 1, "name": "issue_id", "comment": null}, "body": {"type": "text", "index": 2, "name": "body", "comment": null}, "closed_at": {"type": "timestamp without time zone", "index": 3, "name": "closed_at", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 4, "name": "created_at", "comment": null}, "is_locked": {"type": "boolean", "index": 5, "name": "is_locked", "comment": null}, "milestone_id": {"type": "integer", "index": 6, "name": "milestone_id", "comment": null}, "issue_number": {"type": "integer", "index": 7, "name": "issue_number", "comment": null}, "is_pull_request": {"type": "boolean", "index": 8, "name": "is_pull_request", "comment": null}, "repository_id": {"type": "integer", "index": 9, "name": "repository_id", "comment": null}, "state": {"type": "text", "index": 10, "name": "state", "comment": null}, "title": {"type": "text", "index": 11, "name": "title", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 12, "name": "updated_at", "comment": null}, "user_id": {"type": "integer", "index": 13, "name": "user_id", "comment": null}, "url_link": {"type": "text", "index": 14, "name": "url_link", "comment": null}, "days_issue_open": {"type": "double precision", "index": 15, "name": "days_issue_open", "comment": null}, "number_of_times_reopened": {"type": "bigint", "index": 16, "name": "number_of_times_reopened", "comment": null}, "labels": {"type": "text", "index": 17, "name": "labels", "comment": null}, "number_of_comments": {"type": "bigint", "index": 18, "name": "number_of_comments", "comment": null}, "repository": {"type": "text", "index": 19, "name": "repository", "comment": null}, "repository_team_names": {"type": "text", "index": 20, "name": "repository_team_names", "comment": null}, "assignees": {"type": "text", "index": 21, "name": "assignees", "comment": null}, "creator_login_name": {"type": "text", "index": 22, "name": "creator_login_name", "comment": null}, "creator_name": {"type": "text", "index": 23, "name": "creator_name", "comment": null}, "creator_company": {"type": "text", "index": 24, "name": "creator_company", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__issues"}, "model.github.github__monthly_metrics": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "github__monthly_metrics", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"month": {"type": "timestamp without time zone", "index": 1, "name": "month", "comment": null}, "number_issues_opened": {"type": "numeric", "index": 2, "name": "number_issues_opened", "comment": null}, "number_issues_closed": {"type": "numeric", "index": 3, "name": "number_issues_closed", "comment": null}, "avg_days_issue_open": {"type": "double precision", "index": 4, "name": "avg_days_issue_open", "comment": null}, "longest_days_issue_open": {"type": "double precision", "index": 5, "name": "longest_days_issue_open", "comment": null}, "number_prs_opened": {"type": "numeric", "index": 6, "name": "number_prs_opened", "comment": null}, "number_prs_merged": {"type": "numeric", "index": 7, "name": "number_prs_merged", "comment": null}, "number_prs_closed_without_merge": {"type": "numeric", "index": 8, "name": "number_prs_closed_without_merge", "comment": null}, "avg_days_pr_open": {"type": "double precision", "index": 9, "name": "avg_days_pr_open", "comment": null}, "longest_days_pr_open": {"type": "double precision", "index": 10, "name": "longest_days_pr_open", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__monthly_metrics"}, "model.github.github__pull_requests": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "github__pull_requests", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"issue_id": {"type": "integer", "index": 1, "name": "issue_id", "comment": null}, "body": {"type": "text", "index": 2, "name": "body", "comment": null}, "closed_at": {"type": "timestamp without time zone", "index": 3, "name": "closed_at", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 4, "name": "created_at", "comment": null}, "is_locked": {"type": "boolean", "index": 5, "name": "is_locked", "comment": null}, "milestone_id": {"type": "integer", "index": 6, "name": "milestone_id", "comment": null}, "issue_number": {"type": "integer", "index": 7, "name": "issue_number", "comment": null}, "is_pull_request": {"type": "boolean", "index": 8, "name": "is_pull_request", "comment": null}, "repository_id": {"type": "integer", "index": 9, "name": "repository_id", "comment": null}, "state": {"type": "text", "index": 10, "name": "state", "comment": null}, "title": {"type": "text", "index": 11, "name": "title", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 12, "name": "updated_at", "comment": null}, "user_id": {"type": "integer", "index": 13, "name": "user_id", "comment": null}, "url_link": {"type": "text", "index": 14, "name": "url_link", "comment": null}, "days_issue_open": {"type": "double precision", "index": 15, "name": "days_issue_open", "comment": null}, "number_of_times_reopened": {"type": "bigint", "index": 16, "name": "number_of_times_reopened", "comment": null}, "labels": {"type": "text", "index": 17, "name": "labels", "comment": null}, "number_of_comments": {"type": "bigint", "index": 18, "name": "number_of_comments", "comment": null}, "repository": {"type": "text", "index": 19, "name": "repository", "comment": null}, "repository_team_names": {"type": "text", "index": 20, "name": "repository_team_names", "comment": null}, "assignees": {"type": "text", "index": 21, "name": "assignees", "comment": null}, "creator_login_name": {"type": "text", "index": 22, "name": "creator_login_name", "comment": null}, "creator_name": {"type": "text", "index": 23, "name": "creator_name", "comment": null}, "creator_company": {"type": "text", "index": 24, "name": "creator_company", "comment": null}, "hours_request_review_to_first_review": {"type": "double precision", "index": 25, "name": "hours_request_review_to_first_review", "comment": null}, "hours_request_review_to_first_action": {"type": "double precision", "index": 26, "name": "hours_request_review_to_first_action", "comment": null}, "hours_request_review_to_merge": {"type": "double precision", "index": 27, "name": "hours_request_review_to_merge", "comment": null}, "merged_at": {"type": "timestamp without time zone", "index": 28, "name": "merged_at", "comment": null}, "reviewers": {"type": "text", "index": 29, "name": "reviewers", "comment": null}, "number_of_reviews": {"type": "bigint", "index": 30, "name": "number_of_reviews", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__pull_requests"}, "model.github.github__quarterly_metrics": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "github__quarterly_metrics", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"quarter": {"type": "timestamp without time zone", "index": 1, "name": "quarter", "comment": null}, "number_issues_opened": {"type": "numeric", "index": 2, "name": "number_issues_opened", "comment": null}, "number_issues_closed": {"type": "numeric", "index": 3, "name": "number_issues_closed", "comment": null}, "avg_days_issue_open": {"type": "double precision", "index": 4, "name": "avg_days_issue_open", "comment": null}, "longest_days_issue_open": {"type": "double precision", "index": 5, "name": "longest_days_issue_open", "comment": null}, "number_prs_opened": {"type": "numeric", "index": 6, "name": "number_prs_opened", "comment": null}, "number_prs_merged": {"type": "numeric", "index": 7, "name": "number_prs_merged", "comment": null}, "number_prs_closed_without_merge": {"type": "numeric", "index": 8, "name": "number_prs_closed_without_merge", "comment": null}, "avg_days_pr_open": {"type": "double precision", "index": 9, "name": "avg_days_pr_open", "comment": null}, "longest_days_pr_open": {"type": "double precision", "index": 10, "name": "longest_days_pr_open", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__quarterly_metrics"}, "model.github.github__weekly_metrics": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "github__weekly_metrics", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"week": {"type": "timestamp without time zone", "index": 1, "name": "week", "comment": null}, "number_issues_opened": {"type": "numeric", "index": 2, "name": "number_issues_opened", "comment": null}, "number_issues_closed": {"type": "numeric", "index": 3, "name": "number_issues_closed", "comment": null}, "avg_days_issue_open": {"type": "double precision", "index": 4, "name": "avg_days_issue_open", "comment": null}, "longest_days_issue_open": {"type": "double precision", "index": 5, "name": "longest_days_issue_open", "comment": null}, "number_prs_opened": {"type": "numeric", "index": 6, "name": "number_prs_opened", "comment": null}, "number_prs_merged": {"type": "numeric", "index": 7, "name": "number_prs_merged", "comment": null}, "number_prs_closed_without_merge": {"type": "numeric", "index": 8, "name": "number_prs_closed_without_merge", "comment": null}, "avg_days_pr_open": {"type": "double precision", "index": 9, "name": "avg_days_pr_open", "comment": null}, "longest_days_pr_open": {"type": "double precision", "index": 10, "name": "longest_days_pr_open", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github.github__weekly_metrics"}, "seed.github_integration_tests.github_issue_assignee_data": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "github_issue_assignee_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"issue_id": {"type": "integer", "index": 1, "name": "issue_id", "comment": null}, "user_id": {"type": "integer", "index": 2, "name": "user_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_assignee_data"}, "seed.github_integration_tests.github_issue_closed_history_data": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "github_issue_closed_history_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"issue_id": {"type": "integer", "index": 1, "name": "issue_id", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 2, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "integer", "index": 4, "name": "actor_id", "comment": null}, "closed": {"type": "boolean", "index": 5, "name": "closed", "comment": null}, "commit_sha": {"type": "integer", "index": 6, "name": "commit_sha", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_closed_history_data"}, "seed.github_integration_tests.github_issue_comment_data": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "github_issue_comment_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "text", "index": 3, "name": "body", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 4, "name": "created_at", "comment": null}, "issue_id": {"type": "integer", "index": 5, "name": "issue_id", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 6, "name": "updated_at", "comment": null}, "user_id": {"type": "integer", "index": 7, "name": "user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_comment_data"}, "seed.github_integration_tests.github_issue_data": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "github_issue_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "text", "index": 3, "name": "body", "comment": null}, "closed_at": {"type": "timestamp without time zone", "index": 4, "name": "closed_at", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 5, "name": "created_at", "comment": null}, "locked": {"type": "boolean", "index": 6, "name": "locked", "comment": null}, "milestone_id": {"type": "integer", "index": 7, "name": "milestone_id", "comment": null}, "number": {"type": "integer", "index": 8, "name": "number", "comment": null}, "pull_request": {"type": "boolean", "index": 9, "name": "pull_request", "comment": null}, "repository_id": {"type": "integer", "index": 10, "name": "repository_id", "comment": null}, "state": {"type": "text", "index": 11, "name": "state", "comment": null}, "title": {"type": "text", "index": 12, "name": "title", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 13, "name": "updated_at", "comment": null}, "user_id": {"type": "integer", "index": 14, "name": "user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_data"}, "seed.github_integration_tests.github_issue_label_data": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "github_issue_label_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"issue_id": {"type": "bigint", "index": 1, "name": "issue_id", "comment": null}, "label_id": {"type": "bigint", "index": 2, "name": "label_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_label_data"}, "seed.github_integration_tests.github_issue_merged_data": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "github_issue_merged_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"commit_sha": {"type": "text", "index": 1, "name": "commit_sha", "comment": null}, "issue_id": {"type": "integer", "index": 2, "name": "issue_id", "comment": null}, "merged_at": {"type": "timestamp without time zone", "index": 3, "name": "merged_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "integer", "index": 5, "name": "actor_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_issue_merged_data"}, "seed.github_integration_tests.github_label_data": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "github_label_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "color": {"type": "text", "index": 3, "name": "color", "comment": null}, "description": {"type": "text", "index": 4, "name": "description", "comment": null}, "is_default": {"type": "boolean", "index": 5, "name": "is_default", "comment": null}, "name": {"type": "text", "index": 6, "name": "name", "comment": null}, "url": {"type": "text", "index": 7, "name": "url", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_label_data"}, "seed.github_integration_tests.github_pull_request_data": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "github_pull_request_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "base_label": {"type": "text", "index": 3, "name": "base_label", "comment": null}, "base_ref": {"type": "text", "index": 4, "name": "base_ref", "comment": null}, "base_repo_id": {"type": "integer", "index": 5, "name": "base_repo_id", "comment": null}, "base_sha": {"type": "text", "index": 6, "name": "base_sha", "comment": null}, "base_user_id": {"type": "integer", "index": 7, "name": "base_user_id", "comment": null}, "head_label": {"type": "text", "index": 8, "name": "head_label", "comment": null}, "head_ref": {"type": "text", "index": 9, "name": "head_ref", "comment": null}, "head_repo_id": {"type": "integer", "index": 10, "name": "head_repo_id", "comment": null}, "head_sha": {"type": "text", "index": 11, "name": "head_sha", "comment": null}, "head_user_id": {"type": "integer", "index": 12, "name": "head_user_id", "comment": null}, "issue_id": {"type": "integer", "index": 13, "name": "issue_id", "comment": null}, "merge_commit_sha": {"type": "text", "index": 14, "name": "merge_commit_sha", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_pull_request_data"}, "seed.github_integration_tests.github_pull_request_review_data": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "github_pull_request_review_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "text", "index": 3, "name": "body", "comment": null}, "commit_sha": {"type": "text", "index": 4, "name": "commit_sha", "comment": null}, "pull_request_id": {"type": "integer", "index": 5, "name": "pull_request_id", "comment": null}, "state": {"type": "text", "index": 6, "name": "state", "comment": null}, "submitted_at": {"type": "timestamp without time zone", "index": 7, "name": "submitted_at", "comment": null}, "user_id": {"type": "integer", "index": 8, "name": "user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_pull_request_review_data"}, "seed.github_integration_tests.github_repo_team_data": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "github_repo_team_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"repository_id": {"type": "integer", "index": 1, "name": "repository_id", "comment": null}, "team_id": {"type": "integer", "index": 2, "name": "team_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "permission": {"type": "text", "index": 4, "name": "permission", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_repo_team_data"}, "seed.github_integration_tests.github_repository_data": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "github_repository_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "archived": {"type": "boolean", "index": 3, "name": "archived", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 4, "name": "created_at", "comment": null}, "default_branch": {"type": "text", "index": 5, "name": "default_branch", "comment": null}, "description": {"type": "text", "index": 6, "name": "description", "comment": null}, "fork": {"type": "boolean", "index": 7, "name": "fork", "comment": null}, "full_name": {"type": "text", "index": 8, "name": "full_name", "comment": null}, "homepage": {"type": "integer", "index": 9, "name": "homepage", "comment": null}, "language": {"type": "text", "index": 10, "name": "language", "comment": null}, "name": {"type": "text", "index": 11, "name": "name", "comment": null}, "owner_id": {"type": "integer", "index": 12, "name": "owner_id", "comment": null}, "private": {"type": "boolean", "index": 13, "name": "private", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_repository_data"}, "seed.github_integration_tests.github_requested_reviewer_history_data": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "github_requested_reviewer_history_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"created_at": {"type": "timestamp without time zone", "index": 1, "name": "created_at", "comment": null}, "pull_request_id": {"type": "integer", "index": 2, "name": "pull_request_id", "comment": null}, "requested_id": {"type": "integer", "index": 3, "name": "requested_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "integer", "index": 5, "name": "actor_id", "comment": null}, "removed": {"type": "boolean", "index": 6, "name": "removed", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_requested_reviewer_history_data"}, "seed.github_integration_tests.github_team_data": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "github_team_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "description": {"type": "text", "index": 3, "name": "description", "comment": null}, "name": {"type": "text", "index": 4, "name": "name", "comment": null}, "org_id": {"type": "integer", "index": 5, "name": "org_id", "comment": null}, "parent_id": {"type": "integer", "index": 6, "name": "parent_id", "comment": null}, "privacy": {"type": "text", "index": 7, "name": "privacy", "comment": null}, "slug": {"type": "text", "index": 8, "name": "slug", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_team_data"}, "seed.github_integration_tests.github_user_data": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "github_user_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "bio": {"type": "text", "index": 3, "name": "bio", "comment": null}, "blog": {"type": "text", "index": 4, "name": "blog", "comment": null}, "company": {"type": "text", "index": 5, "name": "company", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "hireable": {"type": "boolean", "index": 7, "name": "hireable", "comment": null}, "location": {"type": "text", "index": 8, "name": "location", "comment": null}, "login": {"type": "text", "index": 9, "name": "login", "comment": null}, "name": {"type": "text", "index": 10, "name": "name", "comment": null}, "site_admin": {"type": "boolean", "index": 11, "name": "site_admin", "comment": null}, "type": {"type": "text", "index": 12, "name": "type", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 13, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.github_integration_tests.github_user_data"}, "model.github_source.stg_github__issue": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "stg_github__issue", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"issue_id": {"type": "integer", "index": 1, "name": "issue_id", "comment": null}, "body": {"type": "text", "index": 2, "name": "body", "comment": null}, "closed_at": {"type": "timestamp without time zone", "index": 3, "name": "closed_at", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 4, "name": "created_at", "comment": null}, "is_locked": {"type": "boolean", "index": 5, "name": "is_locked", "comment": null}, "milestone_id": {"type": "integer", "index": 6, "name": "milestone_id", "comment": null}, "issue_number": {"type": "integer", "index": 7, "name": "issue_number", "comment": null}, "is_pull_request": {"type": "boolean", "index": 8, "name": "is_pull_request", "comment": null}, "repository_id": {"type": "integer", "index": 9, "name": "repository_id", "comment": null}, "state": {"type": "text", "index": 10, "name": "state", "comment": null}, "title": {"type": "text", "index": 11, "name": "title", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 12, "name": "updated_at", "comment": null}, "user_id": {"type": "integer", "index": 13, "name": "user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue"}, "model.github_source.stg_github__issue_assignee": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "stg_github__issue_assignee", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"issue_id": {"type": "integer", "index": 1, "name": "issue_id", "comment": null}, "user_id": {"type": "integer", "index": 2, "name": "user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_assignee"}, "model.github_source.stg_github__issue_assignee_tmp": {"metadata": {"type": "VIEW", "schema": "github_integration_tests", "name": "stg_github__issue_assignee_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"issue_id": {"type": "integer", "index": 1, "name": "issue_id", "comment": null}, "user_id": {"type": "integer", "index": 2, "name": "user_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_assignee_tmp"}, "model.github_source.stg_github__issue_closed_history": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "stg_github__issue_closed_history", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"issue_id": {"type": "integer", "index": 1, "name": "issue_id", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 2, "name": "updated_at", "comment": null}, "is_closed": {"type": "boolean", "index": 3, "name": "is_closed", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_closed_history"}, "model.github_source.stg_github__issue_closed_history_tmp": {"metadata": {"type": "VIEW", "schema": "github_integration_tests", "name": "stg_github__issue_closed_history_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"issue_id": {"type": "integer", "index": 1, "name": "issue_id", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 2, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "integer", "index": 4, "name": "actor_id", "comment": null}, "closed": {"type": "boolean", "index": 5, "name": "closed", "comment": null}, "commit_sha": {"type": "integer", "index": 6, "name": "commit_sha", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_closed_history_tmp"}, "model.github_source.stg_github__issue_comment": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "stg_github__issue_comment", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"issue_comment_id": {"type": "bigint", "index": 1, "name": "issue_comment_id", "comment": null}, "issue_id": {"type": "integer", "index": 2, "name": "issue_id", "comment": null}, "user_id": {"type": "integer", "index": 3, "name": "user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_comment"}, "model.github_source.stg_github__issue_comment_tmp": {"metadata": {"type": "VIEW", "schema": "github_integration_tests", "name": "stg_github__issue_comment_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "text", "index": 3, "name": "body", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 4, "name": "created_at", "comment": null}, "issue_id": {"type": "integer", "index": 5, "name": "issue_id", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 6, "name": "updated_at", "comment": null}, "user_id": {"type": "integer", "index": 7, "name": "user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_comment_tmp"}, "model.github_source.stg_github__issue_label": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "stg_github__issue_label", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"issue_id": {"type": "bigint", "index": 1, "name": "issue_id", "comment": null}, "label_id": {"type": "bigint", "index": 2, "name": "label_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_label"}, "model.github_source.stg_github__issue_label_tmp": {"metadata": {"type": "VIEW", "schema": "github_integration_tests", "name": "stg_github__issue_label_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"issue_id": {"type": "bigint", "index": 1, "name": "issue_id", "comment": null}, "label_id": {"type": "bigint", "index": 2, "name": "label_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_label_tmp"}, "model.github_source.stg_github__issue_merged": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "stg_github__issue_merged", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"issue_id": {"type": "integer", "index": 1, "name": "issue_id", "comment": null}, "merged_at": {"type": "timestamp without time zone", "index": 2, "name": "merged_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_merged"}, "model.github_source.stg_github__issue_merged_tmp": {"metadata": {"type": "VIEW", "schema": "github_integration_tests", "name": "stg_github__issue_merged_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"commit_sha": {"type": "text", "index": 1, "name": "commit_sha", "comment": null}, "issue_id": {"type": "integer", "index": 2, "name": "issue_id", "comment": null}, "merged_at": {"type": "timestamp without time zone", "index": 3, "name": "merged_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "integer", "index": 5, "name": "actor_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_merged_tmp"}, "model.github_source.stg_github__issue_tmp": {"metadata": {"type": "VIEW", "schema": "github_integration_tests", "name": "stg_github__issue_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "text", "index": 3, "name": "body", "comment": null}, "closed_at": {"type": "timestamp without time zone", "index": 4, "name": "closed_at", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 5, "name": "created_at", "comment": null}, "locked": {"type": "boolean", "index": 6, "name": "locked", "comment": null}, "milestone_id": {"type": "integer", "index": 7, "name": "milestone_id", "comment": null}, "number": {"type": "integer", "index": 8, "name": "number", "comment": null}, "pull_request": {"type": "boolean", "index": 9, "name": "pull_request", "comment": null}, "repository_id": {"type": "integer", "index": 10, "name": "repository_id", "comment": null}, "state": {"type": "text", "index": 11, "name": "state", "comment": null}, "title": {"type": "text", "index": 12, "name": "title", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 13, "name": "updated_at", "comment": null}, "user_id": {"type": "integer", "index": 14, "name": "user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__issue_tmp"}, "model.github_source.stg_github__label": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "stg_github__label", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"label_id": {"type": "bigint", "index": 1, "name": "label_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "color": {"type": "text", "index": 3, "name": "color", "comment": null}, "description": {"type": "text", "index": 4, "name": "description", "comment": null}, "is_default": {"type": "boolean", "index": 5, "name": "is_default", "comment": null}, "label": {"type": "text", "index": 6, "name": "label", "comment": null}, "url": {"type": "text", "index": 7, "name": "url", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__label"}, "model.github_source.stg_github__label_tmp": {"metadata": {"type": "VIEW", "schema": "github_integration_tests", "name": "stg_github__label_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "color": {"type": "text", "index": 3, "name": "color", "comment": null}, "description": {"type": "text", "index": 4, "name": "description", "comment": null}, "is_default": {"type": "boolean", "index": 5, "name": "is_default", "comment": null}, "name": {"type": "text", "index": 6, "name": "name", "comment": null}, "url": {"type": "text", "index": 7, "name": "url", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__label_tmp"}, "model.github_source.stg_github__pull_request": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "stg_github__pull_request", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"pull_request_id": {"type": "integer", "index": 1, "name": "pull_request_id", "comment": null}, "issue_id": {"type": "integer", "index": 2, "name": "issue_id", "comment": null}, "head_repo_id": {"type": "integer", "index": 3, "name": "head_repo_id", "comment": null}, "head_user_id": {"type": "integer", "index": 4, "name": "head_user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__pull_request"}, "model.github_source.stg_github__pull_request_review": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "stg_github__pull_request_review", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"pull_request_review_id": {"type": "bigint", "index": 1, "name": "pull_request_review_id", "comment": null}, "pull_request_id": {"type": "integer", "index": 2, "name": "pull_request_id", "comment": null}, "submitted_at": {"type": "timestamp without time zone", "index": 3, "name": "submitted_at", "comment": null}, "state": {"type": "text", "index": 4, "name": "state", "comment": null}, "user_id": {"type": "integer", "index": 5, "name": "user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__pull_request_review"}, "model.github_source.stg_github__pull_request_review_tmp": {"metadata": {"type": "VIEW", "schema": "github_integration_tests", "name": "stg_github__pull_request_review_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "text", "index": 3, "name": "body", "comment": null}, "commit_sha": {"type": "text", "index": 4, "name": "commit_sha", "comment": null}, "pull_request_id": {"type": "integer", "index": 5, "name": "pull_request_id", "comment": null}, "state": {"type": "text", "index": 6, "name": "state", "comment": null}, "submitted_at": {"type": "timestamp without time zone", "index": 7, "name": "submitted_at", "comment": null}, "user_id": {"type": "integer", "index": 8, "name": "user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__pull_request_review_tmp"}, "model.github_source.stg_github__pull_request_tmp": {"metadata": {"type": "VIEW", "schema": "github_integration_tests", "name": "stg_github__pull_request_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "base_label": {"type": "text", "index": 3, "name": "base_label", "comment": null}, "base_ref": {"type": "text", "index": 4, "name": "base_ref", "comment": null}, "base_repo_id": {"type": "integer", "index": 5, "name": "base_repo_id", "comment": null}, "base_sha": {"type": "text", "index": 6, "name": "base_sha", "comment": null}, "base_user_id": {"type": "integer", "index": 7, "name": "base_user_id", "comment": null}, "head_label": {"type": "text", "index": 8, "name": "head_label", "comment": null}, "head_ref": {"type": "text", "index": 9, "name": "head_ref", "comment": null}, "head_repo_id": {"type": "integer", "index": 10, "name": "head_repo_id", "comment": null}, "head_sha": {"type": "text", "index": 11, "name": "head_sha", "comment": null}, "head_user_id": {"type": "integer", "index": 12, "name": "head_user_id", "comment": null}, "issue_id": {"type": "integer", "index": 13, "name": "issue_id", "comment": null}, "merge_commit_sha": {"type": "text", "index": 14, "name": "merge_commit_sha", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__pull_request_tmp"}, "model.github_source.stg_github__repo_team": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "stg_github__repo_team", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"repository_id": {"type": "integer", "index": 1, "name": "repository_id", "comment": null}, "team_id": {"type": "integer", "index": 2, "name": "team_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__repo_team"}, "model.github_source.stg_github__repo_team_tmp": {"metadata": {"type": "VIEW", "schema": "github_integration_tests", "name": "stg_github__repo_team_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"repository_id": {"type": "integer", "index": 1, "name": "repository_id", "comment": null}, "team_id": {"type": "integer", "index": 2, "name": "team_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "permission": {"type": "text", "index": 4, "name": "permission", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__repo_team_tmp"}, "model.github_source.stg_github__repository": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "stg_github__repository", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"repository_id": {"type": "integer", "index": 1, "name": "repository_id", "comment": null}, "full_name": {"type": "text", "index": 2, "name": "full_name", "comment": null}, "is_private": {"type": "boolean", "index": 3, "name": "is_private", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__repository"}, "model.github_source.stg_github__repository_tmp": {"metadata": {"type": "VIEW", "schema": "github_integration_tests", "name": "stg_github__repository_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "archived": {"type": "boolean", "index": 3, "name": "archived", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 4, "name": "created_at", "comment": null}, "default_branch": {"type": "text", "index": 5, "name": "default_branch", "comment": null}, "description": {"type": "text", "index": 6, "name": "description", "comment": null}, "fork": {"type": "boolean", "index": 7, "name": "fork", "comment": null}, "full_name": {"type": "text", "index": 8, "name": "full_name", "comment": null}, "homepage": {"type": "integer", "index": 9, "name": "homepage", "comment": null}, "language": {"type": "text", "index": 10, "name": "language", "comment": null}, "name": {"type": "text", "index": 11, "name": "name", "comment": null}, "owner_id": {"type": "integer", "index": 12, "name": "owner_id", "comment": null}, "private": {"type": "boolean", "index": 13, "name": "private", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__repository_tmp"}, "model.github_source.stg_github__requested_reviewer_history": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "stg_github__requested_reviewer_history", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"pull_request_id": {"type": "integer", "index": 1, "name": "pull_request_id", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 2, "name": "created_at", "comment": null}, "requested_id": {"type": "integer", "index": 3, "name": "requested_id", "comment": null}, "removed": {"type": "boolean", "index": 4, "name": "removed", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__requested_reviewer_history"}, "model.github_source.stg_github__requested_reviewer_history_tmp": {"metadata": {"type": "VIEW", "schema": "github_integration_tests", "name": "stg_github__requested_reviewer_history_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"created_at": {"type": "timestamp without time zone", "index": 1, "name": "created_at", "comment": null}, "pull_request_id": {"type": "integer", "index": 2, "name": "pull_request_id", "comment": null}, "requested_id": {"type": "integer", "index": 3, "name": "requested_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "integer", "index": 5, "name": "actor_id", "comment": null}, "removed": {"type": "boolean", "index": 6, "name": "removed", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__requested_reviewer_history_tmp"}, "model.github_source.stg_github__team": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "stg_github__team", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"team_id": {"type": "integer", "index": 1, "name": "team_id", "comment": null}, "description": {"type": "text", "index": 2, "name": "description", "comment": null}, "name": {"type": "text", "index": 3, "name": "name", "comment": null}, "parent_id": {"type": "integer", "index": 4, "name": "parent_id", "comment": null}, "privacy": {"type": "text", "index": 5, "name": "privacy", "comment": null}, "slug": {"type": "text", "index": 6, "name": "slug", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__team"}, "model.github_source.stg_github__team_tmp": {"metadata": {"type": "VIEW", "schema": "github_integration_tests", "name": "stg_github__team_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "description": {"type": "text", "index": 3, "name": "description", "comment": null}, "name": {"type": "text", "index": 4, "name": "name", "comment": null}, "org_id": {"type": "integer", "index": 5, "name": "org_id", "comment": null}, "parent_id": {"type": "integer", "index": 6, "name": "parent_id", "comment": null}, "privacy": {"type": "text", "index": 7, "name": "privacy", "comment": null}, "slug": {"type": "text", "index": 8, "name": "slug", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__team_tmp"}, "model.github_source.stg_github__user": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "stg_github__user", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"user_id": {"type": "integer", "index": 1, "name": "user_id", "comment": null}, "login_name": {"type": "text", "index": 2, "name": "login_name", "comment": null}, "name": {"type": "text", "index": 3, "name": "name", "comment": null}, "company": {"type": "text", "index": 4, "name": "company", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__user"}, "model.github_source.stg_github__user_tmp": {"metadata": {"type": "VIEW", "schema": "github_integration_tests", "name": "stg_github__user_tmp", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "bio": {"type": "text", "index": 3, "name": "bio", "comment": null}, "blog": {"type": "text", "index": 4, "name": "blog", "comment": null}, "company": {"type": "text", "index": 5, "name": "company", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "hireable": {"type": "boolean", "index": 7, "name": "hireable", "comment": null}, "location": {"type": "text", "index": 8, "name": "location", "comment": null}, "login": {"type": "text", "index": 9, "name": "login", "comment": null}, "name": {"type": "text", "index": 10, "name": "name", "comment": null}, "site_admin": {"type": "boolean", "index": 11, "name": "site_admin", "comment": null}, "type": {"type": "text", "index": 12, "name": "type", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 13, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.github_source.stg_github__user_tmp"}}, "sources": {"source.github_source.github.issue_assignee": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "github_issue_assignee_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"issue_id": {"type": "integer", "index": 1, "name": "issue_id", "comment": null}, "user_id": {"type": "integer", "index": 2, "name": "user_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.issue_assignee"}, "source.github_source.github.issue_closed_history": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "github_issue_closed_history_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"issue_id": {"type": "integer", "index": 1, "name": "issue_id", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 2, "name": "updated_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "integer", "index": 4, "name": "actor_id", "comment": null}, "closed": {"type": "boolean", "index": 5, "name": "closed", "comment": null}, "commit_sha": {"type": "integer", "index": 6, "name": "commit_sha", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.issue_closed_history"}, "source.github_source.github.issue_comment": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "github_issue_comment_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "text", "index": 3, "name": "body", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 4, "name": "created_at", "comment": null}, "issue_id": {"type": "integer", "index": 5, "name": "issue_id", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 6, "name": "updated_at", "comment": null}, "user_id": {"type": "integer", "index": 7, "name": "user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.issue_comment"}, "source.github_source.github.issue": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "github_issue_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "text", "index": 3, "name": "body", "comment": null}, "closed_at": {"type": "timestamp without time zone", "index": 4, "name": "closed_at", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 5, "name": "created_at", "comment": null}, "locked": {"type": "boolean", "index": 6, "name": "locked", "comment": null}, "milestone_id": {"type": "integer", "index": 7, "name": "milestone_id", "comment": null}, "number": {"type": "integer", "index": 8, "name": "number", "comment": null}, "pull_request": {"type": "boolean", "index": 9, "name": "pull_request", "comment": null}, "repository_id": {"type": "integer", "index": 10, "name": "repository_id", "comment": null}, "state": {"type": "text", "index": 11, "name": "state", "comment": null}, "title": {"type": "text", "index": 12, "name": "title", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 13, "name": "updated_at", "comment": null}, "user_id": {"type": "integer", "index": 14, "name": "user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.issue"}, "source.github_source.github.issue_label": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "github_issue_label_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"issue_id": {"type": "bigint", "index": 1, "name": "issue_id", "comment": null}, "label_id": {"type": "bigint", "index": 2, "name": "label_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.issue_label"}, "source.github_source.github.issue_merged": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "github_issue_merged_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"commit_sha": {"type": "text", "index": 1, "name": "commit_sha", "comment": null}, "issue_id": {"type": "integer", "index": 2, "name": "issue_id", "comment": null}, "merged_at": {"type": "timestamp without time zone", "index": 3, "name": "merged_at", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "integer", "index": 5, "name": "actor_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.issue_merged"}, "source.github_source.github.label": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "github_label_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "color": {"type": "text", "index": 3, "name": "color", "comment": null}, "description": {"type": "text", "index": 4, "name": "description", "comment": null}, "is_default": {"type": "boolean", "index": 5, "name": "is_default", "comment": null}, "name": {"type": "text", "index": 6, "name": "name", "comment": null}, "url": {"type": "text", "index": 7, "name": "url", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.label"}, "source.github_source.github.pull_request": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "github_pull_request_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "base_label": {"type": "text", "index": 3, "name": "base_label", "comment": null}, "base_ref": {"type": "text", "index": 4, "name": "base_ref", "comment": null}, "base_repo_id": {"type": "integer", "index": 5, "name": "base_repo_id", "comment": null}, "base_sha": {"type": "text", "index": 6, "name": "base_sha", "comment": null}, "base_user_id": {"type": "integer", "index": 7, "name": "base_user_id", "comment": null}, "head_label": {"type": "text", "index": 8, "name": "head_label", "comment": null}, "head_ref": {"type": "text", "index": 9, "name": "head_ref", "comment": null}, "head_repo_id": {"type": "integer", "index": 10, "name": "head_repo_id", "comment": null}, "head_sha": {"type": "text", "index": 11, "name": "head_sha", "comment": null}, "head_user_id": {"type": "integer", "index": 12, "name": "head_user_id", "comment": null}, "issue_id": {"type": "integer", "index": 13, "name": "issue_id", "comment": null}, "merge_commit_sha": {"type": "text", "index": 14, "name": "merge_commit_sha", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.pull_request"}, "source.github_source.github.pull_request_review": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "github_pull_request_review_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "bigint", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "body": {"type": "text", "index": 3, "name": "body", "comment": null}, "commit_sha": {"type": "text", "index": 4, "name": "commit_sha", "comment": null}, "pull_request_id": {"type": "integer", "index": 5, "name": "pull_request_id", "comment": null}, "state": {"type": "text", "index": 6, "name": "state", "comment": null}, "submitted_at": {"type": "timestamp without time zone", "index": 7, "name": "submitted_at", "comment": null}, "user_id": {"type": "integer", "index": 8, "name": "user_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.pull_request_review"}, "source.github_source.github.repo_team": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "github_repo_team_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"repository_id": {"type": "integer", "index": 1, "name": "repository_id", "comment": null}, "team_id": {"type": "integer", "index": 2, "name": "team_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_synced", "comment": null}, "permission": {"type": "text", "index": 4, "name": "permission", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.repo_team"}, "source.github_source.github.repository": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "github_repository_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "archived": {"type": "boolean", "index": 3, "name": "archived", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 4, "name": "created_at", "comment": null}, "default_branch": {"type": "text", "index": 5, "name": "default_branch", "comment": null}, "description": {"type": "text", "index": 6, "name": "description", "comment": null}, "fork": {"type": "boolean", "index": 7, "name": "fork", "comment": null}, "full_name": {"type": "text", "index": 8, "name": "full_name", "comment": null}, "homepage": {"type": "integer", "index": 9, "name": "homepage", "comment": null}, "language": {"type": "text", "index": 10, "name": "language", "comment": null}, "name": {"type": "text", "index": 11, "name": "name", "comment": null}, "owner_id": {"type": "integer", "index": 12, "name": "owner_id", "comment": null}, "private": {"type": "boolean", "index": 13, "name": "private", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.repository"}, "source.github_source.github.requested_reviewer_history": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "github_requested_reviewer_history_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"created_at": {"type": "timestamp without time zone", "index": 1, "name": "created_at", "comment": null}, "pull_request_id": {"type": "integer", "index": 2, "name": "pull_request_id", "comment": null}, "requested_id": {"type": "integer", "index": 3, "name": "requested_id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_synced", "comment": null}, "actor_id": {"type": "integer", "index": 5, "name": "actor_id", "comment": null}, "removed": {"type": "boolean", "index": 6, "name": "removed", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.requested_reviewer_history"}, "source.github_source.github.team": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "github_team_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "description": {"type": "text", "index": 3, "name": "description", "comment": null}, "name": {"type": "text", "index": 4, "name": "name", "comment": null}, "org_id": {"type": "integer", "index": 5, "name": "org_id", "comment": null}, "parent_id": {"type": "integer", "index": 6, "name": "parent_id", "comment": null}, "privacy": {"type": "text", "index": 7, "name": "privacy", "comment": null}, "slug": {"type": "text", "index": 8, "name": "slug", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.team"}, "source.github_source.github.user": {"metadata": {"type": "BASE TABLE", "schema": "github_integration_tests", "name": "github_user_data", "database": "postgres", "comment": null, "owner": "pguser"}, "columns": {"id": {"type": "integer", "index": 1, "name": "id", "comment": null}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": null}, "bio": {"type": "text", "index": 3, "name": "bio", "comment": null}, "blog": {"type": "text", "index": 4, "name": "blog", "comment": null}, "company": {"type": "text", "index": 5, "name": "company", "comment": null}, "created_at": {"type": "timestamp without time zone", "index": 6, "name": "created_at", "comment": null}, "hireable": {"type": "boolean", "index": 7, "name": "hireable", "comment": null}, "location": {"type": "text", "index": 8, "name": "location", "comment": null}, "login": {"type": "text", "index": 9, "name": "login", "comment": null}, "name": {"type": "text", "index": 10, "name": "name", "comment": null}, "site_admin": {"type": "boolean", "index": 11, "name": "site_admin", "comment": null}, "type": {"type": "text", "index": 12, "name": "type", "comment": null}, "updated_at": {"type": "timestamp without time zone", "index": 13, "name": "updated_at", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.github_source.github.user"}}, "errors": null} \ No newline at end of file diff --git a/docs/manifest.json b/docs/manifest.json index 919505d..4c43c0e 100644 --- a/docs/manifest.json +++ b/docs/manifest.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v7.json", "dbt_version": "1.3.0", "generated_at": "2022-11-07T19:30:30.182876Z", "invocation_id": "373a774a-fbd2-4652-b5ce-ec2e726cba75", "env": {}, "project_id": "b4ed7eda1f97e936d48d60e52edb4717", "user_id": "535a716f-60c0-47b9-9763-5e1b450166b6", "send_anonymous_usage_stats": true, "adapter_type": "bigquery"}, "nodes": {"seed.github_integration_tests.github_pull_request_review_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "INT64", "submitted_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_pull_request_review_data"], "unique_id": "seed.github_integration_tests.github_pull_request_review_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests", "path": "github_pull_request_review_data.csv", "original_file_path": "seeds/github_pull_request_review_data.csv", "name": "github_pull_request_review_data", "alias": "github_pull_request_review_data", "checksum": {"name": "sha256", "checksum": "4bdebf989d5e5d1bf41df343300be0a7e2a12f74b8148de6a97e75118edf0efa"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "submitted_at": "timestamp"}}, "created_at": 1667849268.624969, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_pull_request_review_data`"}, "seed.github_integration_tests.github_label_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "INT64"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_label_data"], "unique_id": "seed.github_integration_tests.github_label_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests", "path": "github_label_data.csv", "original_file_path": "seeds/github_label_data.csv", "name": "github_label_data", "alias": "github_label_data", "checksum": {"name": "sha256", "checksum": "f47357ad7761ae8e671c889ce5e385f6916b78cb669dfc65f09bacea1ecafb1f"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "created_at": 1667849268.64153, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_label_data`"}, "seed.github_integration_tests.github_repository_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "created_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_repository_data"], "unique_id": "seed.github_integration_tests.github_repository_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests", "path": "github_repository_data.csv", "original_file_path": "seeds/github_repository_data.csv", "name": "github_repository_data", "alias": "github_repository_data", "checksum": {"name": "sha256", "checksum": "78cd55c70468340db27d24a3fc299fc8c191129ca26ea80620a0d796a608a1a4"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"created_at": "timestamp"}}, "created_at": 1667849268.645775, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_repository_data`"}, "seed.github_integration_tests.github_issue_merged_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "merged_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_issue_merged_data"], "unique_id": "seed.github_integration_tests.github_issue_merged_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests", "path": "github_issue_merged_data.csv", "original_file_path": "seeds/github_issue_merged_data.csv", "name": "github_issue_merged_data", "alias": "github_issue_merged_data", "checksum": {"name": "sha256", "checksum": "397efa928dca45bafbdc11219b3335265bd9a6cce1447c02e07c0bf53ddaba31"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"merged_at": "timestamp"}}, "created_at": 1667849268.64978, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_merged_data`"}, "seed.github_integration_tests.github_issue_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "closed_at": "timestamp", "created_at": "timestamp", "updated_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_issue_data"], "unique_id": "seed.github_integration_tests.github_issue_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests", "path": "github_issue_data.csv", "original_file_path": "seeds/github_issue_data.csv", "name": "github_issue_data", "alias": "github_issue_data", "checksum": {"name": "sha256", "checksum": "6eabcc9bc0920d64775f8058446b279e803384a2205f18a07d7a2f1ebcf89286"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"closed_at": "timestamp", "created_at": "timestamp", "updated_at": "timestamp"}}, "created_at": 1667849268.653825, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_data`"}, "seed.github_integration_tests.github_repo_team_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_repo_team_data"], "unique_id": "seed.github_integration_tests.github_repo_team_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests", "path": "github_repo_team_data.csv", "original_file_path": "seeds/github_repo_team_data.csv", "name": "github_repo_team_data", "alias": "github_repo_team_data", "checksum": {"name": "sha256", "checksum": "3a16bf772f5f15231f0d7e26c116041543fad5a9dbdabbdfec30ddd063058722"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1667849268.65782, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_repo_team_data`"}, "seed.github_integration_tests.github_requested_reviewer_history_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "created_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_requested_reviewer_history_data"], "unique_id": "seed.github_integration_tests.github_requested_reviewer_history_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests", "path": "github_requested_reviewer_history_data.csv", "original_file_path": "seeds/github_requested_reviewer_history_data.csv", "name": "github_requested_reviewer_history_data", "alias": "github_requested_reviewer_history_data", "checksum": {"name": "sha256", "checksum": "91225ac95874fc314f772530dfcb6ece74f35c292ea5bba53ff86b599b902743"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"created_at": "timestamp"}}, "created_at": 1667849268.6619892, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_requested_reviewer_history_data`"}, "seed.github_integration_tests.github_issue_label_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "issue_id": "INT64", "label_id": "INT64"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_issue_label_data"], "unique_id": "seed.github_integration_tests.github_issue_label_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests", "path": "github_issue_label_data.csv", "original_file_path": "seeds/github_issue_label_data.csv", "name": "github_issue_label_data", "alias": "github_issue_label_data", "checksum": {"name": "sha256", "checksum": "847ef3245b5610a81f3d8e91b4787d24829b2b0d3d064c529a61d430e90f0585"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"issue_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "label_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "created_at": 1667849268.665987, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_label_data`"}, "seed.github_integration_tests.github_issue_comment_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "INT64"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_issue_comment_data"], "unique_id": "seed.github_integration_tests.github_issue_comment_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests", "path": "github_issue_comment_data.csv", "original_file_path": "seeds/github_issue_comment_data.csv", "name": "github_issue_comment_data", "alias": "github_issue_comment_data", "checksum": {"name": "sha256", "checksum": "6cc173c061308bc4de703c7c5d0fc30228b2c86117ed7db1daf9decf1a4238cd"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "created_at": 1667849268.6699939, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_comment_data`"}, "seed.github_integration_tests.github_issue_assignee_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_issue_assignee_data"], "unique_id": "seed.github_integration_tests.github_issue_assignee_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests", "path": "github_issue_assignee_data.csv", "original_file_path": "seeds/github_issue_assignee_data.csv", "name": "github_issue_assignee_data", "alias": "github_issue_assignee_data", "checksum": {"name": "sha256", "checksum": "fe25fadc4593349b873b50da5e2e2fbf436cbb3c1bcfe325c3340c64a7d8972b"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1667849268.674279, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_assignee_data`"}, "seed.github_integration_tests.github_issue_closed_history_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "updated_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_issue_closed_history_data"], "unique_id": "seed.github_integration_tests.github_issue_closed_history_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests", "path": "github_issue_closed_history_data.csv", "original_file_path": "seeds/github_issue_closed_history_data.csv", "name": "github_issue_closed_history_data", "alias": "github_issue_closed_history_data", "checksum": {"name": "sha256", "checksum": "5f281ce9e29e69280633dc6aae2e9f8028c86815442821a608bb793c82aab3f1"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"updated_at": "timestamp"}}, "created_at": 1667849268.678182, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_closed_history_data`"}, "seed.github_integration_tests.github_pull_request_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_pull_request_data"], "unique_id": "seed.github_integration_tests.github_pull_request_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests", "path": "github_pull_request_data.csv", "original_file_path": "seeds/github_pull_request_data.csv", "name": "github_pull_request_data", "alias": "github_pull_request_data", "checksum": {"name": "sha256", "checksum": "1e27d3e9b6881a3fda6402b048071032411d81612ff4b2009d852a194b137006"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1667849268.6820421, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_pull_request_data`"}, "seed.github_integration_tests.github_team_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_team_data"], "unique_id": "seed.github_integration_tests.github_team_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests", "path": "github_team_data.csv", "original_file_path": "seeds/github_team_data.csv", "name": "github_team_data", "alias": "github_team_data", "checksum": {"name": "sha256", "checksum": "a3916608387192c2bcec219067bd19e3280a23a3d4f546390e5d7e9aa16420bd"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1667849268.685923, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_team_data`"}, "seed.github_integration_tests.github_user_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_user_data"], "unique_id": "seed.github_integration_tests.github_user_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests", "path": "github_user_data.csv", "original_file_path": "seeds/github_user_data.csv", "name": "github_user_data", "alias": "github_user_data", "checksum": {"name": "sha256", "checksum": "5d101839c6a685fac17231a071c6516f3ac668b133d7a96a83d97ede20f16e46"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1667849268.690111, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_user_data`"}, "model.github.github__weekly_metrics": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.date_trunc"], "nodes": ["model.github.github__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "github__weekly_metrics"], "unique_id": "model.github.github__weekly_metrics", "raw_code": "with daily_metrics as (\n select *\n from {{ ref('github__daily_metrics') }}\n)\n\nselect \n {{ dbt.date_trunc('week', 'day') }} as week, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__weekly_metrics.sql", "original_file_path": "models/github__weekly_metrics.sql", "name": "github__weekly_metrics", "alias": "github__weekly_metrics", "checksum": {"name": "sha256", "checksum": "0c23e13d9ae5aa9256b832965069a021826131bbcf8c23be244b660d1a513870"}, "tags": [], "refs": [["github__daily_metrics"]], "sources": [], "metrics": [], "description": "Summary numbers for issues and pull requests by week\n", "columns": {"week": {"name": "week", "description": "The reporting week", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_opened": {"name": "number_issues_opened", "description": "The total number of issues created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_closed": {"name": "number_issues_closed", "description": "The total number of issues closed during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_issue_open": {"name": "avg_days_issue_open", "description": "The average number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_issue_open": {"name": "longest_days_issue_open", "description": "The longest number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_opened": {"name": "number_prs_opened", "description": "The total number of pull requests created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_merged": {"name": "number_prs_merged", "description": "The total number of pull requests merged during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_closed_without_merge": {"name": "number_prs_closed_without_merge", "description": "The total number of pull requests closed without a merge during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_pr_open": {"name": "avg_days_pr_open", "description": "The average number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_pr_open": {"name": "longest_days_pr_open", "description": "The longest number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__weekly_metrics.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667849269.493291, "compiled_code": "with daily_metrics as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`github__daily_metrics`\n)\n\nselect \n timestamp_trunc(\n cast(day as timestamp),\n week\n ) as week, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github__weekly_metrics`"}, "model.github.github__monthly_metrics": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.date_trunc"], "nodes": ["model.github.github__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "github__monthly_metrics"], "unique_id": "model.github.github__monthly_metrics", "raw_code": "with daily_metrics as (\n select *\n from {{ ref('github__daily_metrics') }}\n)\n\nselect \n {{ dbt.date_trunc('month', 'day') }} as month, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__monthly_metrics.sql", "original_file_path": "models/github__monthly_metrics.sql", "name": "github__monthly_metrics", "alias": "github__monthly_metrics", "checksum": {"name": "sha256", "checksum": "13125ad4966c9d1caa3cd74e6174cc3845a7ceb7929836e849e70628af2b0d0d"}, "tags": [], "refs": [["github__daily_metrics"]], "sources": [], "metrics": [], "description": "Summary numbers for issues and pull requests by month\n", "columns": {"month": {"name": "month", "description": "The reporting month", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_opened": {"name": "number_issues_opened", "description": "The total number of issues created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_closed": {"name": "number_issues_closed", "description": "The total number of issues closed during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_issue_open": {"name": "avg_days_issue_open", "description": "The average number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_issue_open": {"name": "longest_days_issue_open", "description": "The longest number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_opened": {"name": "number_prs_opened", "description": "The total number of pull requests created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_merged": {"name": "number_prs_merged", "description": "The total number of pull requests merged during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_closed_without_merge": {"name": "number_prs_closed_without_merge", "description": "The total number of pull requests closed without a merge during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_pr_open": {"name": "avg_days_pr_open", "description": "The average number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_pr_open": {"name": "longest_days_pr_open", "description": "The longest number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__monthly_metrics.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667849269.4994829, "compiled_code": "with daily_metrics as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`github__daily_metrics`\n)\n\nselect \n timestamp_trunc(\n cast(day as timestamp),\n month\n ) as month, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github__monthly_metrics`"}, "model.github.github__quarterly_metrics": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.date_trunc"], "nodes": ["model.github.github__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "github__quarterly_metrics"], "unique_id": "model.github.github__quarterly_metrics", "raw_code": "with daily_metrics as (\n select *\n from {{ ref('github__daily_metrics') }}\n)\n\nselect \n {{ dbt.date_trunc('quarter', 'day') }} as quarter, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\n\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__quarterly_metrics.sql", "original_file_path": "models/github__quarterly_metrics.sql", "name": "github__quarterly_metrics", "alias": "github__quarterly_metrics", "checksum": {"name": "sha256", "checksum": "482a40e9b5ae8283bec98905910cc35747f7f98accd058453d69064844533c50"}, "tags": [], "refs": [["github__daily_metrics"]], "sources": [], "metrics": [], "description": "Summary numbers for issues and pull requests by quarter\n", "columns": {"quarter": {"name": "quarter", "description": "The reporting quarter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_opened": {"name": "number_issues_opened", "description": "The total number of issues created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_closed": {"name": "number_issues_closed", "description": "The total number of issues closed during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_issue_open": {"name": "avg_days_issue_open", "description": "The average number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_issue_open": {"name": "longest_days_issue_open", "description": "The longest number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_opened": {"name": "number_prs_opened", "description": "The total number of pull requests created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_merged": {"name": "number_prs_merged", "description": "The total number of pull requests merged during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_closed_without_merge": {"name": "number_prs_closed_without_merge", "description": "The total number of pull requests closed without a merge during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_pr_open": {"name": "avg_days_pr_open", "description": "The average number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_pr_open": {"name": "longest_days_pr_open", "description": "The longest number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__quarterly_metrics.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667849269.505698, "compiled_code": "with daily_metrics as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`github__daily_metrics`\n)\n\nselect \n timestamp_trunc(\n cast(day as timestamp),\n quarter\n ) as quarter, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\n\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github__quarterly_metrics`"}, "model.github.github__pull_requests": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.github.int_github__issue_joined"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "github__pull_requests"], "unique_id": "model.github.github__pull_requests", "raw_code": "with issue_joined as (\n select *\n from {{ ref('int_github__issue_joined') }} \n)\n\nselect\n *\nfrom issue_joined\nwhere is_pull_request", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__pull_requests.sql", "original_file_path": "models/github__pull_requests.sql", "name": "github__pull_requests", "alias": "github__pull_requests", "checksum": {"name": "sha256", "checksum": "ab4761ae05c0aabc7585d92ed7c68e12b53317a47a4278810e1777a051f43350"}, "tags": [], "refs": [["int_github__issue_joined"]], "sources": [], "metrics": [], "description": "Basic information about pull_requests as well as additional fields about reviews and time between actions\n", "columns": {"issue_id": {"name": "issue_id", "description": "The unique ID of an issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "body": {"name": "body", "description": "the text body of the description of the pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed_at": {"name": "closed_at", "description": "Timestamp of when the pull request was closed. NULL for pull requests that are still open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the pull request was created", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_locked": {"name": "is_locked", "description": "Boolean indicating whether the issue is locked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "milestone_id": {"name": "milestone_id", "description": "Foreign key that references the milestone.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_pull_request": {"name": "is_pull_request", "description": "Boolean indiciating whether the issue is a pull request.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_number": {"name": "issue_number", "description": "The number of the pull request. Unique within a repository, but not accross.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_id": {"name": "repository_id", "description": "Foreign key that references the repository table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the issue was last updated", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "days_issue_open": {"name": "days_issue_open", "description": "The number of days an issue has been open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_times_reopened": {"name": "number_of_times_reopened", "description": "Total number of times the issue was reopened", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_comments": {"name": "number_of_comments", "description": "The total number of comments included in the issue", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_login_name": {"name": "creator_login_name", "description": "User that created the issue login name", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_name": {"name": "creator_name", "description": "User that created the issue name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_company": {"name": "creator_company", "description": "User that created the issue company name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the pull request is open or closed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url_link": {"name": "url_link", "description": "A link to the pull request on github.com", "meta": {}, "data_type": null, "quote": null, "tags": []}, "labels": {"name": "labels", "description": "The labels currently applied to the pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository": {"name": "repository", "description": "The repository that the pull request applies to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_team_names": {"name": "repository_team_names", "description": "An aggreate of the teams associated with the repository", "meta": {}, "data_type": null, "quote": null, "tags": []}, "assignees": {"name": "assignees", "description": "Users who have been assigned to the pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hours_request_review_to_first_review": {"name": "hours_request_review_to_first_review", "description": "Number of hours between the first request for review and a review", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hours_request_review_to_first_action": {"name": "hours_request_review_to_first_action", "description": "Number of hours between the first request for review and any action besides dismissing the request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hours_request_review_to_merge": {"name": "hours_request_review_to_merge", "description": "Number of hours between the first request for review and the pull request being merged", "meta": {}, "data_type": null, "quote": null, "tags": []}, "merged_at": {"name": "merged_at", "description": "Timestamp of when the pull request was merged", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reviewers": {"name": "reviewers", "description": "List of Users who reviewed the pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_reviews": {"name": "number_of_reviews", "description": "Number of times a pull request was reviewed", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__pull_requests.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667849269.4811258, "compiled_code": "with __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n), __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n), __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n), __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n), __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n), __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n), __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n), __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n), __dbt__cte__int_github__issue_joined as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_labels as (\n select *\n from __dbt__cte__int_github__issue_labels\n), \n\nrepository_teams as (\n select \n \n *\n from __dbt__cte__int_github__repository_teams\n\n \n), \n\nissue_assignees as (\n select *\n from __dbt__cte__int_github__issue_assignees\n), \n\nissue_open_length as (\n select *\n from __dbt__cte__int_github__issue_open_length\n), \n\nissue_comments as (\n select *\n from __dbt__cte__int_github__issue_comments\n), \n\ncreator as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n), \n\npull_request_times as (\n select *\n from __dbt__cte__int_github__pull_request_times\n), \n\npull_request_reviewers as (\n select *\n from __dbt__cte__int_github__pull_request_reviewers\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then 'https://github.com/' || repository_teams.repository || '/pull/' || issue.issue_number\n else 'https://github.com/' || repository_teams.repository || '/issues/' || issue.issue_number\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n \n repository_teams.repository_team_names,\n \n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id\n),issue_joined as (\n select *\n from __dbt__cte__int_github__issue_joined \n)\n\nselect\n *\nfrom issue_joined\nwhere is_pull_request", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.github.int_github__issue_label_joined", "sql": " __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n)"}, {"id": "model.github.int_github__issue_labels", "sql": " __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n)"}, {"id": "model.github.int_github__repository_teams", "sql": " __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n)"}, {"id": "model.github.int_github__issue_assignees", "sql": " __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n)"}, {"id": "model.github.int_github__issue_open_length", "sql": " __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n)"}, {"id": "model.github.int_github__issue_comments", "sql": " __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n)"}, {"id": "model.github.int_github__pull_request_times", "sql": " __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n)"}, {"id": "model.github.int_github__pull_request_reviewers", "sql": " __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n)"}, {"id": "model.github.int_github__issue_joined", "sql": " __dbt__cte__int_github__issue_joined as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_labels as (\n select *\n from __dbt__cte__int_github__issue_labels\n), \n\nrepository_teams as (\n select \n \n *\n from __dbt__cte__int_github__repository_teams\n\n \n), \n\nissue_assignees as (\n select *\n from __dbt__cte__int_github__issue_assignees\n), \n\nissue_open_length as (\n select *\n from __dbt__cte__int_github__issue_open_length\n), \n\nissue_comments as (\n select *\n from __dbt__cte__int_github__issue_comments\n), \n\ncreator as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n), \n\npull_request_times as (\n select *\n from __dbt__cte__int_github__pull_request_times\n), \n\npull_request_reviewers as (\n select *\n from __dbt__cte__int_github__pull_request_reviewers\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then 'https://github.com/' || repository_teams.repository || '/pull/' || issue.issue_number\n else 'https://github.com/' || repository_teams.repository || '/issues/' || issue.issue_number\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n \n repository_teams.repository_team_names,\n \n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id\n)"}], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github__pull_requests`"}, "model.github.github__daily_metrics": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.date_trunc"], "nodes": ["model.github.github__issues", "model.github.github__pull_requests"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "github__daily_metrics"], "unique_id": "model.github.github__daily_metrics", "raw_code": "with github_issues as (\n select *\n from {{ ref('github__issues') }}\n), \n\npull_requests as (\n select *\n from {{ ref('github__pull_requests') }}\n), \n\nissues_opened_per_day as (\n select \n {{ dbt.date_trunc('day', 'created_at') }} as day, \n count(*) as number_issues_opened,\n sum(days_issue_open) as sum_days_issue_open,\n max(days_issue_open) as longest_days_issue_open\n from github_issues\n group by 1\n), \n\nissues_closed_per_day as (\n select \n {{ dbt.date_trunc('day', 'closed_at') }} as day, \n count(*) as number_issues_closed\n from github_issues\n where closed_at is not null\n group by 1\n), \n\nprs_opened_per_day as (\n select \n {{ dbt.date_trunc('day', 'created_at') }} as day, \n count(*) as number_prs_opened,\n sum(days_issue_open) as sum_days_pr_open,\n max(days_issue_open) as longest_days_pr_open\n from pull_requests\n group by 1\n), \n\nprs_merged_per_day as (\n select \n {{ dbt.date_trunc('day', 'merged_at') }} as day, \n count(*) as number_prs_merged\n from pull_requests\n where merged_at is not null\n group by 1\n), \n\nprs_closed_without_merge_per_day as (\n select \n {{ dbt.date_trunc('day', 'closed_at') }} as day, \n count(*) as number_prs_closed_without_merge\n from pull_requests\n where closed_at is not null\n and merged_at is null\n group by 1\n), \n\nissues_per_day as (\n select \n coalesce(issues_opened_per_day.day, \n issues_closed_per_day.day\n ) as day,\n number_issues_opened,\n number_issues_closed, \n sum_days_issue_open,\n longest_days_issue_open\n from issues_opened_per_day\n full outer join issues_closed_per_day on issues_opened_per_day.day = issues_closed_per_day.day\n), \n\nprs_per_day as (\n select \n coalesce(prs_opened_per_day.day, \n prs_merged_per_day.day,\n prs_closed_without_merge_per_day.day\n ) as day,\n number_prs_opened,\n number_prs_merged,\n number_prs_closed_without_merge,\n sum_days_pr_open,\n longest_days_pr_open\n from prs_opened_per_day\n full outer join prs_merged_per_day on prs_opened_per_day.day = prs_merged_per_day.day\n full outer join prs_closed_without_merge_per_day on coalesce(prs_opened_per_day.day, prs_merged_per_day.day) = prs_closed_without_merge_per_day.day\n)\n\nselect \n coalesce(issues_per_day.day, prs_per_day.day) as day,\n coalesce(number_issues_opened, 0) as number_issues_opened,\n coalesce(number_issues_closed, 0) as number_issues_closed,\n sum_days_issue_open,\n longest_days_issue_open,\n coalesce(number_prs_opened, 0) as number_prs_opened,\n coalesce(number_prs_merged, 0) as number_prs_merged,\n coalesce(number_prs_closed_without_merge, 0) as number_prs_closed_without_merge,\n sum_days_pr_open,\n longest_days_pr_open\nfrom issues_per_day \nfull outer join prs_per_day on issues_per_day.day = prs_per_day.day\norder by day desc", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__daily_metrics.sql", "original_file_path": "models/github__daily_metrics.sql", "name": "github__daily_metrics", "alias": "github__daily_metrics", "checksum": {"name": "sha256", "checksum": "a6ee3eb9c8198f8b11e48b8e0206e90860a02af8a20f748985a58499dde4f476"}, "tags": [], "refs": [["github__issues"], ["github__pull_requests"]], "sources": [], "metrics": [], "description": "Summary numbers for issues and pull requests by day\n", "columns": {"day": {"name": "day", "description": "The reporting day", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_opened": {"name": "number_issues_opened", "description": "The total number of issues created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_closed": {"name": "number_issues_closed", "description": "The total number of issues closed during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sum_days_issue_open": {"name": "sum_days_issue_open", "description": "The total number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_issue_open": {"name": "longest_days_issue_open", "description": "The longest number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_opened": {"name": "number_prs_opened", "description": "The total number of pull requests created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_merged": {"name": "number_prs_merged", "description": "The total number of pull requests merged during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_closed_without_merge": {"name": "number_prs_closed_without_merge", "description": "The total number of pull requests closed without a merge during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sum_days_pr_open": {"name": "sum_days_pr_open", "description": "The total number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_pr_open": {"name": "longest_days_pr_open", "description": "The longest number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__daily_metrics.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667849269.487303, "compiled_code": "with github_issues as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`github__issues`\n), \n\npull_requests as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`github__pull_requests`\n), \n\nissues_opened_per_day as (\n select \n timestamp_trunc(\n cast(created_at as timestamp),\n day\n ) as day, \n count(*) as number_issues_opened,\n sum(days_issue_open) as sum_days_issue_open,\n max(days_issue_open) as longest_days_issue_open\n from github_issues\n group by 1\n), \n\nissues_closed_per_day as (\n select \n timestamp_trunc(\n cast(closed_at as timestamp),\n day\n ) as day, \n count(*) as number_issues_closed\n from github_issues\n where closed_at is not null\n group by 1\n), \n\nprs_opened_per_day as (\n select \n timestamp_trunc(\n cast(created_at as timestamp),\n day\n ) as day, \n count(*) as number_prs_opened,\n sum(days_issue_open) as sum_days_pr_open,\n max(days_issue_open) as longest_days_pr_open\n from pull_requests\n group by 1\n), \n\nprs_merged_per_day as (\n select \n timestamp_trunc(\n cast(merged_at as timestamp),\n day\n ) as day, \n count(*) as number_prs_merged\n from pull_requests\n where merged_at is not null\n group by 1\n), \n\nprs_closed_without_merge_per_day as (\n select \n timestamp_trunc(\n cast(closed_at as timestamp),\n day\n ) as day, \n count(*) as number_prs_closed_without_merge\n from pull_requests\n where closed_at is not null\n and merged_at is null\n group by 1\n), \n\nissues_per_day as (\n select \n coalesce(issues_opened_per_day.day, \n issues_closed_per_day.day\n ) as day,\n number_issues_opened,\n number_issues_closed, \n sum_days_issue_open,\n longest_days_issue_open\n from issues_opened_per_day\n full outer join issues_closed_per_day on issues_opened_per_day.day = issues_closed_per_day.day\n), \n\nprs_per_day as (\n select \n coalesce(prs_opened_per_day.day, \n prs_merged_per_day.day,\n prs_closed_without_merge_per_day.day\n ) as day,\n number_prs_opened,\n number_prs_merged,\n number_prs_closed_without_merge,\n sum_days_pr_open,\n longest_days_pr_open\n from prs_opened_per_day\n full outer join prs_merged_per_day on prs_opened_per_day.day = prs_merged_per_day.day\n full outer join prs_closed_without_merge_per_day on coalesce(prs_opened_per_day.day, prs_merged_per_day.day) = prs_closed_without_merge_per_day.day\n)\n\nselect \n coalesce(issues_per_day.day, prs_per_day.day) as day,\n coalesce(number_issues_opened, 0) as number_issues_opened,\n coalesce(number_issues_closed, 0) as number_issues_closed,\n sum_days_issue_open,\n longest_days_issue_open,\n coalesce(number_prs_opened, 0) as number_prs_opened,\n coalesce(number_prs_merged, 0) as number_prs_merged,\n coalesce(number_prs_closed_without_merge, 0) as number_prs_closed_without_merge,\n sum_days_pr_open,\n longest_days_pr_open\nfrom issues_per_day \nfull outer join prs_per_day on issues_per_day.day = prs_per_day.day\norder by day desc", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github__daily_metrics`"}, "model.github.github__issues": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.github.int_github__issue_joined"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "github__issues"], "unique_id": "model.github.github__issues", "raw_code": "with issue_joined as (\n select *\n from {{ ref('int_github__issue_joined') }} \n)\n\nselect\n issue_id,\n body,\n closed_at,\n created_at,\n is_locked,\n milestone_id,\n issue_number,\n is_pull_request,\n repository_id,\n state,\n title,\n updated_at,\n user_id,\n url_link,\n days_issue_open,\n number_of_times_reopened,\n labels,\n number_of_comments,\n repository,\n {% if var('github__using_repo_team', true) %}\n repository_team_names,\n {% endif %}\n assignees,\n creator_login_name,\n creator_name,\n creator_company\nfrom issue_joined\nwhere not is_pull_request", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__issues.sql", "original_file_path": "models/github__issues.sql", "name": "github__issues", "alias": "github__issues", "checksum": {"name": "sha256", "checksum": "382d94f82ea63be958d53cc7353d6e3e792844f45ab9c48609e03355eb68a133"}, "tags": [], "refs": [["int_github__issue_joined"]], "sources": [], "metrics": [], "description": "Basic information about issues as well as additional fields for things like assignees, projects, labels and open time\n", "columns": {"issue_id": {"name": "issue_id", "description": "The unique ID of an issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "body": {"name": "body", "description": "The text body of the issue's main description", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed_at": {"name": "closed_at", "description": "The timestamp for when an issue was last closed. \"null\" for issues that are open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The timestamp for when an issue was created", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_locked": {"name": "is_locked", "description": "Boolean indicating if the issue is locked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "milestone_id": {"name": "milestone_id", "description": "Foreign key that references the milestone table representing the current milestone the issue is in", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_number": {"name": "issue_number", "description": "The number of the issue. Is unique within a repository, but not accross", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_pull_request": {"name": "is_pull_request", "description": "Boolean indicating whether the issue is a pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_id": {"name": "repository_id", "description": "Foreign key that references the repository table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the issue is open or closed", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the issue", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the issue was last updated", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url_link": {"name": "url_link", "description": "a link to the issue on github.com", "meta": {}, "data_type": null, "quote": null, "tags": []}, "days_issue_open": {"name": "days_issue_open", "description": "The number of days an issue has been open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_times_reopened": {"name": "number_of_times_reopened", "description": "Total number of times the issue was reopened", "meta": {}, "data_type": null, "quote": null, "tags": []}, "labels": {"name": "labels", "description": "A list of the labels that are currently applied to the issue", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_comments": {"name": "number_of_comments", "description": "The total number of comments included in the issue", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_login_name": {"name": "creator_login_name", "description": "User that created the issue login name", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_name": {"name": "creator_name", "description": "User that created the issue name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_company": {"name": "creator_company", "description": "User that created the issue company name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository": {"name": "repository", "description": "The repository that the issue is applicable to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_team_names": {"name": "repository_team_names", "description": "An aggreate of the teams associated with the repository", "meta": {}, "data_type": null, "quote": null, "tags": []}, "assignees": {"name": "assignees", "description": "The current list of users assigned to the issue", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__issues.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667849269.4645278, "compiled_code": "with __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n), __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n), __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n), __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n), __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n), __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n), __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n), __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n), __dbt__cte__int_github__issue_joined as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_labels as (\n select *\n from __dbt__cte__int_github__issue_labels\n), \n\nrepository_teams as (\n select \n \n *\n from __dbt__cte__int_github__repository_teams\n\n \n), \n\nissue_assignees as (\n select *\n from __dbt__cte__int_github__issue_assignees\n), \n\nissue_open_length as (\n select *\n from __dbt__cte__int_github__issue_open_length\n), \n\nissue_comments as (\n select *\n from __dbt__cte__int_github__issue_comments\n), \n\ncreator as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n), \n\npull_request_times as (\n select *\n from __dbt__cte__int_github__pull_request_times\n), \n\npull_request_reviewers as (\n select *\n from __dbt__cte__int_github__pull_request_reviewers\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then 'https://github.com/' || repository_teams.repository || '/pull/' || issue.issue_number\n else 'https://github.com/' || repository_teams.repository || '/issues/' || issue.issue_number\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n \n repository_teams.repository_team_names,\n \n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id\n),issue_joined as (\n select *\n from __dbt__cte__int_github__issue_joined \n)\n\nselect\n issue_id,\n body,\n closed_at,\n created_at,\n is_locked,\n milestone_id,\n issue_number,\n is_pull_request,\n repository_id,\n state,\n title,\n updated_at,\n user_id,\n url_link,\n days_issue_open,\n number_of_times_reopened,\n labels,\n number_of_comments,\n repository,\n \n repository_team_names,\n \n assignees,\n creator_login_name,\n creator_name,\n creator_company\nfrom issue_joined\nwhere not is_pull_request", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.github.int_github__issue_label_joined", "sql": " __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n)"}, {"id": "model.github.int_github__issue_labels", "sql": " __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n)"}, {"id": "model.github.int_github__repository_teams", "sql": " __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n)"}, {"id": "model.github.int_github__issue_assignees", "sql": " __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n)"}, {"id": "model.github.int_github__issue_open_length", "sql": " __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n)"}, {"id": "model.github.int_github__issue_comments", "sql": " __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n)"}, {"id": "model.github.int_github__pull_request_times", "sql": " __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n)"}, {"id": "model.github.int_github__pull_request_reviewers", "sql": " __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n)"}, {"id": "model.github.int_github__issue_joined", "sql": " __dbt__cte__int_github__issue_joined as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_labels as (\n select *\n from __dbt__cte__int_github__issue_labels\n), \n\nrepository_teams as (\n select \n \n *\n from __dbt__cte__int_github__repository_teams\n\n \n), \n\nissue_assignees as (\n select *\n from __dbt__cte__int_github__issue_assignees\n), \n\nissue_open_length as (\n select *\n from __dbt__cte__int_github__issue_open_length\n), \n\nissue_comments as (\n select *\n from __dbt__cte__int_github__issue_comments\n), \n\ncreator as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n), \n\npull_request_times as (\n select *\n from __dbt__cte__int_github__pull_request_times\n), \n\npull_request_reviewers as (\n select *\n from __dbt__cte__int_github__pull_request_reviewers\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then 'https://github.com/' || repository_teams.repository || '/pull/' || issue.issue_number\n else 'https://github.com/' || repository_teams.repository || '/issues/' || issue.issue_number\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n \n repository_teams.repository_team_names,\n \n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id\n)"}], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github__issues`"}, "model.github.int_github__pull_request_times": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt.datediff"], "nodes": ["model.github_source.stg_github__pull_request_review", "model.github_source.stg_github__pull_request", "model.github_source.stg_github__requested_reviewer_history", "model.github_source.stg_github__issue", "model.github_source.stg_github__issue_merged"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__pull_request_times"], "unique_id": "model.github.int_github__pull_request_times", "raw_code": "with pull_request_review as (\n select *\n from {{ var('pull_request_review') }}\n), \n\npull_request as (\n select *\n from {{ var('pull_request')}}\n), \n\nrequested_reviewer_history as (\n select *\n from {{ var('requested_reviewer_history')}}\n where not removed\n), \n\nissue as (\n select *\n from {{ var('issue') }}\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from {{ var('issue_merged')}}\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n {{ dbt.datediff(\n 'time_of_first_request', \n \"coalesce(time_of_first_review_post_request, \" ~ dbt.current_timestamp_backcompat() ~ \")\", \n 'second') \n }}/ 60/60 as hours_request_review_to_first_review,\n {{ dbt.datediff(\n 'time_of_first_request', \n \"least(\n coalesce(time_of_first_requested_reviewer_review, \" ~ dbt.current_timestamp_backcompat() ~ \"),\n coalesce(issue.closed_at, \" ~ dbt.current_timestamp_backcompat() ~ \"))\", \n 'second') \n }} / 60/60 as hours_request_review_to_first_action,\n {{ dbt.datediff('time_of_first_request', 'merged_at', 'second') }}/ 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__pull_request_times.sql", "original_file_path": "models/intermediate/int_github__pull_request_times.sql", "name": "int_github__pull_request_times", "alias": "int_github__pull_request_times", "checksum": {"name": "sha256", "checksum": "35a197fef6ef12f2b408564be9d54b15ba8ff1eee0cf8514abedef9f7818422c"}, "tags": [], "refs": [["stg_github__pull_request_review"], ["stg_github__pull_request"], ["stg_github__requested_reviewer_history"], ["stg_github__issue"], ["stg_github__issue_merged"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__pull_request_times.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1667849268.867358, "compiled_code": "with pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__pull_request_reviewers": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.github_source.stg_github__pull_request_review", "model.github_source.stg_github__user"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__pull_request_reviewers"], "unique_id": "model.github.int_github__pull_request_reviewers", "raw_code": "with pull_request_review as (\n select *\n from {{ var('pull_request_review') }}\n), \n\ngithub_user as (\n select *\n from {{ var('user')}}\n)\n\nselect\n pull_request_review.pull_request_id,\n {{ fivetran_utils.string_agg( 'github_user.login_name', \"', '\" )}} as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__pull_request_reviewers.sql", "original_file_path": "models/intermediate/int_github__pull_request_reviewers.sql", "name": "int_github__pull_request_reviewers", "alias": "int_github__pull_request_reviewers", "checksum": {"name": "sha256", "checksum": "fd5518273ce75ae9066be686308ee078ce9a3df73f3799620f8eb6e611655cd7"}, "tags": [], "refs": [["stg_github__pull_request_review"], ["stg_github__user"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__pull_request_reviewers.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1667849268.895701, "compiled_code": "with pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__issue_label_joined": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.github_source.stg_github__issue_label", "model.github_source.stg_github__label"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_label_joined"], "unique_id": "model.github.int_github__issue_label_joined", "raw_code": "with issue_label as (\n\n select *\n from {{ var('issue_label') }}\n\n), label as (\n\n select *\n from {{ var('label') }}\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_label_joined.sql", "original_file_path": "models/intermediate/int_github__issue_label_joined.sql", "name": "int_github__issue_label_joined", "alias": "int_github__issue_label_joined", "checksum": {"name": "sha256", "checksum": "6f1b225ff9958e67fae4ea1ba0be10ebb9426da364c758c37d0b83305d575d98"}, "tags": [], "refs": [["stg_github__issue_label"], ["stg_github__label"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_label_joined.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1667849268.909966, "compiled_code": "with issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__issue_joined": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.concat"], "nodes": ["model.github_source.stg_github__issue", "model.github.int_github__issue_labels", "model.github.int_github__repository_teams", "model.github.int_github__issue_assignees", "model.github.int_github__issue_open_length", "model.github.int_github__issue_comments", "model.github_source.stg_github__user", "model.github.int_github__pull_request_times", "model.github.int_github__pull_request_reviewers", "model.github_source.stg_github__pull_request"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_joined"], "unique_id": "model.github.int_github__issue_joined", "raw_code": "with issue as (\n select *\n from {{ var('issue') }}\n), \n\nissue_labels as (\n select *\n from {{ ref('int_github__issue_labels')}}\n), \n\nrepository_teams as (\n select \n {% if var('github__using_repo_team', true) %}\n *\n from {{ ref('int_github__repository_teams') }}\n\n {% else %}\n repository_id,\n full_name as repository\n from {{ var('repository') }}\n\n {% endif %}\n), \n\nissue_assignees as (\n select *\n from {{ ref('int_github__issue_assignees')}}\n), \n\nissue_open_length as (\n select *\n from {{ ref('int_github__issue_open_length')}}\n), \n\nissue_comments as (\n select *\n from {{ ref('int_github__issue_comments')}}\n), \n\ncreator as (\n select *\n from {{ var('user')}}\n), \n\npull_request_times as (\n select *\n from {{ ref('int_github__pull_request_times')}}\n), \n\npull_request_reviewers as (\n select *\n from {{ ref('int_github__pull_request_reviewers')}}\n), \n\npull_request as (\n select *\n from {{ var('pull_request')}}\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then {{ dbt.concat([\"'https://github.com/'\",'repository_teams.repository',\"'/pull/'\", 'issue.issue_number']) }}\n else {{ dbt.concat([\"'https://github.com/'\",'repository_teams.repository',\"'/issues/'\", 'issue.issue_number']) }}\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n {% if var('github__using_repo_team', true) %}\n repository_teams.repository_team_names,\n {% endif %}\n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_joined.sql", "original_file_path": "models/intermediate/int_github__issue_joined.sql", "name": "int_github__issue_joined", "alias": "int_github__issue_joined", "checksum": {"name": "sha256", "checksum": "75658855b696a3744360bbbf58433d6155e44d35128236e08da3df93b87ead16"}, "tags": [], "refs": [["stg_github__issue"], ["int_github__issue_labels"], ["int_github__repository_teams"], ["int_github__issue_assignees"], ["int_github__issue_open_length"], ["int_github__issue_comments"], ["stg_github__user"], ["int_github__pull_request_times"], ["int_github__pull_request_reviewers"], ["stg_github__pull_request"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_joined.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1667849268.920543, "compiled_code": "with __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n), __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n), __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n), __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n), __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n), __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n), __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n), __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n),issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_labels as (\n select *\n from __dbt__cte__int_github__issue_labels\n), \n\nrepository_teams as (\n select \n \n *\n from __dbt__cte__int_github__repository_teams\n\n \n), \n\nissue_assignees as (\n select *\n from __dbt__cte__int_github__issue_assignees\n), \n\nissue_open_length as (\n select *\n from __dbt__cte__int_github__issue_open_length\n), \n\nissue_comments as (\n select *\n from __dbt__cte__int_github__issue_comments\n), \n\ncreator as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n), \n\npull_request_times as (\n select *\n from __dbt__cte__int_github__pull_request_times\n), \n\npull_request_reviewers as (\n select *\n from __dbt__cte__int_github__pull_request_reviewers\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then 'https://github.com/' || repository_teams.repository || '/pull/' || issue.issue_number\n else 'https://github.com/' || repository_teams.repository || '/issues/' || issue.issue_number\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n \n repository_teams.repository_team_names,\n \n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.github.int_github__issue_label_joined", "sql": " __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n)"}, {"id": "model.github.int_github__issue_labels", "sql": " __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n)"}, {"id": "model.github.int_github__repository_teams", "sql": " __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n)"}, {"id": "model.github.int_github__issue_assignees", "sql": " __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n)"}, {"id": "model.github.int_github__issue_open_length", "sql": " __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n)"}, {"id": "model.github.int_github__issue_comments", "sql": " __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n)"}, {"id": "model.github.int_github__pull_request_times", "sql": " __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\npull_request as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n), \n\nrequested_reviewer_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__requested_reviewer_history`\n where not removed\n), \n\nissue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_merged`\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n\n datetime_diff(\n cast(coalesce(time_of_first_review_post_request, current_timestamp) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_review,\n \n\n datetime_diff(\n cast(least(\n coalesce(time_of_first_requested_reviewer_review, current_timestamp),\n coalesce(issue.closed_at, current_timestamp)) as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_first_action,\n \n\n datetime_diff(\n cast(merged_at as datetime),\n cast(time_of_first_request as datetime),\n second\n )\n\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n)"}, {"id": "model.github.int_github__pull_request_reviewers", "sql": " __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n)"}], "relation_name": null}, "model.github.int_github__issue_labels": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.github.int_github__issue_label_joined"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_labels"], "unique_id": "model.github.int_github__issue_labels", "raw_code": "with issue_label as (\n select *\n from {{ ref('int_github__issue_label_joined') }}\n)\n\nselect\n issue_id,\n {{ fivetran_utils.string_agg( 'label', \"', '\" )}} as labels\nfrom issue_label\ngroup by issue_id", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_labels.sql", "original_file_path": "models/intermediate/int_github__issue_labels.sql", "name": "int_github__issue_labels", "alias": "int_github__issue_labels", "checksum": {"name": "sha256", "checksum": "126b7de5034d8b9e5067e9d0a346ea3d93132574cc3ae85d4d711270404f4064"}, "tags": [], "refs": [["int_github__issue_label_joined"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_labels.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1667849268.942282, "compiled_code": "with __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n),issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.github.int_github__issue_label_joined", "sql": " __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label`\n\n), label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n)"}], "relation_name": null}, "model.github.int_github__issue_assignees": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.github_source.stg_github__issue_assignee", "model.github_source.stg_github__user"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_assignees"], "unique_id": "model.github.int_github__issue_assignees", "raw_code": "with issue_assignee as (\n select *\n from {{ var('issue_assignee') }}\n), \n\ngithub_user as (\n select *\n from {{ var('user')}}\n)\n\nselect\n issue_assignee.issue_id,\n {{ fivetran_utils.string_agg( 'github_user.login_name', \"', '\" )}} as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_assignees.sql", "original_file_path": "models/intermediate/int_github__issue_assignees.sql", "name": "int_github__issue_assignees", "alias": "int_github__issue_assignees", "checksum": {"name": "sha256", "checksum": "837310bb78ff6f1460babc622037227dbc0c5776aae3ce3f5e9de48cb2ffac9c"}, "tags": [], "refs": [["stg_github__issue_assignee"], ["stg_github__user"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_assignees.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1667849268.952574, "compiled_code": "with issue_assignee as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee`\n), \n\ngithub_user as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__issue_comments": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.github_source.stg_github__issue_comment"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_comments"], "unique_id": "model.github.int_github__issue_comments", "raw_code": "with issue_comment as (\n select *\n from {{ var('issue_comment') }}\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_comments.sql", "original_file_path": "models/intermediate/int_github__issue_comments.sql", "name": "int_github__issue_comments", "alias": "int_github__issue_comments", "checksum": {"name": "sha256", "checksum": "b56ffccc19ec39a1d1bc4137557c8e1971167f97e673ea30d0f713bd34bc111a"}, "tags": [], "refs": [["stg_github__issue_comment"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_comments.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1667849268.963899, "compiled_code": "with issue_comment as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment`\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__issue_open_length": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt.datediff"], "nodes": ["model.github_source.stg_github__issue", "model.github_source.stg_github__issue_closed_history"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_open_length"], "unique_id": "model.github.int_github__issue_open_length", "raw_code": "with issue as (\n select *\n from {{ var('issue') }}\n), \n\nissue_closed_history as (\n select *\n from {{ var('issue_closed_history') }}\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), {{ dbt.current_timestamp_backcompat() }}) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum({{ dbt.datediff('valid_starting', 'valid_until', 'second') }}) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_open_length.sql", "original_file_path": "models/intermediate/int_github__issue_open_length.sql", "name": "int_github__issue_open_length", "alias": "int_github__issue_open_length", "checksum": {"name": "sha256", "checksum": "58de864860664b785e8000ef983dcb006d60af6cbba301e72e9e4c45aa1d8d5a"}, "tags": [], "refs": [["stg_github__issue"], ["stg_github__issue_closed_history"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_open_length.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1667849268.9728892, "compiled_code": "with issue as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n), \n\nissue_closed_history as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history`\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), current_timestamp) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n\n datetime_diff(\n cast(valid_until as datetime),\n cast(valid_starting as datetime),\n second\n )\n\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__repository_teams": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.github_source.stg_github__repository", "model.github_source.stg_github__repo_team", "model.github_source.stg_github__team"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__repository_teams"], "unique_id": "model.github.int_github__repository_teams", "raw_code": "{{ config(enabled=var('github__using_repo_team', True)) }}\n\nwith repository as (\n select *\n from {{ var('repository')}}\n),\n\nrepo_teams as (\n select *\n from {{ var('repo_team')}}\n),\n\nteams as (\n select *\n from {{ var('team')}}\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n {{ fivetran_utils.string_agg('team_name', \"', '\" ) }} as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__repository_teams.sql", "original_file_path": "models/intermediate/int_github__repository_teams.sql", "name": "int_github__repository_teams", "alias": "int_github__repository_teams", "checksum": {"name": "sha256", "checksum": "aa75375faa9f533b0c9c935f80ed6e9c7b90f20249089e7d64b7b47194f9044e"}, "tags": [], "refs": [["stg_github__repository"], ["stg_github__repo_team"], ["stg_github__team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__repository_teams.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "enabled": true}, "created_at": 1667849268.985118, "compiled_code": "\n\nwith repository as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repository`\n),\n\nrepo_teams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team`\n),\n\nteams as (\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__team`\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github_source.stg_github__issue_comment": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_comment_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__issue_comment_tmp", "model.github_source.stg_github__issue_comment_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__issue_comment"], "unique_id": "model.github_source.stg_github__issue_comment", "raw_code": "with issue_comment as (\n\n select *\n from {{ ref('stg_github__issue_comment_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_comment_tmp')),\n staging_columns=get_issue_comment_columns()\n )\n }}\n\n from issue_comment\n\n), fields as (\n\n select \n id as issue_comment_id,\n issue_id,\n user_id\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue_comment.sql", "original_file_path": "models/stg_github__issue_comment.sql", "name": "stg_github__issue_comment", "alias": "stg_github__issue_comment", "checksum": {"name": "sha256", "checksum": "2f96156ac9d0de0afe220888eb6912117a7d04b1680b8fb1f5890dfbbcdb2994"}, "tags": [], "refs": [["stg_github__issue_comment_tmp"], ["stg_github__issue_comment_tmp"]], "sources": [], "metrics": [], "description": "Table that contains comments made on issues", "columns": {"issue_comment_id": {"name": "issue_comment_id", "description": "System generated unique id for the issue comment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue_comment.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667849269.652618, "compiled_code": "with issue_comment as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n body\n \n as \n \n body\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 issue_id\n \n as \n \n issue_id\n \n, \n \n \n updated_at\n \n as \n \n updated_at\n \n, \n \n \n user_id\n \n as \n \n user_id\n \n\n\n\n\n from issue_comment\n\n), fields as (\n\n select \n id as issue_comment_id,\n issue_id,\n user_id\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment`"}, "model.github_source.stg_github__requested_reviewer_history": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_requested_reviewer_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.github_source.stg_github__requested_reviewer_history_tmp", "model.github_source.stg_github__requested_reviewer_history_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__requested_reviewer_history"], "unique_id": "model.github_source.stg_github__requested_reviewer_history", "raw_code": "with requested_reviewer_history as (\n\n select *\n from {{ ref('stg_github__requested_reviewer_history_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__requested_reviewer_history_tmp')),\n staging_columns=get_requested_reviewer_history_columns()\n )\n }}\n\n from requested_reviewer_history\n\n), fields as (\n\n select \n pull_request_id,\n cast(created_at as {{ dbt.type_timestamp() }}) as created_at,\n requested_id,\n removed\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__requested_reviewer_history.sql", "original_file_path": "models/stg_github__requested_reviewer_history.sql", "name": "stg_github__requested_reviewer_history", "alias": "stg_github__requested_reviewer_history", "checksum": {"name": "sha256", "checksum": "40abf6ac94bece080abe8e8a45ed43030166df171697acf3c59c5958ffe68eba"}, "tags": [], "refs": [["stg_github__requested_reviewer_history_tmp"], ["stg_github__requested_reviewer_history_tmp"]], "sources": [], "metrics": [], "description": "Table containing when a user requests another user to review a pull request", "columns": {"pull_request_id": {"name": "pull_request_id", "description": "Foreign key that references the pull request table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the review was submitted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "requested_id": {"name": "requested_id", "description": "Foreign key that references the user table, representing the user that was requested to review a PR.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "removed": {"name": "removed", "description": "Boolean variable indicating if the requester was removed from the PR (true) or added to the PR (false).", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__requested_reviewer_history.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667849269.6761038, "compiled_code": "with requested_reviewer_history as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__requested_reviewer_history_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n actor_id\n \n as \n \n actor_id\n \n, \n \n \n created_at\n \n as \n \n created_at\n \n, \n \n \n pull_request_id\n \n as \n \n pull_request_id\n \n, \n \n \n removed\n \n as \n \n removed\n \n, \n \n \n requested_id\n \n as \n \n requested_id\n \n\n\n\n\n from requested_reviewer_history\n\n), fields as (\n\n select \n pull_request_id,\n cast(created_at as TIMESTAMP) as created_at,\n requested_id,\n removed\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__requested_reviewer_history`"}, "model.github_source.stg_github__issue_label": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_label_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__issue_label_tmp", "model.github_source.stg_github__issue_label_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__issue_label"], "unique_id": "model.github_source.stg_github__issue_label", "raw_code": "with issue_label as (\n\n select *\n from {{ ref('stg_github__issue_label_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_label_tmp')),\n staging_columns=get_issue_label_columns()\n )\n }}\n\n from issue_label\n\n), fields as (\n\n select \n issue_id,\n label_id\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue_label.sql", "original_file_path": "models/stg_github__issue_label.sql", "name": "stg_github__issue_label", "alias": "stg_github__issue_label", "checksum": {"name": "sha256", "checksum": "bbc4b8e82ab26b7cb753ead2165a6d483171b6def78a34c8ab6b2c9d1dc1357c"}, "tags": [], "refs": [["stg_github__issue_label_tmp"], ["stg_github__issue_label_tmp"]], "sources": [], "metrics": [], "description": "The current labels attached to an issue", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "label_id": {"name": "label_id", "description": "Unique identifier of the used label", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue_label.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667849269.650191, "compiled_code": "with issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n label_id\n \n as \n \n label_id\n \n, \n \n \n issue_id\n \n as \n \n issue_id\n \n\n\n\n\n from issue_label\n\n), fields as (\n\n select \n issue_id,\n label_id\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label`"}, "model.github_source.stg_github__issue_merged": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_merged_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.github_source.stg_github__issue_merged_tmp", "model.github_source.stg_github__issue_merged_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__issue_merged"], "unique_id": "model.github_source.stg_github__issue_merged", "raw_code": "with issue_merged as (\n\n select *\n from {{ ref('stg_github__issue_merged_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_merged_tmp')),\n staging_columns=get_issue_merged_columns()\n )\n }}\n\n from issue_merged\n\n), fields as (\n\n select \n issue_id,\n cast(merged_at as {{ dbt.type_timestamp() }}) as merged_at\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue_merged.sql", "original_file_path": "models/stg_github__issue_merged.sql", "name": "stg_github__issue_merged", "alias": "stg_github__issue_merged", "checksum": {"name": "sha256", "checksum": "d0ffc63496f8a12ccde9c115909db85d5f2fbd7c2ca8a7761cd96abcf31f532c"}, "tags": [], "refs": [["stg_github__issue_merged_tmp"], ["stg_github__issue_merged_tmp"]], "sources": [], "metrics": [], "description": "Table that tracks when an issue (always a pull request) is merged", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table. This table will only reference issues that are pull requests", "meta": {}, "data_type": null, "quote": null, "tags": []}, "merged_at": {"name": "merged_at", "description": "Timestamp of when the code merge took place", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue_merged.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667849269.654439, "compiled_code": "with issue_merged as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_merged_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n actor_id\n \n as \n \n actor_id\n \n, \n \n \n commit_sha\n \n as \n \n commit_sha\n \n, \n \n \n issue_id\n \n as \n \n issue_id\n \n, \n \n \n merged_at\n \n as \n \n merged_at\n \n\n\n\n\n from issue_merged\n\n), fields as (\n\n select \n issue_id,\n cast(merged_at as TIMESTAMP) as merged_at\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_merged`"}, "model.github_source.stg_github__issue_closed_history": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_closed_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.github_source.stg_github__issue_closed_history_tmp", "model.github_source.stg_github__issue_closed_history_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__issue_closed_history"], "unique_id": "model.github_source.stg_github__issue_closed_history", "raw_code": "with issue_closed_history as (\n\n select *\n from {{ ref('stg_github__issue_closed_history_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_closed_history_tmp')),\n staging_columns=get_issue_closed_history_columns()\n )\n }}\n\n from issue_closed_history\n\n), fields as (\n\n select \n issue_id,\n cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at,\n closed as is_closed\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue_closed_history.sql", "original_file_path": "models/stg_github__issue_closed_history.sql", "name": "stg_github__issue_closed_history", "alias": "stg_github__issue_closed_history", "checksum": {"name": "sha256", "checksum": "8820baed7a5b47177c8e57576741ab5d3763026682f66c52429092e655e07408"}, "tags": [], "refs": [["stg_github__issue_closed_history_tmp"], ["stg_github__issue_closed_history_tmp"]], "sources": [], "metrics": [], "description": "Table to track when an issue is closed or re-opened", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the action took place", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_closed": {"name": "is_closed", "description": "Boolean variable for if the issue was closed (true) or re-opened (false)", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue_closed_history.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667849269.6483111, "compiled_code": "with issue_closed_history as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n actor_id\n \n as \n \n actor_id\n \n, \n \n \n closed\n \n as \n \n closed\n \n, \n \n \n commit_sha\n \n as \n \n commit_sha\n \n, \n \n \n issue_id\n \n as \n \n issue_id\n \n, \n \n \n updated_at\n \n as \n \n updated_at\n \n\n\n\n\n from issue_closed_history\n\n), fields as (\n\n select \n issue_id,\n cast(updated_at as TIMESTAMP) as updated_at,\n closed as is_closed\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history`"}, "model.github_source.stg_github__issue_assignee": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_assignee_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__issue_assignee_tmp", "model.github_source.stg_github__issue_assignee_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__issue_assignee"], "unique_id": "model.github_source.stg_github__issue_assignee", "raw_code": "with issue_assignee as (\n\n select *\n from {{ ref('stg_github__issue_assignee_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_assignee_tmp')),\n staging_columns=get_issue_assignee_columns()\n )\n }}\n\n from issue_assignee\n\n), fields as (\n\n select \n issue_id,\n user_id\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue_assignee.sql", "original_file_path": "models/stg_github__issue_assignee.sql", "name": "stg_github__issue_assignee", "alias": "stg_github__issue_assignee", "checksum": {"name": "sha256", "checksum": "1ee1ae6a0a648f4fddde4964f184b889bfd09ca43f0560fb10faaa8544b2f90d"}, "tags": [], "refs": [["stg_github__issue_assignee_tmp"], ["stg_github__issue_assignee_tmp"]], "sources": [], "metrics": [], "description": "Table with the current user(s) assigned to an issue", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue_assignee.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667849269.6412091, "compiled_code": "with issue_assignee as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n issue_id\n \n as \n \n issue_id\n \n, \n \n \n user_id\n \n as \n \n user_id\n \n\n\n\n\n from issue_assignee\n\n), fields as (\n\n select \n issue_id,\n user_id\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee`"}, "model.github_source.stg_github__repository": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_repository_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__repository_tmp", "model.github_source.stg_github__repository_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__repository"], "unique_id": "model.github_source.stg_github__repository", "raw_code": "with repository as (\n\n select *\n from {{ ref('stg_github__repository_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__repository_tmp')),\n staging_columns=get_repository_columns()\n )\n }}\n\n from repository\n\n), fields as (\n\n select \n id as repository_id,\n full_name,\n private as is_private\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__repository.sql", "original_file_path": "models/stg_github__repository.sql", "name": "stg_github__repository", "alias": "stg_github__repository", "checksum": {"name": "sha256", "checksum": "52faadfa1a36e8b144c01bdba106b9b22c58154bbd60b69c069c409f1b2f4712"}, "tags": [], "refs": [["stg_github__repository_tmp"], ["stg_github__repository_tmp"]], "sources": [], "metrics": [], "description": "Table representing the file structure of a directory under git control", "columns": {"repository_id": {"name": "repository_id", "description": "System generated unique id for the repository.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "full_name": {"name": "full_name", "description": "The name of the git repository.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_private": {"name": "is_private", "description": "Boolean field indicating whether the repository is private (true) or public (false).", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__repository.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667849269.673113, "compiled_code": "with repository as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repository_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\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 created_at\n \n as \n \n created_at\n \n, \n \n \n default_branch\n \n as \n \n default_branch\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n fork\n \n as \n \n fork\n \n, \n \n \n full_name\n \n as \n \n full_name\n \n, \n \n \n homepage\n \n as \n \n homepage\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n language\n \n as \n \n language\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n owner_id\n \n as \n \n owner_id\n \n, \n \n \n private\n \n as \n \n private\n \n\n\n\n\n from repository\n\n), fields as (\n\n select \n id as repository_id,\n full_name,\n private as is_private\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__repository`"}, "model.github_source.stg_github__user": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_user_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__user_tmp", "model.github_source.stg_github__user_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__user"], "unique_id": "model.github_source.stg_github__user", "raw_code": "with github_user as (\n\n select *\n from {{ ref('stg_github__user_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__user_tmp')),\n staging_columns=get_user_columns()\n )\n }}\n \n \n from github_user\n\n), fields as (\n\n select\n id as user_id,\n login as login_name,\n name,\n company\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__user.sql", "original_file_path": "models/stg_github__user.sql", "name": "stg_github__user", "alias": "stg_github__user", "checksum": {"name": "sha256", "checksum": "3fade99df6af62e01efd3bdabe4245077eeb17d7c05a33eae885ab9cebfb33a6"}, "tags": [], "refs": [["stg_github__user_tmp"], ["stg_github__user_tmp"]], "sources": [], "metrics": [], "description": "Table representing contributors to a git project", "columns": {"user_id": {"name": "user_id", "description": "System generated unique id for the user.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "login_name": {"name": "login_name", "description": "The alias the user uses to login to github.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the user", "meta": {}, "data_type": null, "quote": null, "tags": []}, "company": {"name": "company", "description": "The company of the user.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__user.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667849269.6832, "compiled_code": "with github_user as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n company\n \n as \n \n company\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n login\n \n as \n \n login\n \n, \n \n \n name\n \n as \n \n name\n \n\n\n\n \n \n from github_user\n\n), fields as (\n\n select\n id as user_id,\n login as login_name,\n name,\n company\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__user`"}, "model.github_source.stg_github__pull_request_review": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_pull_request_review_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.github_source.stg_github__pull_request_review_tmp", "model.github_source.stg_github__pull_request_review_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__pull_request_review"], "unique_id": "model.github_source.stg_github__pull_request_review", "raw_code": "with pull_request_review as (\n\n select *\n from {{ ref('stg_github__pull_request_review_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__pull_request_review_tmp')),\n staging_columns=get_pull_request_review_columns()\n )\n }}\n\n from pull_request_review\n\n), fields as (\n\n select \n id as pull_request_review_id,\n pull_request_id,\n cast(submitted_at as {{ dbt.type_timestamp() }}) as submitted_at,\n state,\n user_id\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__pull_request_review.sql", "original_file_path": "models/stg_github__pull_request_review.sql", "name": "stg_github__pull_request_review", "alias": "stg_github__pull_request_review", "checksum": {"name": "sha256", "checksum": "3c5b56fcda26503106a11215aa4895199d140d378e4f81dc73fee0a95a39ef6b"}, "tags": [], "refs": [["stg_github__pull_request_review_tmp"], ["stg_github__pull_request_review_tmp"]], "sources": [], "metrics": [], "description": "Table containing reviews made to pull requests", "columns": {"pull_request_review_id": {"name": "pull_request_review_id", "description": "System generated unique id for the pull request review.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pull_request_id": {"name": "pull_request_id", "description": "Foreign key that references the pull request table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "submitted_at": {"name": "submitted_at", "description": "Timestamp of when the request for review was submitted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the review was an approval, request for change, comment, dismissal.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table, representing the user that reviewed the pull request.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__pull_request_review.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667849269.665847, "compiled_code": "with pull_request_review as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n body\n \n as \n \n body\n \n, \n \n \n commit_sha\n \n as \n \n commit_sha\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n pull_request_id\n \n as \n \n pull_request_id\n \n, \n \n \n state\n \n as \n \n state\n \n, \n \n \n submitted_at\n \n as \n \n submitted_at\n \n, \n \n \n user_id\n \n as \n \n user_id\n \n\n\n\n\n from pull_request_review\n\n), fields as (\n\n select \n id as pull_request_review_id,\n pull_request_id,\n cast(submitted_at as TIMESTAMP) as submitted_at,\n state,\n user_id\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`"}, "model.github_source.stg_github__repo_team": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_repo_team_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__repo_team_tmp", "model.github_source.stg_github__repo_team_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__repo_team"], "unique_id": "model.github_source.stg_github__repo_team", "raw_code": "{{ config(enabled=var('github__using_repo_team', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_github__repo_team_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__repo_team_tmp')),\n staging_columns=get_repo_team_columns()\n )\n }}\n \n from base\n \n), final as (\n \n select \n repository_id,\n team_id\n from fields\n)\n\nselect * from final", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__repo_team.sql", "original_file_path": "models/stg_github__repo_team.sql", "name": "stg_github__repo_team", "alias": "stg_github__repo_team", "checksum": {"name": "sha256", "checksum": "bbf2296c63f5601191f285d1b9509717c9af73282ef8faae25df101d5c2058ec"}, "tags": [], "refs": [["stg_github__repo_team_tmp"], ["stg_github__repo_team_tmp"]], "sources": [], "metrics": [], "description": "Table representing the mapping relationships between repositories and teams", "columns": {"repository_id": {"name": "repository_id", "description": "Reference to the respective repository for the record.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "team_id": {"name": "team_id", "description": "Reference to the respective team for the record.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__repo_team.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "enabled": true}, "created_at": 1667849269.670687, "compiled_code": "\n\nwith base as (\n\n select * \n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team_tmp`\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n permission\n \n as \n \n permission\n \n, \n \n \n repository_id\n \n as \n \n repository_id\n \n, \n \n \n team_id\n \n as \n \n team_id\n \n\n\n\n \n from base\n \n), final as (\n \n select \n repository_id,\n team_id\n from fields\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team`"}, "model.github_source.stg_github__label": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_label_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__label_tmp", "model.github_source.stg_github__label_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__label"], "unique_id": "model.github_source.stg_github__label", "raw_code": "with issue_label as (\n\n select *\n from {{ ref('stg_github__label_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__label_tmp')),\n staging_columns=get_label_columns()\n )\n }}\n\n from issue_label\n\n), fields as (\n\n select \n id as label_id,\n _fivetran_synced,\t\n color,\n description,\n is_default,\n name as label,\n url\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__label.sql", "original_file_path": "models/stg_github__label.sql", "name": "stg_github__label", "alias": "stg_github__label", "checksum": {"name": "sha256", "checksum": "65919f8309be5eb259a6143e007f38f4ac91c1692d10990206708faa17f086e1"}, "tags": [], "refs": [["stg_github__label_tmp"], ["stg_github__label_tmp"]], "sources": [], "metrics": [], "description": "Table that contains labels that are used across your Github account within individual repositories.", "columns": {"label_id": {"name": "label_id", "description": "Unique identifier of the Github label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of the record being synced by Fivetran", "meta": {}, "data_type": null, "quote": null, "tags": []}, "color": {"name": "color", "description": "The color of the label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "The description of the label indicating the purpose", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_default": {"name": "is_default", "description": "Boolean flagging if the label is default on creation", "meta": {}, "data_type": null, "quote": null, "tags": []}, "label": {"name": "label", "description": "Name of the label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url": {"name": "url", "description": "Url where the label was used", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__label.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667849269.6457448, "compiled_code": "with issue_label as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\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 description\n \n as \n \n description\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n is_default\n \n as \n \n is_default\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n url\n \n as \n \n url\n \n\n\n\n\n from issue_label\n\n), fields as (\n\n select \n id as label_id,\n _fivetran_synced,\t\n color,\n description,\n is_default,\n name as label,\n url\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__label`"}, "model.github_source.stg_github__issue": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.github_source.stg_github__issue_tmp", "model.github_source.stg_github__issue_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__issue"], "unique_id": "model.github_source.stg_github__issue", "raw_code": "with issue as (\n\n select *\n from {{ ref('stg_github__issue_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_tmp')),\n staging_columns=get_issue_columns()\n )\n }}\n\n from issue \n\n), fields as (\n\n select \n id as issue_id,\n body,\n cast(closed_at as {{ dbt.type_timestamp() }}) as closed_at,\n cast(created_at as {{ dbt.type_timestamp() }}) as created_at,\n locked as is_locked,\n milestone_id,\n number as issue_number,\n pull_request as is_pull_request,\n repository_id,\n state,\n title,\n cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at,\n user_id\n \n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue.sql", "original_file_path": "models/stg_github__issue.sql", "name": "stg_github__issue", "alias": "stg_github__issue", "checksum": {"name": "sha256", "checksum": "4fa11e7a1ff0785189f14a205478aba55bb62784e05066f421e1723ec12240d0"}, "tags": [], "refs": [["stg_github__issue_tmp"], ["stg_github__issue_tmp"]], "sources": [], "metrics": [], "description": "Table that contains 1 entry for every issue created. Pull Requests also create an entry in this table, and there is a boolean field to determine if an entry is a pull request.", "columns": {"issue_id": {"name": "issue_id", "description": "System generated unique id for the issue. This is not the number that appears in the URL.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "body": {"name": "body", "description": "The text of the main description of the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed_at": {"name": "closed_at", "description": "Timestamp of when the issue was closed, NULL for issues that are open.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_locked": {"name": "is_locked", "description": "Boolean indicating whether the issue is locked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the issue was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "milestone_id": {"name": "milestone_id", "description": "Foreign key that references the milestone table representing the current milestone the issue is in.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_number": {"name": "issue_number", "description": "The issue number within a repository. Is unique by repository, but not across repositories.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_pull_request": {"name": "is_pull_request", "description": "Boolean for is the issue is a pull request (true) ot regular issue (false)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_id": {"name": "repository_id", "description": "Foreign key that references the repository table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the issue is open or closed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "Title of the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the last update was made to the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table, representing the user that created the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667849269.662169, "compiled_code": "with issue as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n body\n \n as \n \n body\n \n, \n \n \n closed_at\n \n as \n \n closed_at\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 locked\n \n as \n \n locked\n \n, \n \n \n milestone_id\n \n as \n \n milestone_id\n \n, \n \n \n number\n \n as \n \n number\n \n, \n \n \n pull_request\n \n as \n \n pull_request\n \n, \n \n \n repository_id\n \n as \n \n repository_id\n \n, \n \n \n state\n \n as \n \n state\n \n, \n \n \n title\n \n as \n \n title\n \n, \n \n \n updated_at\n \n as \n \n updated_at\n \n, \n \n \n user_id\n \n as \n \n user_id\n \n\n\n\n\n from issue \n\n), fields as (\n\n select \n id as issue_id,\n body,\n cast(closed_at as TIMESTAMP) as closed_at,\n cast(created_at as TIMESTAMP) as created_at,\n locked as is_locked,\n milestone_id,\n number as issue_number,\n pull_request as is_pull_request,\n repository_id,\n state,\n title,\n cast(updated_at as TIMESTAMP) as updated_at,\n user_id\n \n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue`"}, "model.github_source.stg_github__team": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_team_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__team_tmp", "model.github_source.stg_github__team_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__team"], "unique_id": "model.github_source.stg_github__team", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_github__team_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__team_tmp')),\n staging_columns=get_team_columns()\n )\n }}\n \n from base\n \n), final as (\n \n select \n id as team_id,\n description,\n name,\n parent_id,\n privacy,\n slug\n from fields\n)\n\nselect * \nfrom final", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__team.sql", "original_file_path": "models/stg_github__team.sql", "name": "stg_github__team", "alias": "stg_github__team", "checksum": {"name": "sha256", "checksum": "219e47883ec9f076dc1c27b22f72534709edaedd60e8ad9dc1b13db05499f4a4"}, "tags": [], "refs": [["stg_github__team_tmp"], ["stg_github__team_tmp"]], "sources": [], "metrics": [], "description": "Table containing teams and team details", "columns": {"team_id": {"name": "team_id", "description": "System generated unique id for the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "User created description of the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "User created name of the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "Reference to the parent team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "privacy": {"name": "privacy", "description": "Type of privacy permissions associated with the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "slug": {"name": "slug", "description": "Url friendly version of the team name.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__team.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667849269.680067, "compiled_code": "with base as (\n\n select * \n from `dbt-package-testing`.`github_integration_tests`.`stg_github__team_tmp`\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n description\n \n as \n \n description\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 org_id\n \n as \n \n org_id\n \n, \n \n \n parent_id\n \n as \n \n parent_id\n \n, \n \n \n privacy\n \n as \n \n privacy\n \n, \n \n \n slug\n \n as \n \n slug\n \n\n\n\n \n from base\n \n), final as (\n \n select \n id as team_id,\n description,\n name,\n parent_id,\n privacy,\n slug\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__team`"}, "model.github_source.stg_github__pull_request": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_pull_request_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__pull_request_tmp", "model.github_source.stg_github__pull_request_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__pull_request"], "unique_id": "model.github_source.stg_github__pull_request", "raw_code": "with pull_request as (\n\n select *\n from {{ ref('stg_github__pull_request_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__pull_request_tmp')),\n staging_columns=get_pull_request_columns()\n )\n }}\n\n from pull_request\n\n), fields as (\n\n select \n id as pull_request_id,\n issue_id,\n head_repo_id,\n head_user_id\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__pull_request.sql", "original_file_path": "models/stg_github__pull_request.sql", "name": "stg_github__pull_request", "alias": "stg_github__pull_request", "checksum": {"name": "sha256", "checksum": "c2b1a593030492afcf35407523b636105f42f1cf3fd14f6067e31ba76d70dfe8"}, "tags": [], "refs": [["stg_github__pull_request_tmp"], ["stg_github__pull_request_tmp"]], "sources": [], "metrics": [], "description": "A special type of issue that is created when a user wants to merge one branch of code into another", "columns": {"pull_request_id": {"name": "pull_request_id", "description": "System generated unique id for the pull request.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "head_repo_id": {"name": "head_repo_id", "description": "Foreign key that references the repository table, referencing the current branch.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "head_user_id": {"name": "head_user_id", "description": "Foreign key that references the user table, referencing who created the current branch.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__pull_request.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1667849269.66875, "compiled_code": "with pull_request as (\n\n select *\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_tmp`\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n base_label\n \n as \n \n base_label\n \n, \n \n \n base_ref\n \n as \n \n base_ref\n \n, \n \n \n base_repo_id\n \n as \n \n base_repo_id\n \n, \n \n \n base_sha\n \n as \n \n base_sha\n \n, \n \n \n base_user_id\n \n as \n \n base_user_id\n \n, \n \n \n head_label\n \n as \n \n head_label\n \n, \n \n \n head_ref\n \n as \n \n head_ref\n \n, \n \n \n head_repo_id\n \n as \n \n head_repo_id\n \n, \n \n \n head_sha\n \n as \n \n head_sha\n \n, \n \n \n head_user_id\n \n as \n \n head_user_id\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n issue_id\n \n as \n \n issue_id\n \n, \n \n \n merge_commit_sha\n \n as \n \n merge_commit_sha\n \n\n\n\n\n from pull_request\n\n), fields as (\n\n select \n id as pull_request_id,\n issue_id,\n head_repo_id,\n head_user_id\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`"}, "model.github_source.stg_github__repository_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.repository"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__repository_tmp"], "unique_id": "model.github_source.stg_github__repository_tmp", "raw_code": "select *\nfrom {{ var('repository') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__repository_tmp.sql", "original_file_path": "models/tmp/stg_github__repository_tmp.sql", "name": "stg_github__repository_tmp", "alias": "stg_github__repository_tmp", "checksum": {"name": "sha256", "checksum": "e090c8cb68dc96c49ee363d95e9bbaf417dd03e2ec675bfdc3d9cefdf889cfc8"}, "tags": [], "refs": [], "sources": [["github", "repository"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__repository_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667849269.3035278, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_repository_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__repository_tmp`"}, "model.github_source.stg_github__label_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.label"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__label_tmp"], "unique_id": "model.github_source.stg_github__label_tmp", "raw_code": "select *\nfrom {{ var('label') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__label_tmp.sql", "original_file_path": "models/tmp/stg_github__label_tmp.sql", "name": "stg_github__label_tmp", "alias": "stg_github__label_tmp", "checksum": {"name": "sha256", "checksum": "8e66aceee9e6c677e3b0b105b85de66edea0f4141bef42cd097fd9a236abcf2f"}, "tags": [], "refs": [], "sources": [["github", "label"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__label_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667849269.313513, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_label_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__label_tmp`"}, "model.github_source.stg_github__requested_reviewer_history_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.requested_reviewer_history"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__requested_reviewer_history_tmp"], "unique_id": "model.github_source.stg_github__requested_reviewer_history_tmp", "raw_code": "select *\nfrom {{ var('requested_reviewer_history') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__requested_reviewer_history_tmp.sql", "original_file_path": "models/tmp/stg_github__requested_reviewer_history_tmp.sql", "name": "stg_github__requested_reviewer_history_tmp", "alias": "stg_github__requested_reviewer_history_tmp", "checksum": {"name": "sha256", "checksum": "ed713a77bb2c7407b63c6cc1eb5da22d3267a585bd972dabeb7c86e568180aaf"}, "tags": [], "refs": [], "sources": [["github", "requested_reviewer_history"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__requested_reviewer_history_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667849269.3224, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_requested_reviewer_history_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__requested_reviewer_history_tmp`"}, "model.github_source.stg_github__issue_comment_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.issue_comment"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_comment_tmp"], "unique_id": "model.github_source.stg_github__issue_comment_tmp", "raw_code": "select *\nfrom {{ var('issue_comment') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_comment_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_comment_tmp.sql", "name": "stg_github__issue_comment_tmp", "alias": "stg_github__issue_comment_tmp", "checksum": {"name": "sha256", "checksum": "0954877e30180964df220c97f9b398d775fc74106c25666bf9dd98c5449a72a1"}, "tags": [], "refs": [], "sources": [["github", "issue_comment"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_comment_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667849269.331229, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_issue_comment_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment_tmp`"}, "model.github_source.stg_github__pull_request_review_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.pull_request_review"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__pull_request_review_tmp"], "unique_id": "model.github_source.stg_github__pull_request_review_tmp", "raw_code": "select *\nfrom {{ var('pull_request_review') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__pull_request_review_tmp.sql", "original_file_path": "models/tmp/stg_github__pull_request_review_tmp.sql", "name": "stg_github__pull_request_review_tmp", "alias": "stg_github__pull_request_review_tmp", "checksum": {"name": "sha256", "checksum": "3419833d93b14d370eb3c9cfb7fda9a373c47a2f9701620425d882b95fbaa55c"}, "tags": [], "refs": [], "sources": [["github", "pull_request_review"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__pull_request_review_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667849269.340085, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_pull_request_review_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review_tmp`"}, "model.github_source.stg_github__issue_label_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.issue_label"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_label_tmp"], "unique_id": "model.github_source.stg_github__issue_label_tmp", "raw_code": "select *\nfrom {{ var('issue_label') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_label_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_label_tmp.sql", "name": "stg_github__issue_label_tmp", "alias": "stg_github__issue_label_tmp", "checksum": {"name": "sha256", "checksum": "3cd52e662c2bc67a66c9c3e6250e38739362a0b688287d41329d2989297fa201"}, "tags": [], "refs": [], "sources": [["github", "issue_label"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_label_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667849269.348972, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_issue_label_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_label_tmp`"}, "model.github_source.stg_github__team_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.team"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__team_tmp"], "unique_id": "model.github_source.stg_github__team_tmp", "raw_code": "select * \nfrom {{ var('team') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__team_tmp.sql", "original_file_path": "models/tmp/stg_github__team_tmp.sql", "name": "stg_github__team_tmp", "alias": "stg_github__team_tmp", "checksum": {"name": "sha256", "checksum": "8c107692c9394962da82e0c2460045e6686d962c1eefe0cff564c618aed7a17d"}, "tags": [], "refs": [], "sources": [["github", "team"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__team_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667849269.35787, "compiled_code": "select * \nfrom `dbt-package-testing`.`github_integration_tests`.`github_team_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__team_tmp`"}, "model.github_source.stg_github__pull_request_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.pull_request"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__pull_request_tmp"], "unique_id": "model.github_source.stg_github__pull_request_tmp", "raw_code": "select *\nfrom {{ var('pull_request') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__pull_request_tmp.sql", "original_file_path": "models/tmp/stg_github__pull_request_tmp.sql", "name": "stg_github__pull_request_tmp", "alias": "stg_github__pull_request_tmp", "checksum": {"name": "sha256", "checksum": "11df5e7fd7046db485c6654ea88c82c566b71140c4e233f3567bd63bbf1cca19"}, "tags": [], "refs": [], "sources": [["github", "pull_request"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__pull_request_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667849269.367984, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_pull_request_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_tmp`"}, "model.github_source.stg_github__issue_merged_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.issue_merged"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_merged_tmp"], "unique_id": "model.github_source.stg_github__issue_merged_tmp", "raw_code": "select *\nfrom {{ var('issue_merged') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_merged_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_merged_tmp.sql", "name": "stg_github__issue_merged_tmp", "alias": "stg_github__issue_merged_tmp", "checksum": {"name": "sha256", "checksum": "e61fb5297937f494370067232958a443ec21c885a55cca0022f480b463ce90a9"}, "tags": [], "refs": [], "sources": [["github", "issue_merged"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_merged_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667849269.376788, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_issue_merged_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_merged_tmp`"}, "model.github_source.stg_github__user_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.user"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__user_tmp"], "unique_id": "model.github_source.stg_github__user_tmp", "raw_code": "select *\nfrom {{ var('user') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__user_tmp.sql", "original_file_path": "models/tmp/stg_github__user_tmp.sql", "name": "stg_github__user_tmp", "alias": "stg_github__user_tmp", "checksum": {"name": "sha256", "checksum": "e71885bca06f3e1feaef9e729cfb58827c8999bc4d4b7cda538c392c5f56ffdf"}, "tags": [], "refs": [], "sources": [["github", "user"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__user_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667849269.38559, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_user_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__user_tmp`"}, "model.github_source.stg_github__issue_closed_history_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.issue_closed_history"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_closed_history_tmp"], "unique_id": "model.github_source.stg_github__issue_closed_history_tmp", "raw_code": "select *\nfrom {{ var('issue_closed_history') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_closed_history_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_closed_history_tmp.sql", "name": "stg_github__issue_closed_history_tmp", "alias": "stg_github__issue_closed_history_tmp", "checksum": {"name": "sha256", "checksum": "5ce3eed90261c385c0ddcb0dc9d914a0bf3d3e0f737e4e233af244d29bbf3ce4"}, "tags": [], "refs": [], "sources": [["github", "issue_closed_history"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_closed_history_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667849269.3945248, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_issue_closed_history_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history_tmp`"}, "model.github_source.stg_github__issue_assignee_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.issue_assignee"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_assignee_tmp"], "unique_id": "model.github_source.stg_github__issue_assignee_tmp", "raw_code": "select *\nfrom {{ var('issue_assignee') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_assignee_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_assignee_tmp.sql", "name": "stg_github__issue_assignee_tmp", "alias": "stg_github__issue_assignee_tmp", "checksum": {"name": "sha256", "checksum": "4cab39e652c5972bfa16de13454df8e5745610e91b69f3840305e49a9d613753"}, "tags": [], "refs": [], "sources": [["github", "issue_assignee"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_assignee_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667849269.403893, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_issue_assignee_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee_tmp`"}, "model.github_source.stg_github__issue_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.issue"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_tmp"], "unique_id": "model.github_source.stg_github__issue_tmp", "raw_code": "select *\nfrom {{ var('issue') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_tmp.sql", "name": "stg_github__issue_tmp", "alias": "stg_github__issue_tmp", "checksum": {"name": "sha256", "checksum": "4100b13686c42d580a5eeaab15449896ec2ce740b0e5f002775eb9f222ef7c32"}, "tags": [], "refs": [], "sources": [["github", "issue"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1667849269.413236, "compiled_code": "select *\nfrom `dbt-package-testing`.`github_integration_tests`.`github_issue_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__issue_tmp`"}, "model.github_source.stg_github__repo_team_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.repo_team"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "dbt-package-testing", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__repo_team_tmp"], "unique_id": "model.github_source.stg_github__repo_team_tmp", "raw_code": "{{ config(enabled=var('github__using_repo_team', True)) }}\n\nselect * \nfrom {{ var('repo_team') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__repo_team_tmp.sql", "original_file_path": "models/tmp/stg_github__repo_team_tmp.sql", "name": "stg_github__repo_team_tmp", "alias": "stg_github__repo_team_tmp", "checksum": {"name": "sha256", "checksum": "25a704d9235d40dc05601995f184779690eabcc6e3a64d3a0489e00c3e6d13ab"}, "tags": [], "refs": [], "sources": [["github", "repo_team"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__repo_team_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "enabled": true}, "created_at": 1667849269.423819, "compiled_code": "\n\nselect * \nfrom `dbt-package-testing`.`github_integration_tests`.`github_repo_team_data`", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "`dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team_tmp`"}, "test.github.unique_github__issues_issue_id.6723b9b1db": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('github__issues')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__issues"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__issues_issue_id"], "unique_id": "test.github.unique_github__issues_issue_id.6723b9b1db", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__issues_issue_id.sql", "original_file_path": "models/github.yml", "name": "unique_github__issues_issue_id", "alias": "unique_github__issues_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__issues"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__issues_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.517782, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select issue_id as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`github__issues`\n where issue_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.github__issues"}, "test.github.not_null_github__issues_issue_id.fed0631e25": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('github__issues')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__issues"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__issues_issue_id"], "unique_id": "test.github.not_null_github__issues_issue_id.fed0631e25", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__issues_issue_id.sql", "original_file_path": "models/github.yml", "name": "not_null_github__issues_issue_id", "alias": "not_null_github__issues_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__issues"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__issues_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.52129, "compiled_code": "\n \n \n\n\n\nselect issue_id\nfrom `dbt-package-testing`.`github_integration_tests`.`github__issues`\nwhere issue_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.github__issues"}, "test.github.unique_github__pull_requests_issue_id.ce23997907": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('github__pull_requests')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__pull_requests"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__pull_requests_issue_id"], "unique_id": "test.github.unique_github__pull_requests_issue_id.ce23997907", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__pull_requests_issue_id.sql", "original_file_path": "models/github.yml", "name": "unique_github__pull_requests_issue_id", "alias": "unique_github__pull_requests_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__pull_requests"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__pull_requests_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.5246751, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select issue_id as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`github__pull_requests`\n where issue_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.github__pull_requests"}, "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('github__pull_requests')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__pull_requests"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__pull_requests_issue_id"], "unique_id": "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__pull_requests_issue_id.sql", "original_file_path": "models/github.yml", "name": "not_null_github__pull_requests_issue_id", "alias": "not_null_github__pull_requests_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__pull_requests"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__pull_requests_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.5279942, "compiled_code": "\n \n \n\n\n\nselect issue_id\nfrom `dbt-package-testing`.`github_integration_tests`.`github__pull_requests`\nwhere issue_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.github__pull_requests"}, "test.github.unique_github__daily_metrics_day.f98cab9456": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "day", "model": "{{ get_where_subquery(ref('github__daily_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__daily_metrics_day"], "unique_id": "test.github.unique_github__daily_metrics_day.f98cab9456", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__daily_metrics_day.sql", "original_file_path": "models/github.yml", "name": "unique_github__daily_metrics_day", "alias": "unique_github__daily_metrics_day", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__daily_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__daily_metrics_day.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.531581, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select day as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`github__daily_metrics`\n where day is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "day", "file_key_name": "models.github__daily_metrics"}, "test.github.not_null_github__daily_metrics_day.647e494434": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "day", "model": "{{ get_where_subquery(ref('github__daily_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__daily_metrics_day"], "unique_id": "test.github.not_null_github__daily_metrics_day.647e494434", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__daily_metrics_day.sql", "original_file_path": "models/github.yml", "name": "not_null_github__daily_metrics_day", "alias": "not_null_github__daily_metrics_day", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__daily_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__daily_metrics_day.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.5348191, "compiled_code": "\n \n \n\n\n\nselect day\nfrom `dbt-package-testing`.`github_integration_tests`.`github__daily_metrics`\nwhere day is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "day", "file_key_name": "models.github__daily_metrics"}, "test.github.unique_github__weekly_metrics_week.6794858a8e": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "week", "model": "{{ get_where_subquery(ref('github__weekly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__weekly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__weekly_metrics_week"], "unique_id": "test.github.unique_github__weekly_metrics_week.6794858a8e", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__weekly_metrics_week.sql", "original_file_path": "models/github.yml", "name": "unique_github__weekly_metrics_week", "alias": "unique_github__weekly_metrics_week", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__weekly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__weekly_metrics_week.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.538055, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select week as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`github__weekly_metrics`\n where week is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "week", "file_key_name": "models.github__weekly_metrics"}, "test.github.not_null_github__weekly_metrics_week.4b0b928243": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "week", "model": "{{ get_where_subquery(ref('github__weekly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__weekly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__weekly_metrics_week"], "unique_id": "test.github.not_null_github__weekly_metrics_week.4b0b928243", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__weekly_metrics_week.sql", "original_file_path": "models/github.yml", "name": "not_null_github__weekly_metrics_week", "alias": "not_null_github__weekly_metrics_week", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__weekly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__weekly_metrics_week.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.541444, "compiled_code": "\n \n \n\n\n\nselect week\nfrom `dbt-package-testing`.`github_integration_tests`.`github__weekly_metrics`\nwhere week is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "week", "file_key_name": "models.github__weekly_metrics"}, "test.github.unique_github__monthly_metrics_month.3076284fbb": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "month", "model": "{{ get_where_subquery(ref('github__monthly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__monthly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__monthly_metrics_month"], "unique_id": "test.github.unique_github__monthly_metrics_month.3076284fbb", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__monthly_metrics_month.sql", "original_file_path": "models/github.yml", "name": "unique_github__monthly_metrics_month", "alias": "unique_github__monthly_metrics_month", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__monthly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__monthly_metrics_month.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.5450659, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select month as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`github__monthly_metrics`\n where month is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "month", "file_key_name": "models.github__monthly_metrics"}, "test.github.not_null_github__monthly_metrics_month.9e4fba84df": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "month", "model": "{{ get_where_subquery(ref('github__monthly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__monthly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__monthly_metrics_month"], "unique_id": "test.github.not_null_github__monthly_metrics_month.9e4fba84df", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__monthly_metrics_month.sql", "original_file_path": "models/github.yml", "name": "not_null_github__monthly_metrics_month", "alias": "not_null_github__monthly_metrics_month", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__monthly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__monthly_metrics_month.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.5483038, "compiled_code": "\n \n \n\n\n\nselect month\nfrom `dbt-package-testing`.`github_integration_tests`.`github__monthly_metrics`\nwhere month is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "month", "file_key_name": "models.github__monthly_metrics"}, "test.github.unique_github__quarterly_metrics_quarter.9165a921c1": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "quarter", "model": "{{ get_where_subquery(ref('github__quarterly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__quarterly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__quarterly_metrics_quarter"], "unique_id": "test.github.unique_github__quarterly_metrics_quarter.9165a921c1", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__quarterly_metrics_quarter.sql", "original_file_path": "models/github.yml", "name": "unique_github__quarterly_metrics_quarter", "alias": "unique_github__quarterly_metrics_quarter", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__quarterly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__quarterly_metrics_quarter.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.551539, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select quarter as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`github__quarterly_metrics`\n where quarter is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "quarter", "file_key_name": "models.github__quarterly_metrics"}, "test.github.not_null_github__quarterly_metrics_quarter.92394d46dc": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "quarter", "model": "{{ get_where_subquery(ref('github__quarterly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__quarterly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__quarterly_metrics_quarter"], "unique_id": "test.github.not_null_github__quarterly_metrics_quarter.92394d46dc", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__quarterly_metrics_quarter.sql", "original_file_path": "models/github.yml", "name": "not_null_github__quarterly_metrics_quarter", "alias": "not_null_github__quarterly_metrics_quarter", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__quarterly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__quarterly_metrics_quarter.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.55484, "compiled_code": "\n \n \n\n\n\nselect quarter\nfrom `dbt-package-testing`.`github_integration_tests`.`github__quarterly_metrics`\nwhere quarter is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "quarter", "file_key_name": "models.github__quarterly_metrics"}, "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["issue_id", "user_id"], "model": "{{ get_where_subquery(ref('stg_github__issue_assignee')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue_assignee"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id"], "unique_id": "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388\") }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388.sql", "original_file_path": "models/stg_github.yml", "name": "dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id", "alias": "dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue_assignee"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388"}, "created_at": 1667849269.684551, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n issue_id, user_id\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_assignee`\n group by issue_id, user_id\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_github__issue_assignee"}, "test.github_source.not_null_stg_github__label_label_id.9f07379974": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "label_id", "model": "{{ get_where_subquery(ref('stg_github__label')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__label"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__label_label_id"], "unique_id": "test.github_source.not_null_stg_github__label_label_id.9f07379974", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__label_label_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__label_label_id", "alias": "not_null_stg_github__label_label_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__label"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__label_label_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.704911, "compiled_code": "\n \n \n\n\n\nselect label_id\nfrom `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\nwhere label_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "label_id", "file_key_name": "models.stg_github__label"}, "test.github_source.unique_stg_github__label_label_id.74d3c21466": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "label_id", "model": "{{ get_where_subquery(ref('stg_github__label')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__label"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__label_label_id"], "unique_id": "test.github_source.unique_stg_github__label_label_id.74d3c21466", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__label_label_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__label_label_id", "alias": "unique_stg_github__label_label_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__label"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__label_label_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.708118, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select label_id as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__label`\n where label_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "label_id", "file_key_name": "models.stg_github__label"}, "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["issue_id", "updated_at"], "model": "{{ get_where_subquery(ref('stg_github__issue_closed_history')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue_closed_history"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at"], "unique_id": "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f\") }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f.sql", "original_file_path": "models/stg_github.yml", "name": "dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at", "alias": "dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue_closed_history"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f"}, "created_at": 1667849269.711691, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n issue_id, updated_at\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_closed_history`\n group by issue_id, updated_at\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_github__issue_closed_history"}, "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "issue_comment_id", "model": "{{ get_where_subquery(ref('stg_github__issue_comment')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue_comment"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__issue_comment_issue_comment_id"], "unique_id": "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__issue_comment_issue_comment_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__issue_comment_issue_comment_id", "alias": "unique_stg_github__issue_comment_issue_comment_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue_comment"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__issue_comment_issue_comment_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.719666, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select issue_comment_id as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment`\n where issue_comment_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_comment_id", "file_key_name": "models.stg_github__issue_comment"}, "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "issue_comment_id", "model": "{{ get_where_subquery(ref('stg_github__issue_comment')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue_comment"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__issue_comment_issue_comment_id"], "unique_id": "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__issue_comment_issue_comment_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__issue_comment_issue_comment_id", "alias": "not_null_stg_github__issue_comment_issue_comment_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue_comment"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__issue_comment_issue_comment_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.723181, "compiled_code": "\n \n \n\n\n\nselect issue_comment_id\nfrom `dbt-package-testing`.`github_integration_tests`.`stg_github__issue_comment`\nwhere issue_comment_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_comment_id", "file_key_name": "models.stg_github__issue_comment"}, "test.github_source.unique_stg_github__issue_issue_id.84891aeece": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('stg_github__issue')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__issue_issue_id"], "unique_id": "test.github_source.unique_stg_github__issue_issue_id.84891aeece", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__issue_issue_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__issue_issue_id", "alias": "unique_stg_github__issue_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__issue_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.726414, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select issue_id as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\n where issue_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.stg_github__issue"}, "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('stg_github__issue')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__issue_issue_id"], "unique_id": "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__issue_issue_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__issue_issue_id", "alias": "not_null_stg_github__issue_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__issue_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.7296598, "compiled_code": "\n \n \n\n\n\nselect issue_id\nfrom `dbt-package-testing`.`github_integration_tests`.`stg_github__issue`\nwhere issue_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.stg_github__issue"}, "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "pull_request_review_id", "model": "{{ get_where_subquery(ref('stg_github__pull_request_review')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__pull_request_review"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__pull_request_review_pull_request_review_id"], "unique_id": "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__pull_request_review_pull_request_review_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__pull_request_review_pull_request_review_id", "alias": "unique_stg_github__pull_request_review_pull_request_review_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__pull_request_review"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__pull_request_review_pull_request_review_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.7329721, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select pull_request_review_id as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\n where pull_request_review_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "pull_request_review_id", "file_key_name": "models.stg_github__pull_request_review"}, "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "pull_request_review_id", "model": "{{ get_where_subquery(ref('stg_github__pull_request_review')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__pull_request_review"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__pull_request_review_pull_request_review_id"], "unique_id": "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__pull_request_review_pull_request_review_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__pull_request_review_pull_request_review_id", "alias": "not_null_stg_github__pull_request_review_pull_request_review_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__pull_request_review"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__pull_request_review_pull_request_review_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.736512, "compiled_code": "\n \n \n\n\n\nselect pull_request_review_id\nfrom `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request_review`\nwhere pull_request_review_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "pull_request_review_id", "file_key_name": "models.stg_github__pull_request_review"}, "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "pull_request_id", "model": "{{ get_where_subquery(ref('stg_github__pull_request')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__pull_request"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__pull_request_pull_request_id"], "unique_id": "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__pull_request_pull_request_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__pull_request_pull_request_id", "alias": "unique_stg_github__pull_request_pull_request_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__pull_request"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__pull_request_pull_request_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.739743, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select pull_request_id as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\n where pull_request_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "pull_request_id", "file_key_name": "models.stg_github__pull_request"}, "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "pull_request_id", "model": "{{ get_where_subquery(ref('stg_github__pull_request')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__pull_request"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__pull_request_pull_request_id"], "unique_id": "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__pull_request_pull_request_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__pull_request_pull_request_id", "alias": "not_null_stg_github__pull_request_pull_request_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__pull_request"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__pull_request_pull_request_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.742954, "compiled_code": "\n \n \n\n\n\nselect pull_request_id\nfrom `dbt-package-testing`.`github_integration_tests`.`stg_github__pull_request`\nwhere pull_request_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "pull_request_id", "file_key_name": "models.stg_github__pull_request"}, "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "repository_id", "model": "{{ get_where_subquery(ref('stg_github__repo_team')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__repo_team"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__repo_team_repository_id"], "unique_id": "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__repo_team_repository_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__repo_team_repository_id", "alias": "not_null_stg_github__repo_team_repository_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__repo_team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__repo_team_repository_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.7461839, "compiled_code": "\n \n \n\n\n\nselect repository_id\nfrom `dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team`\nwhere repository_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "repository_id", "file_key_name": "models.stg_github__repo_team"}, "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "team_id", "model": "{{ get_where_subquery(ref('stg_github__repo_team')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__repo_team"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__repo_team_team_id"], "unique_id": "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__repo_team_team_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__repo_team_team_id", "alias": "not_null_stg_github__repo_team_team_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__repo_team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__repo_team_team_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.749707, "compiled_code": "\n \n \n\n\n\nselect team_id\nfrom `dbt-package-testing`.`github_integration_tests`.`stg_github__repo_team`\nwhere team_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "team_id", "file_key_name": "models.stg_github__repo_team"}, "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "repository_id", "model": "{{ get_where_subquery(ref('stg_github__repository')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__repository"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__repository_repository_id"], "unique_id": "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__repository_repository_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__repository_repository_id", "alias": "unique_stg_github__repository_repository_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__repository"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__repository_repository_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.752929, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select repository_id as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__repository`\n where repository_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "repository_id", "file_key_name": "models.stg_github__repository"}, "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "repository_id", "model": "{{ get_where_subquery(ref('stg_github__repository')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__repository"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__repository_repository_id"], "unique_id": "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__repository_repository_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__repository_repository_id", "alias": "not_null_stg_github__repository_repository_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__repository"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__repository_repository_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.756143, "compiled_code": "\n \n \n\n\n\nselect repository_id\nfrom `dbt-package-testing`.`github_integration_tests`.`stg_github__repository`\nwhere repository_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "repository_id", "file_key_name": "models.stg_github__repository"}, "test.github_source.unique_stg_github__team_team_id.94e9716ab4": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "team_id", "model": "{{ get_where_subquery(ref('stg_github__team')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__team"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__team_team_id"], "unique_id": "test.github_source.unique_stg_github__team_team_id.94e9716ab4", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__team_team_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__team_team_id", "alias": "unique_stg_github__team_team_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__team_team_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.759424, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select team_id as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__team`\n where team_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "team_id", "file_key_name": "models.stg_github__team"}, "test.github_source.not_null_stg_github__team_team_id.440aefe7a7": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "team_id", "model": "{{ get_where_subquery(ref('stg_github__team')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__team"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__team_team_id"], "unique_id": "test.github_source.not_null_stg_github__team_team_id.440aefe7a7", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__team_team_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__team_team_id", "alias": "not_null_stg_github__team_team_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__team_team_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.763335, "compiled_code": "\n \n \n\n\n\nselect team_id\nfrom `dbt-package-testing`.`github_integration_tests`.`stg_github__team`\nwhere team_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "team_id", "file_key_name": "models.stg_github__team"}, "test.github_source.unique_stg_github__user_user_id.5c1a00cd90": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(ref('stg_github__user')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__user"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__user_user_id"], "unique_id": "test.github_source.unique_stg_github__user_user_id.5c1a00cd90", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__user_user_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__user_user_id", "alias": "unique_stg_github__user_user_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__user"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__user_user_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.766531, "compiled_code": "\n \n \n\nwith dbt_test__target as (\n\n select user_id as unique_field\n from `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\n where user_id is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "user_id", "file_key_name": "models.stg_github__user"}, "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(ref('stg_github__user')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__user"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dbt-package-testing", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__user_user_id"], "unique_id": "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__user_user_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__user_user_id", "alias": "not_null_stg_github__user_user_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__user"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__user_user_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1667849269.769741, "compiled_code": "\n \n \n\n\n\nselect user_id\nfrom `dbt-package-testing`.`github_integration_tests`.`stg_github__user`\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "user_id", "file_key_name": "models.stg_github__user"}}, "sources": {"source.github_source.github.issue_assignee": {"fqn": ["github_source", "github", "issue_assignee"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue_assignee", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue_assignee", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_issue_assignee_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table with the current user(s) assigned to an issue", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_assignee_data`", "created_at": 1667849269.7722812}, "source.github_source.github.label": {"fqn": ["github_source", "github", "label"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.label", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "label", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_label_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Table that contains labels that are used across your Github account within individual repositories.", "columns": {"id": {"name": "id", "description": "Unique identifier of the Github label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of the record being synced by Fivetran", "meta": {}, "data_type": null, "quote": null, "tags": []}, "color": {"name": "color", "description": "The color of the label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "The description of the label indicating the purpose", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_default": {"name": "is_default", "description": "Boolean flagging if the label is default on creation", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "Name of the label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url": {"name": "url", "description": "Url where the label was used", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_label_data`", "created_at": 1667849269.7725282}, "source.github_source.github.issue_closed_history": {"fqn": ["github_source", "github", "issue_closed_history"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue_closed_history", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue_closed_history", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_issue_closed_history_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table to track when an issue is closed or re-opened", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the action took place", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed": {"name": "closed", "description": "Boolean variable for if the issue was closed (true) or re-opened (false)", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_closed_history_data`", "created_at": 1667849269.772745}, "source.github_source.github.issue_label": {"fqn": ["github_source", "github", "issue_label"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue_label", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue_label", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_issue_label_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "The current labels attached to an issue", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "label_id": {"name": "label_id", "description": "Unique identifier of the used label", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_label_data`", "created_at": 1667849269.772955}, "source.github_source.github.issue_comment": {"fqn": ["github_source", "github", "issue_comment"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue_comment", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue_comment", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_issue_comment_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table that contains comments made on issues", "columns": {"id": {"name": "id", "description": "System generated unique id for the issue comment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_comment_data`", "created_at": 1667849269.773164}, "source.github_source.github.issue_merged": {"fqn": ["github_source", "github", "issue_merged"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue_merged", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue_merged", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_issue_merged_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table that tracks when an issue (always a pull request) is merged", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table. This table will only reference issues that are pull requests", "meta": {}, "data_type": null, "quote": null, "tags": []}, "merged_at": {"name": "merged_at", "description": "Timestamp of when the code merge took place", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_merged_data`", "created_at": 1667849269.773365}, "source.github_source.github.issue": {"fqn": ["github_source", "github", "issue"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_issue_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table that contains 1 entry for every issue created. Pull Requests also create an entry in this table, and there is a boolean field to determine if an entry is a pull request.", "columns": {"id": {"name": "id", "description": "System generated unique id for the issue. This is not the number that appears in the URL.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "body": {"name": "body", "description": "The text of the main description of the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "locked": {"name": "locked", "description": "Boolean indicating whether the issue is locked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed_at": {"name": "closed_at", "description": "Timestamp of when the issue was closed, NULL for issues that are open.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the issue was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "milestone_id": {"name": "milestone_id", "description": "Foreign key that references the milestone table representing the current milestone the issue is in.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number": {"name": "number", "description": "The issue number within a repository. Is unique by repository, but not across repositories.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pull_request": {"name": "pull_request", "description": "Boolean for is the issue is a pull request (true) ot regular issue (false)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_id": {"name": "repository_id", "description": "Foreign key that references the repository table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the issue is open or closed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "Title of the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the last update was made to the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table, representing the user that created the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_issue_data`", "created_at": 1667849269.7735941}, "source.github_source.github.pull_request_review": {"fqn": ["github_source", "github", "pull_request_review"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.pull_request_review", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "pull_request_review", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_pull_request_review_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table containing reviews made to pull requests", "columns": {"id": {"name": "id", "description": "System generated unique id for the pull request review.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pull_request_id": {"name": "pull_request_id", "description": "Foreign key that references the pull request table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "submitted_at": {"name": "submitted_at", "description": "Timestamp of when the request for review was submitted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the review was an approval, request for change, comment, dismissal.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table, representing the user that reviewed the pull request.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_pull_request_review_data`", "created_at": 1667849269.7738008}, "source.github_source.github.pull_request": {"fqn": ["github_source", "github", "pull_request"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.pull_request", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "pull_request", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_pull_request_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "A special type of issue that is created when a user wants to merge one branch of code into another", "columns": {"id": {"name": "id", "description": "System generated unique id for the pull request.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "head_repo_id": {"name": "head_repo_id", "description": "Foreign key that references the repository table, referencing the current branch.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "head_user_id": {"name": "head_user_id", "description": "Foreign key that references the user table, referencing who created the current branch.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_pull_request_data`", "created_at": 1667849269.774009}, "source.github_source.github.repo_team": {"fqn": ["github_source", "github", "repo_team"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.repo_team", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "repo_team", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_repo_team_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table representing the mapping relationships between repositories and teams", "columns": {"repository_id": {"name": "repository_id", "description": "Reference to the respective repository for the record.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "team_id": {"name": "team_id", "description": "Reference to the respective team for the record.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {"is_enabled": true}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_repo_team_data`", "created_at": 1667849269.774208}, "source.github_source.github.repository": {"fqn": ["github_source", "github", "repository"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.repository", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "repository", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_repository_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Table representing the file structure of a directory under git control", "columns": {"id": {"name": "id", "description": "System generated unique id for the repository.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the repository was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "full_name": {"name": "full_name", "description": "The name of the git repository.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "private": {"name": "private", "description": "Boolean field indicating whether the repository is private (true) or public (false).", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_repository_data`", "created_at": 1667849269.774401}, "source.github_source.github.requested_reviewer_history": {"fqn": ["github_source", "github", "requested_reviewer_history"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.requested_reviewer_history", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "requested_reviewer_history", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_requested_reviewer_history_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table containing when a user requests another user to review a pull request", "columns": {"pull_request_id": {"name": "pull_request_id", "description": "Foreign key that references the pull request table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the review was submitted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "requested_id": {"name": "requested_id", "description": "Foreign key that references the user table, representing the user that was requested to review a PR.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "removed": {"name": "removed", "description": "Boolean variable indicating if the requester was removed from the PR (true) or added to the PR (false).", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_requested_reviewer_history_data`", "created_at": 1667849269.7746072}, "source.github_source.github.team": {"fqn": ["github_source", "github", "team"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.team", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "team", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_team_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table containing teams and team details", "columns": {"id": {"name": "id", "description": "System generated unique id for the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "User created description of the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "User created name of the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "Reference to the parent team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "privacy": {"name": "privacy", "description": "Type of privacy permissions associated with the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "slug": {"name": "slug", "description": "Url friendly version of the team name.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_team_data`", "created_at": 1667849269.774818}, "source.github_source.github.user": {"fqn": ["github_source", "github", "user"], "database": "dbt-package-testing", "schema": "github_integration_tests", "unique_id": "source.github_source.github.user", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "user", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_user_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Table representing contributors to a git project", "columns": {"id": {"name": "id", "description": "System generated unique id for the user.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "login": {"name": "login", "description": "The alias the user uses to login to github.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the user", "meta": {}, "data_type": null, "quote": null, "tags": []}, "company": {"name": "company", "description": "The company of the user.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "`dbt-package-testing`.`github_integration_tests`.`github_user_data`", "created_at": 1667849269.775011}}, "macros": {"macro.dbt_bigquery.date_sharded_table": {"unique_id": "macro.dbt_bigquery.date_sharded_table", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "date_sharded_table", "macro_sql": "{% macro date_sharded_table(base_name) %}\n {{ return(base_name ~ \"[DBT__PARTITION_DATE]\") }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.022051, "supported_languages": null}, "macro.dbt_bigquery.grant_access_to": {"unique_id": "macro.dbt_bigquery.grant_access_to", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "grant_access_to", "macro_sql": "{% macro grant_access_to(entity, entity_type, role, grant_target_dict) -%}\n {% do adapter.grant_access_to(entity, entity_type, role, grant_target_dict) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.0227761, "supported_languages": null}, "macro.dbt_bigquery.get_partitions_metadata": {"unique_id": "macro.dbt_bigquery.get_partitions_metadata", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/etc.sql", "original_file_path": "macros/etc.sql", "name": "get_partitions_metadata", "macro_sql": "\n\n{%- macro get_partitions_metadata(table) -%}\n {%- if execute -%}\n {%- set res = adapter.get_partitions_metadata(table) -%}\n {{- return(res) -}}\n {%- endif -%}\n {{- return(None) -}}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.023689, "supported_languages": null}, "macro.dbt_bigquery.bigquery__get_catalog": {"unique_id": "macro.dbt_bigquery.bigquery__get_catalog", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "name": "bigquery__get_catalog", "macro_sql": "{% macro bigquery__get_catalog(information_schema, schemas) -%}\n\n {%- if (schemas | length) == 0 -%}\n {# Hopefully nothing cares about the columns we return when there are no rows #}\n {%- set query = \"select 1 as id limit 0\" -%}\n {%- else -%}\n\n {%- set query -%}\n with tables as (\n select\n project_id as table_database,\n dataset_id as table_schema,\n table_id as original_table_name,\n\n concat(project_id, '.', dataset_id, '.', table_id) as relation_id,\n\n row_count,\n size_bytes as size_bytes,\n case\n when type = 1 then 'table'\n when type = 2 then 'view'\n else 'external'\n end as table_type,\n\n REGEXP_CONTAINS(table_id, '^.+[0-9]{8}$') and coalesce(type, 0) = 1 as is_date_shard,\n REGEXP_EXTRACT(table_id, '^(.+)[0-9]{8}$') as shard_base_name,\n REGEXP_EXTRACT(table_id, '^.+([0-9]{8})$') as shard_name\n\n from {{ information_schema.replace(information_schema_view='__TABLES__') }}\n where (\n {%- for schema in schemas -%}\n upper(dataset_id) = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n ),\n\n extracted as (\n\n select *,\n case\n when is_date_shard then shard_base_name\n else original_table_name\n end as table_name\n\n from tables\n\n ),\n\n unsharded_tables as (\n\n select\n table_database,\n table_schema,\n table_name,\n coalesce(table_type, 'external') as table_type,\n is_date_shard,\n\n struct(\n min(shard_name) as shard_min,\n max(shard_name) as shard_max,\n count(*) as shard_count\n ) as table_shards,\n\n sum(size_bytes) as size_bytes,\n sum(row_count) as row_count,\n\n max(relation_id) as relation_id\n\n from extracted\n group by 1,2,3,4,5\n\n ),\n\n info_schema_columns as (\n\n select\n concat(table_catalog, '.', table_schema, '.', table_name) as relation_id,\n table_catalog as table_database,\n table_schema,\n table_name,\n\n -- use the \"real\" column name from the paths query below\n column_name as base_column_name,\n ordinal_position as column_index,\n\n is_partitioning_column,\n clustering_ordinal_position\n\n from {{ information_schema.replace(information_schema_view='COLUMNS') }}\n where ordinal_position is not null\n\n ),\n\n info_schema_column_paths as (\n\n select\n concat(table_catalog, '.', table_schema, '.', table_name) as relation_id,\n field_path as column_name,\n data_type as column_type,\n column_name as base_column_name,\n description as column_comment\n\n from {{ information_schema.replace(information_schema_view='COLUMN_FIELD_PATHS') }}\n\n ),\n\n columns as (\n\n select * except (base_column_name)\n from info_schema_columns\n join info_schema_column_paths using (relation_id, base_column_name)\n\n ),\n\n column_stats as (\n\n select\n table_database,\n table_schema,\n table_name,\n max(relation_id) as relation_id,\n max(case when is_partitioning_column = 'YES' then 1 else 0 end) = 1 as is_partitioned,\n max(case when is_partitioning_column = 'YES' then column_name else null end) as partition_column,\n max(case when clustering_ordinal_position is not null then 1 else 0 end) = 1 as is_clustered,\n array_to_string(\n array_agg(\n case\n when clustering_ordinal_position is not null then column_name\n else null\n end ignore nulls\n order by clustering_ordinal_position\n ), ', '\n ) as clustering_columns\n\n from columns\n group by 1,2,3\n\n )\n\n select\n unsharded_tables.table_database,\n unsharded_tables.table_schema,\n case\n when is_date_shard then concat(unsharded_tables.table_name, '*')\n else unsharded_tables.table_name\n end as table_name,\n unsharded_tables.table_type,\n\n -- coalesce name and type for External tables - these columns are not\n -- present in the COLUMN_FIELD_PATHS resultset\n coalesce(columns.column_name, '') as column_name,\n -- invent a row number to account for nested fields -- BQ does\n -- not treat these nested properties as independent fields\n row_number() over (\n partition by relation_id\n order by columns.column_index, columns.column_name\n ) as column_index,\n coalesce(columns.column_type, '') as column_type,\n columns.column_comment,\n\n 'Shard count' as `stats__date_shards__label`,\n table_shards.shard_count as `stats__date_shards__value`,\n 'The number of date shards in this table' as `stats__date_shards__description`,\n is_date_shard as `stats__date_shards__include`,\n\n 'Shard (min)' as `stats__date_shard_min__label`,\n table_shards.shard_min as `stats__date_shard_min__value`,\n 'The first date shard in this table' as `stats__date_shard_min__description`,\n is_date_shard as `stats__date_shard_min__include`,\n\n 'Shard (max)' as `stats__date_shard_max__label`,\n table_shards.shard_max as `stats__date_shard_max__value`,\n 'The last date shard in this table' as `stats__date_shard_max__description`,\n is_date_shard as `stats__date_shard_max__include`,\n\n '# Rows' as `stats__num_rows__label`,\n row_count as `stats__num_rows__value`,\n 'Approximate count of rows in this table' as `stats__num_rows__description`,\n (unsharded_tables.table_type = 'table') as `stats__num_rows__include`,\n\n 'Approximate Size' as `stats__num_bytes__label`,\n size_bytes as `stats__num_bytes__value`,\n 'Approximate size of table as reported by BigQuery' as `stats__num_bytes__description`,\n (unsharded_tables.table_type = 'table') as `stats__num_bytes__include`,\n\n 'Partitioned By' as `stats__partitioning_type__label`,\n partition_column as `stats__partitioning_type__value`,\n 'The partitioning column for this table' as `stats__partitioning_type__description`,\n is_partitioned as `stats__partitioning_type__include`,\n\n 'Clustered By' as `stats__clustering_fields__label`,\n clustering_columns as `stats__clustering_fields__value`,\n 'The clustering columns for this table' as `stats__clustering_fields__description`,\n is_clustered as `stats__clustering_fields__include`\n\n -- join using relation_id (an actual relation, not a shard prefix) to make\n -- sure that column metadata is picked up through the join. This will only\n -- return the column information for the \"max\" table in a date-sharded table set\n from unsharded_tables\n left join columns using (relation_id)\n left join column_stats using (relation_id)\n {%- endset -%}\n\n {%- endif -%}\n\n {{ return(run_query(query)) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.032407, "supported_languages": null}, "macro.dbt_bigquery.partition_by": {"unique_id": "macro.dbt_bigquery.partition_by", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "partition_by", "macro_sql": "{% macro partition_by(partition_config) -%}\n {%- if partition_config is none -%}\n {% do return('') %}\n {%- elif partition_config.data_type | lower in ('date','timestamp','datetime') -%}\n partition by {{ partition_config.render() }}\n {%- elif partition_config.data_type | lower in ('int64') -%}\n {%- set range = partition_config.range -%}\n partition by range_bucket(\n {{ partition_config.field }},\n generate_array({{ range.start}}, {{ range.end }}, {{ range.interval }})\n )\n {%- endif -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.0429142, "supported_languages": null}, "macro.dbt_bigquery.cluster_by": {"unique_id": "macro.dbt_bigquery.cluster_by", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "cluster_by", "macro_sql": "{% macro cluster_by(raw_cluster_by) %}\n {%- if raw_cluster_by is not none -%}\n cluster by {% if raw_cluster_by is string -%}\n {% set raw_cluster_by = [raw_cluster_by] %}\n {%- endif -%}\n {%- for cluster in raw_cluster_by -%}\n {{ cluster }}\n {%- if not loop.last -%}, {% endif -%}\n {%- endfor -%}\n\n {% endif %}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.044132, "supported_languages": null}, "macro.dbt_bigquery.bigquery_options": {"unique_id": "macro.dbt_bigquery.bigquery_options", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_options", "macro_sql": "{% macro bigquery_options(opts) %}\n {% set options -%}\n OPTIONS({% for opt_key, opt_val in opts.items() %}\n {{ opt_key }}={{ opt_val }}{{ \",\" if not loop.last }}\n {% endfor %})\n {%- endset %}\n {%- do return(options) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.045302, "supported_languages": null}, "macro.dbt_bigquery.bigquery_table_options": {"unique_id": "macro.dbt_bigquery.bigquery_table_options", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_table_options", "macro_sql": "{% macro bigquery_table_options(config, node, temporary) %}\n {% set opts = adapter.get_table_options(config, node, temporary) %}\n {%- do return(bigquery_options(opts)) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.046165, "supported_languages": null}, "macro.dbt_bigquery.bigquery__create_table_as": {"unique_id": "macro.dbt_bigquery.bigquery__create_table_as", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_table_as", "macro_sql": "{% macro bigquery__create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {%- if language == '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 {{ compiled_code }}\n );\n {%- elif language == 'python' -%}\n {#--\n N.B. Python models _can_ write to temp views HOWEVER they use a different session\n and have already expired by the time they need to be used (I.E. in merges for incremental models)\n\n TODO: Deep dive into spark sessions to see if we can reuse a single session for an entire\n dbt invocation.\n --#}\n {{ py_write_table(compiled_code=compiled_code, target_relation=relation.quote(database=False, schema=False, identifier=False)) }}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"bigquery__create_table_as macro didn't get supported language, it got %s\" % language) %}\n {%- endif -%}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.partition_by", "macro.dbt_bigquery.cluster_by", "macro.dbt_bigquery.bigquery_table_options", "macro.dbt_bigquery.py_write_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.0493171, "supported_languages": null}, "macro.dbt_bigquery.bigquery_view_options": {"unique_id": "macro.dbt_bigquery.bigquery_view_options", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery_view_options", "macro_sql": "{% macro bigquery_view_options(config, node) %}\n {% set opts = adapter.get_view_options(config, node) %}\n {%- do return(bigquery_options(opts)) -%}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.050119, "supported_languages": null}, "macro.dbt_bigquery.bigquery__create_view_as": {"unique_id": "macro.dbt_bigquery.bigquery__create_view_as", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__create_view_as", "macro_sql": "{% macro bigquery__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create or replace view {{ relation }}\n {{ bigquery_view_options(config, model) }}\n as {{ sql }};\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery_view_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.051152, "supported_languages": null}, "macro.dbt_bigquery.bigquery__drop_schema": {"unique_id": "macro.dbt_bigquery.bigquery__drop_schema", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__drop_schema", "macro_sql": "{% macro bigquery__drop_schema(relation) -%}\n {{ adapter.drop_schema(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.051597, "supported_languages": null}, "macro.dbt_bigquery.bigquery__drop_relation": {"unique_id": "macro.dbt_bigquery.bigquery__drop_relation", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__drop_relation", "macro_sql": "{% macro bigquery__drop_relation(relation) -%}\n {% call statement('drop_relation') -%}\n drop {{ relation.type }} if exists {{ relation }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.0522392, "supported_languages": null}, "macro.dbt_bigquery.bigquery__get_columns_in_relation": {"unique_id": "macro.dbt_bigquery.bigquery__get_columns_in_relation", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__get_columns_in_relation", "macro_sql": "{% macro bigquery__get_columns_in_relation(relation) -%}\n {{ return(adapter.get_columns_in_relation(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.052743, "supported_languages": null}, "macro.dbt_bigquery.bigquery__list_relations_without_caching": {"unique_id": "macro.dbt_bigquery.bigquery__list_relations_without_caching", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__list_relations_without_caching", "macro_sql": "{% macro bigquery__list_relations_without_caching(schema_relation) -%}\n {{ return(adapter.list_relations_without_caching(schema_relation)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.053236, "supported_languages": null}, "macro.dbt_bigquery.bigquery__list_schemas": {"unique_id": "macro.dbt_bigquery.bigquery__list_schemas", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__list_schemas", "macro_sql": "{% macro bigquery__list_schemas(database) -%}\n {{ return(adapter.list_schemas(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.053741, "supported_languages": null}, "macro.dbt_bigquery.bigquery__check_schema_exists": {"unique_id": "macro.dbt_bigquery.bigquery__check_schema_exists", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__check_schema_exists", "macro_sql": "{% macro bigquery__check_schema_exists(information_schema, schema) %}\n {{ return(adapter.check_schema_exists(information_schema.database, schema)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.054348, "supported_languages": null}, "macro.dbt_bigquery.bigquery__persist_docs": {"unique_id": "macro.dbt_bigquery.bigquery__persist_docs", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__persist_docs", "macro_sql": "{% macro bigquery__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do alter_column_comment(relation, model.columns) %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.055437, "supported_languages": null}, "macro.dbt_bigquery.bigquery__alter_column_comment": {"unique_id": "macro.dbt_bigquery.bigquery__alter_column_comment", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_column_comment", "macro_sql": "{% macro bigquery__alter_column_comment(relation, column_dict) -%}\n {% do adapter.update_columns(relation, column_dict) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.055968, "supported_languages": null}, "macro.dbt_bigquery.bigquery__rename_relation": {"unique_id": "macro.dbt_bigquery.bigquery__rename_relation", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__rename_relation", "macro_sql": "{% macro bigquery__rename_relation(from_relation, to_relation) -%}\n {% do adapter.rename_relation(from_relation, to_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.056488, "supported_languages": null}, "macro.dbt_bigquery.bigquery__alter_relation_add_columns": {"unique_id": "macro.dbt_bigquery.bigquery__alter_relation_add_columns", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_relation_add_columns", "macro_sql": "{% macro bigquery__alter_relation_add_columns(relation, add_columns) %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation }}\n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {{ return(run_query(sql)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.057782, "supported_languages": null}, "macro.dbt_bigquery.bigquery__alter_relation_drop_columns": {"unique_id": "macro.dbt_bigquery.bigquery__alter_relation_drop_columns", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_relation_drop_columns", "macro_sql": "{% macro bigquery__alter_relation_drop_columns(relation, drop_columns) %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation }}\n\n {% for column in drop_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {{ return(run_query(sql)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.059009, "supported_languages": null}, "macro.dbt_bigquery.bigquery__alter_column_type": {"unique_id": "macro.dbt_bigquery.bigquery__alter_column_type", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__alter_column_type", "macro_sql": "{% macro bigquery__alter_column_type(relation, column_name, new_column_type) -%}\n {#-- Changing a column's data type using a query requires you to scan the entire table.\n The query charges can be significant if the table is very large.\n\n https://cloud.google.com/bigquery/docs/manually-changing-schemas#changing_a_columns_data_type\n #}\n {% set relation_columns = get_columns_in_relation(relation) %}\n\n {% set sql %}\n select\n {%- for col in relation_columns -%}\n {% if col.column == column_name %}\n CAST({{ col.quoted }} AS {{ new_column_type }}) AS {{ col.quoted }}\n {%- else %}\n {{ col.quoted }}\n {%- endif %}\n {%- if not loop.last %},{% endif -%}\n {%- endfor %}\n from {{ relation }}\n {% endset %}\n\n {% call statement('alter_column_type') %}\n {{ create_table_as(False, relation, sql)}}\n {%- endcall %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_columns_in_relation", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.061151, "supported_languages": null}, "macro.dbt_bigquery.bigquery__test_unique": {"unique_id": "macro.dbt_bigquery.bigquery__test_unique", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__test_unique", "macro_sql": "{% macro bigquery__test_unique(model, column_name) %}\n\nwith dbt_test__target as (\n\n select {{ column_name }} as unique_field\n from {{ model }}\n where {{ column_name }} is not null\n\n)\n\nselect\n unique_field,\n count(*) as n_records\n\nfrom dbt_test__target\ngroup by unique_field\nhaving count(*) > 1\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.061717, "supported_languages": null}, "macro.dbt_bigquery.bigquery__upload_file": {"unique_id": "macro.dbt_bigquery.bigquery__upload_file", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "bigquery__upload_file", "macro_sql": "{% macro bigquery__upload_file(local_file_path, database, table_schema, table_name) %}\n\n {{ log(\"kwargs: \" ~ kwargs) }}\n\n {% do adapter.upload_file(local_file_path, database, table_schema, table_name, kwargs=kwargs) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.0626261, "supported_languages": null}, "macro.dbt_bigquery.bigquery__create_csv_table": {"unique_id": "macro.dbt_bigquery.bigquery__create_csv_table", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__create_csv_table", "macro_sql": "{% macro bigquery__create_csv_table(model, agate_table) %}\n -- no-op\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.0637472, "supported_languages": null}, "macro.dbt_bigquery.bigquery__reset_csv_table": {"unique_id": "macro.dbt_bigquery.bigquery__reset_csv_table", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__reset_csv_table", "macro_sql": "{% macro bigquery__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.064283, "supported_languages": null}, "macro.dbt_bigquery.bigquery__load_csv_rows": {"unique_id": "macro.dbt_bigquery.bigquery__load_csv_rows", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "bigquery__load_csv_rows", "macro_sql": "{% macro bigquery__load_csv_rows(model, agate_table) %}\n\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {{ adapter.load_dataframe(model['database'], model['schema'], model['alias'],\n \t\t\t\t\t\t\tagate_table, column_override) }}\n {% if config.persist_relation_docs() and 'description' in model %}\n\n \t{{ adapter.update_table_description(model['database'], model['schema'], model['alias'], model['description']) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.0662348, "supported_languages": null}, "macro.dbt_bigquery.bigquery__handle_existing_table": {"unique_id": "macro.dbt_bigquery.bigquery__handle_existing_table", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/view.sql", "original_file_path": "macros/materializations/view.sql", "name": "bigquery__handle_existing_table", "macro_sql": "{% macro bigquery__handle_existing_table(full_refresh, old_relation) %}\n {%- if full_refresh -%}\n {{ adapter.drop_relation(old_relation) }}\n {%- else -%}\n {{ exceptions.relation_wrong_type(old_relation, 'view') }}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.068089, "supported_languages": null}, "macro.dbt_bigquery.materialization_view_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_view_bigquery", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/view.sql", "original_file_path": "macros/materializations/view.sql", "name": "materialization_view_bigquery", "macro_sql": "{% materialization view, adapter='bigquery' -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {% set to_return = create_or_replace_view() %}\n\n {% set target_relation = this.incorporate(type='view') %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if config.get('grant_access_to') %}\n {% for grant_target_dict in config.get('grant_access_to') %}\n {% do adapter.grant_access_to(this, 'view', None, grant_target_dict) %}\n {% endfor %}\n {% endif %}\n\n {% do return(to_return) %}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_or_replace_view", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.0702488, "supported_languages": ["sql"]}, "macro.dbt_bigquery.materialization_table_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_table_bigquery", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "name": "materialization_table_bigquery", "macro_sql": "{% materialization table, adapter='bigquery', supported_languages=['sql', 'python']-%}\n\n {%- set language = model['language'] -%}\n {%- set identifier = model['alias'] -%}\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_not_as_table = (old_relation is not none and not old_relation.is_table) -%}\n {%- set target_relation = api.Relation.create(database=database, schema=schema, identifier=identifier, type='table') -%}\n\n -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\n\n {{ run_hooks(pre_hooks) }}\n\n {#\n We only need to drop this thing if it is not a table.\n If it _is_ already a table, then we can overwrite it without downtime\n Unlike table -> view, no need for `--full-refresh`: dropping a view is no big deal\n #}\n {%- if exists_not_as_table -%}\n {{ adapter.drop_relation(old_relation) }}\n {%- endif -%}\n\n -- build model\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set partition_by = adapter.parse_partition_by(raw_partition_by) -%}\n {%- set cluster_by = config.get('cluster_by', none) -%}\n {% if not adapter.is_replaceable(old_relation, partition_by, cluster_by) %}\n {% do log(\"Hard refreshing \" ~ old_relation ~ \" because it is not replaceable\") %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n\n -- build model\n {%- call statement('main', language=language) -%}\n {{ create_table_as(False, target_relation, compiled_code, language) }}\n {%- endcall -%}\n\n {{ run_hooks(post_hooks) }}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.079746, "supported_languages": ["sql", "python"]}, "macro.dbt_bigquery.py_write_table": {"unique_id": "macro.dbt_bigquery.py_write_table", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "name": "py_write_table", "macro_sql": "{% macro py_write_table(compiled_code, target_relation) %}\nfrom pyspark.sql import SparkSession\n\nspark = SparkSession.builder.appName('smallTest').getOrCreate()\n\nspark.conf.set(\"viewsEnabled\",\"true\")\nspark.conf.set(\"temporaryGcsBucket\",\"{{target.gcs_bucket}}\")\n\n{{ compiled_code }}\ndbt = dbtObj(spark.read.format(\"bigquery\").load)\ndf = model(dbt, spark)\n\n# COMMAND ----------\n# this is materialization code dbt generated, please do not modify\n\nimport pyspark\n# make sure pandas exists before using it\ntry:\n import pandas\n pandas_available = True\nexcept ImportError:\n pandas_available = False\n\n# make sure pyspark.pandas exists before using it\ntry:\n import pyspark.pandas\n pyspark_pandas_api_available = True\nexcept ImportError:\n pyspark_pandas_api_available = False\n\n# make sure databricks.koalas exists before using it\ntry:\n import databricks.koalas\n koalas_available = True\nexcept ImportError:\n koalas_available = False\n\n# preferentially convert pandas DataFrames to pandas-on-Spark or Koalas DataFrames first\n# since they know how to convert pandas DataFrames better than `spark.createDataFrame(df)`\n# and converting from pandas-on-Spark to Spark DataFrame has no overhead\nif pyspark_pandas_api_available and pandas_available and isinstance(df, pandas.core.frame.DataFrame):\n df = pyspark.pandas.frame.DataFrame(df)\nelif koalas_available and pandas_available and isinstance(df, pandas.core.frame.DataFrame):\n df = databricks.koalas.frame.DataFrame(df)\n\n# convert to pyspark.sql.dataframe.DataFrame\nif isinstance(df, pyspark.sql.dataframe.DataFrame):\n pass # since it is already a Spark DataFrame\nelif pyspark_pandas_api_available and isinstance(df, pyspark.pandas.frame.DataFrame):\n df = df.to_spark()\nelif koalas_available and isinstance(df, databricks.koalas.frame.DataFrame):\n df = df.to_spark()\nelif pandas_available and isinstance(df, pandas.core.frame.DataFrame):\n df = spark.createDataFrame(df)\nelse:\n msg = f\"{type(df)} is not a supported type for dbt Python materialization\"\n raise Exception(msg)\n\ndf.write \\\n .mode(\"overwrite\") \\\n .format(\"bigquery\") \\\n .option(\"writeMethod\", \"direct\").option(\"writeDisposition\", 'WRITE_TRUNCATE') \\\n .save(\"{{target_relation}}\")\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.080779, "supported_languages": null}, "macro.dbt_bigquery.materialization_copy_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_copy_bigquery", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/copy.sql", "original_file_path": "macros/materializations/copy.sql", "name": "materialization_copy_bigquery", "macro_sql": "{% materialization copy, adapter='bigquery' -%}\n\n {# Setup #}\n {{ run_hooks(pre_hooks) }}\n\n {% set destination = this.incorporate(type='table') %}\n\n {# there can be several ref() or source() according to BQ copy API docs #}\n {# cycle over ref() and source() to create source tables array #}\n {% set source_array = [] %}\n {% for ref_table in model.refs %}\n {{ source_array.append(ref(*ref_table)) }}\n {% endfor %}\n\n {% for src_table in model.sources %}\n {{ source_array.append(source(*src_table)) }}\n {% endfor %}\n\n {# Call adapter copy_table function #}\n {%- set result_str = adapter.copy_table(\n source_array,\n destination,\n config.get('copy_materialization', default = 'table')) -%}\n\n {{ store_result('main', response=result_str) }}\n\n {# Clean up #}\n {{ run_hooks(post_hooks) }}\n {%- do apply_grants(target_relation, grant_config) -%}\n {{ adapter.commit() }}\n\n {{ return({'relations': [destination]}) }}\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.084664, "supported_languages": ["sql"]}, "macro.dbt_bigquery.declare_dbt_max_partition": {"unique_id": "macro.dbt_bigquery.declare_dbt_max_partition", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "declare_dbt_max_partition", "macro_sql": "{% macro declare_dbt_max_partition(relation, partition_by, complied_code, language='sql') %}\n\n {#-- TODO: revisit partitioning with python models --#}\n {%- if '_dbt_max_partition' in complied_code and language == 'sql' -%}\n\n declare _dbt_max_partition {{ partition_by.data_type }} default (\n select max({{ partition_by.field }}) from {{ this }}\n where {{ partition_by.field }} is not null\n );\n\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.090793, "supported_languages": null}, "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": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "dbt_bigquery_validate_get_incremental_strategy", "macro_sql": "{% macro dbt_bigquery_validate_get_incremental_strategy(config) %}\n {#-- Find and validate the incremental strategy #}\n {%- set strategy = config.get(\"incremental_strategy\") or '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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.092235, "supported_languages": null}, "macro.dbt_bigquery.bq_insert_overwrite": {"unique_id": "macro.dbt_bigquery.bq_insert_overwrite", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "bq_insert_overwrite", "macro_sql": "{% macro bq_insert_overwrite(\n tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n) %}\n\n {% if partitions is not none and partitions != [] %} {# static #}\n\n {% set predicate -%}\n {{ partition_by.render(alias='DBT_INTERNAL_DEST') }} in (\n {{ partitions | join (', ') }}\n )\n {%- endset %}\n\n {%- set source_sql -%}\n (\n {{sql}}\n )\n {%- endset -%}\n\n {#-- Because we're putting the model SQL _directly_ into the MERGE statement,\n we need to prepend the MERGE statement with the user-configured sql_header,\n which may be needed to resolve that model SQL (e.g. referencing a variable or UDF in the header)\n in the \"dynamic\" case, we save the model SQL result as a temp table first, wherein the\n sql_header is included by the create_table_as macro.\n #}\n {{ get_insert_overwrite_merge_sql(target_relation, source_sql, dest_columns, [predicate], include_sql_header=true) }}\n\n {% else %} {# dynamic #}\n\n {% set predicate -%}\n {{ partition_by.render(alias='DBT_INTERNAL_DEST') }} in unnest(dbt_partitions_for_replacement)\n {%- endset %}\n\n {%- set source_sql -%}\n (\n select * from {{ tmp_relation }}\n )\n {%- endset -%}\n\n -- generated script to merge partitions into {{ target_relation }}\n declare dbt_partitions_for_replacement array<{{ partition_by.data_type }}>;\n\n {# have we already created the temp table to check for schema changes? #}\n {% if not tmp_relation_exists %}\n {{ declare_dbt_max_partition(this, partition_by, sql) }}\n\n -- 1. create a temp table\n {{ create_table_as(True, tmp_relation, compiled_code) }}\n {% else %}\n -- 1. temp table already exists, we used it to check for schema changes\n {% endif %}\n\n -- 2. define partitions to update\n set (dbt_partitions_for_replacement) = (\n select as struct\n array_agg(distinct {{ partition_by.render() }})\n from {{ tmp_relation }}\n );\n\n -- 3. run the merge statement\n {{ get_insert_overwrite_merge_sql(target_relation, source_sql, dest_columns, [predicate]) }};\n\n -- 4. clean up the temp table\n drop table if exists {{ tmp_relation }}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql", "macro.dbt_bigquery.declare_dbt_max_partition", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.096151, "supported_languages": null}, "macro.dbt_bigquery.bq_generate_incremental_build_sql": {"unique_id": "macro.dbt_bigquery.bq_generate_incremental_build_sql", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "bq_generate_incremental_build_sql", "macro_sql": "{% macro bq_generate_incremental_build_sql(\n strategy, tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n) %}\n {#-- if partitioned, use BQ scripting to get the range of partition values to be updated --#}\n {% if strategy == 'insert_overwrite' %}\n\n {% set missing_partition_msg -%}\n The 'insert_overwrite' strategy requires the `partition_by` config.\n {%- endset %}\n {% if partition_by is none %}\n {% do exceptions.raise_compiler_error(missing_partition_msg) %}\n {% endif %}\n\n {% set build_sql = bq_insert_overwrite(\n tmp_relation, target_relation, sql, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n ) %}\n\n {% else %} {# strategy == 'merge' #}\n {%- set source_sql -%}\n {%- if tmp_relation_exists -%}\n (\n select * from {{ tmp_relation }}\n )\n {%- else -%} {#-- wrap sql in parens to make it a subquery --#}\n (\n {{sql}}\n )\n {%- endif -%}\n {%- endset -%}\n\n {% set build_sql = get_merge_sql(target_relation, source_sql, unique_key, dest_columns) %}\n\n {% endif %}\n\n {{ return(build_sql) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bq_insert_overwrite", "macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.098884, "supported_languages": null}, "macro.dbt_bigquery.materialization_incremental_bigquery": {"unique_id": "macro.dbt_bigquery.materialization_incremental_bigquery", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "materialization_incremental_bigquery", "macro_sql": "{% materialization incremental, adapter='bigquery', supported_languages=['sql', 'python'] -%}\n\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n {%- set language = model['language'] %}\n\n {%- set target_relation = this %}\n {%- set existing_relation = load_relation(this) %}\n {%- set tmp_relation = make_temp_relation(this) %}\n\n {#-- Validate early so we don't run SQL if the strategy is invalid --#}\n {% set strategy = dbt_bigquery_validate_get_incremental_strategy(config) -%}\n\n {%- set raw_partition_by = config.get('partition_by', none) -%}\n {%- set partition_by = adapter.parse_partition_by(raw_partition_by) -%}\n {%- set partitions = config.get('partitions', none) -%}\n {%- set cluster_by = config.get('cluster_by', none) -%}\n\n {% set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') %}\n\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n {% if existing_relation is none %}\n {%- call statement('main', language=language) -%}\n {{ create_table_as(False, target_relation, compiled_code, language) }}\n {%- endcall -%}\n\n {% elif existing_relation.is_view %}\n {#-- There's no way to atomically replace a view with a table on BQ --#}\n {{ adapter.drop_relation(existing_relation) }}\n {%- call statement('main', language=language) -%}\n {{ create_table_as(False, target_relation, compiled_code, language) }}\n {%- endcall -%}\n\n {% elif full_refresh_mode %}\n {#-- If the partition/cluster config has changed, then we must drop and recreate --#}\n {% if not adapter.is_replaceable(existing_relation, partition_by, cluster_by) %}\n {% do log(\"Hard refreshing \" ~ existing_relation ~ \" because it is not replaceable\") %}\n {{ adapter.drop_relation(existing_relation) }}\n {% endif %}\n {%- call statement('main', language=language) -%}\n {{ create_table_as(False, target_relation, compiled_code, language) }}\n {%- endcall -%}\n\n {% else %}\n {%- if language == 'python' and strategy == 'insert_overwrite' -%}\n {#-- This lets us move forward assuming no python will be directly templated into a query --#}\n {%- set python_unsupported_msg -%}\n The 'insert_overwrite' strategy is not yet supported for python models.\n {%- endset %}\n {% do exceptions.raise_compiler_error(python_unsupported_msg) %}\n {%- endif -%}\n\n {% set tmp_relation_exists = false %}\n {% if on_schema_change != 'ignore' or language == 'python' %}\n {#-- Check first, since otherwise we may not build a temp table --#}\n {#-- Python always needs to create a temp table --#}\n {%- call statement('create_tmp_relation', language=language) -%}\n {{ declare_dbt_max_partition(this, partition_by, compiled_code, language) +\n create_table_as(True, tmp_relation, compiled_code, language)\n }}\n {%- endcall -%}\n {% set tmp_relation_exists = true %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, tmp_relation, existing_relation) %}\n {% endif %}\n\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n {% set build_sql = bq_generate_incremental_build_sql(\n strategy, tmp_relation, target_relation, compiled_code, unique_key, partition_by, partitions, dest_columns, tmp_relation_exists\n ) %}\n\n {%- call statement('main') -%}\n {{ build_sql }}\n {% endcall %}\n\n {%- if language == 'python' and tmp_relation -%}\n {{ adapter.drop_relation(tmp_relation) }}\n {%- endif -%}\n\n {% endif %}\n\n {{ run_hooks(post_hooks) }}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.load_relation", "macro.dbt.make_temp_relation", "macro.dbt_bigquery.dbt_bigquery_validate_get_incremental_strategy", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt_bigquery.declare_dbt_max_partition", "macro.dbt.process_schema_changes", "macro.dbt_bigquery.bq_generate_incremental_build_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.109974, "supported_languages": ["sql", "python"]}, "macro.dbt_bigquery.bigquery__snapshot_hash_arguments": {"unique_id": "macro.dbt_bigquery.bigquery__snapshot_hash_arguments", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__snapshot_hash_arguments", "macro_sql": "{% macro bigquery__snapshot_hash_arguments(args) -%}\n to_hex(md5(concat({%- for arg in args -%}\n coalesce(cast({{ arg }} as string), ''){% if not loop.last %}, '|',{% endif -%}\n {%- endfor -%}\n )))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.111441, "supported_languages": null}, "macro.dbt_bigquery.bigquery__create_columns": {"unique_id": "macro.dbt_bigquery.bigquery__create_columns", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__create_columns", "macro_sql": "{% macro bigquery__create_columns(relation, columns) %}\n {{ adapter.alter_table_add_columns(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.111964, "supported_languages": null}, "macro.dbt_bigquery.bigquery__post_snapshot": {"unique_id": "macro.dbt_bigquery.bigquery__post_snapshot", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "bigquery__post_snapshot", "macro_sql": "{% macro bigquery__post_snapshot(staging_relation) %}\n -- Clean up the snapshot temp table\n {% do drop_relation(staging_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.112418, "supported_languages": null}, "macro.dbt_bigquery.bigquery__except": {"unique_id": "macro.dbt_bigquery.bigquery__except", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "name": "bigquery__except", "macro_sql": "{% macro bigquery__except() %}\n\n except distinct\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.113031, "supported_languages": null}, "macro.dbt_bigquery.bigquery__dateadd": {"unique_id": "macro.dbt_bigquery.bigquery__dateadd", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "name": "bigquery__dateadd", "macro_sql": "{% macro bigquery__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n datetime_add(\n cast( {{ from_date_or_timestamp }} as datetime),\n interval {{ interval }} {{ datepart }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.113991, "supported_languages": null}, "macro.dbt_bigquery.bigquery__current_timestamp": {"unique_id": "macro.dbt_bigquery.bigquery__current_timestamp", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/timestamps.sql", "original_file_path": "macros/utils/timestamps.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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.114763, "supported_languages": null}, "macro.dbt_bigquery.bigquery__snapshot_string_as_time": {"unique_id": "macro.dbt_bigquery.bigquery__snapshot_string_as_time", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/timestamps.sql", "original_file_path": "macros/utils/timestamps.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, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.1153631, "supported_languages": null}, "macro.dbt_bigquery.bigquery__current_timestamp_backcompat": {"unique_id": "macro.dbt_bigquery.bigquery__current_timestamp_backcompat", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/timestamps.sql", "original_file_path": "macros/utils/timestamps.sql", "name": "bigquery__current_timestamp_backcompat", "macro_sql": "{% macro bigquery__current_timestamp_backcompat() -%}\n current_timestamp\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.115637, "supported_languages": null}, "macro.dbt_bigquery.bigquery__intersect": {"unique_id": "macro.dbt_bigquery.bigquery__intersect", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "name": "bigquery__intersect", "macro_sql": "{% macro bigquery__intersect() %}\n\n intersect distinct\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.116256, "supported_languages": null}, "macro.dbt_bigquery.bigquery__escape_single_quotes": {"unique_id": "macro.dbt_bigquery.bigquery__escape_single_quotes", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "name": "bigquery__escape_single_quotes", "macro_sql": "{% macro bigquery__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\", \"\\\\'\") }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.117132, "supported_languages": null}, "macro.dbt_bigquery.bigquery__right": {"unique_id": "macro.dbt_bigquery.bigquery__right", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "name": "bigquery__right", "macro_sql": "{% macro bigquery__right(string_text, length_expression) %}\n\n case when {{ length_expression }} = 0\n then ''\n else\n substr(\n {{ string_text }},\n -1 * ({{ length_expression }})\n )\n end\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.118114, "supported_languages": null}, "macro.dbt_bigquery.bigquery__listagg": {"unique_id": "macro.dbt_bigquery.bigquery__listagg", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "name": "bigquery__listagg", "macro_sql": "{% macro bigquery__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n string_agg(\n {{ measure }},\n {{ delimiter_text }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n {% if limit_num -%}\n limit {{ limit_num }}\n {%- endif %}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.119581, "supported_languages": null}, "macro.dbt_bigquery.bigquery__datediff": {"unique_id": "macro.dbt_bigquery.bigquery__datediff", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "name": "bigquery__datediff", "macro_sql": "{% macro bigquery__datediff(first_date, second_date, datepart) -%}\n\n {% if dbt_version[0] == 1 and dbt_version[2] >= 2 %}\n {{ return(dbt.datediff(first_date, second_date, datepart)) }}\n {% else %}\n\n datetime_diff(\n cast({{second_date}} as datetime),\n cast({{first_date}} as datetime),\n {{datepart}}\n )\n\n {% endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.121366, "supported_languages": null}, "macro.dbt_bigquery.bigquery__safe_cast": {"unique_id": "macro.dbt_bigquery.bigquery__safe_cast", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "name": "bigquery__safe_cast", "macro_sql": "{% macro bigquery__safe_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.122184, "supported_languages": null}, "macro.dbt_bigquery.bigquery__hash": {"unique_id": "macro.dbt_bigquery.bigquery__hash", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "name": "bigquery__hash", "macro_sql": "{% macro bigquery__hash(field) -%}\n to_hex({{dbt.default__hash(field)}})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.122995, "supported_languages": null}, "macro.dbt_bigquery.bigquery__position": {"unique_id": "macro.dbt_bigquery.bigquery__position", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "name": "bigquery__position", "macro_sql": "{% macro bigquery__position(substring_text, string_text) %}\n\n strpos(\n {{ string_text }},\n {{ substring_text }}\n\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.1238568, "supported_languages": null}, "macro.dbt_bigquery.bigquery__array_concat": {"unique_id": "macro.dbt_bigquery.bigquery__array_concat", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "name": "bigquery__array_concat", "macro_sql": "{% macro bigquery__array_concat(array_1, array_2) -%}\n array_concat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.1246898, "supported_languages": null}, "macro.dbt_bigquery.bigquery__bool_or": {"unique_id": "macro.dbt_bigquery.bigquery__bool_or", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "name": "bigquery__bool_or", "macro_sql": "{% macro bigquery__bool_or(expression) -%}\n\n logical_or({{ expression }})\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.1254349, "supported_languages": null}, "macro.dbt_bigquery.bigquery__split_part": {"unique_id": "macro.dbt_bigquery.bigquery__split_part", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "name": "bigquery__split_part", "macro_sql": "{% macro bigquery__split_part(string_text, delimiter_text, part_number) %}\n\n {% if part_number >= 0 %}\n split(\n {{ string_text }},\n {{ delimiter_text }}\n )[safe_offset({{ part_number - 1 }})]\n {% else %}\n split(\n {{ string_text }},\n {{ delimiter_text }}\n )[safe_offset(\n length({{ string_text }})\n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 1\n )]\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.127519, "supported_languages": null}, "macro.dbt_bigquery.bigquery__date_trunc": {"unique_id": "macro.dbt_bigquery.bigquery__date_trunc", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "name": "bigquery__date_trunc", "macro_sql": "{% macro bigquery__date_trunc(datepart, date) -%}\n timestamp_trunc(\n cast({{date}} as timestamp),\n {{datepart}}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.128372, "supported_languages": null}, "macro.dbt_bigquery.bigquery__array_construct": {"unique_id": "macro.dbt_bigquery.bigquery__array_construct", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "name": "bigquery__array_construct", "macro_sql": "{% macro bigquery__array_construct(inputs, data_type) -%}\n {% if inputs|length > 0 %}\n [ {{ inputs|join(' , ') }} ]\n {% else %}\n ARRAY<{{data_type}}>[]\n {% endif %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.129604, "supported_languages": null}, "macro.dbt_bigquery.bigquery__array_append": {"unique_id": "macro.dbt_bigquery.bigquery__array_append", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "name": "bigquery__array_append", "macro_sql": "{% macro bigquery__array_append(array, new_element) -%}\n {{ array_concat(array, array_construct([new_element])) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.array_concat", "macro.dbt.array_construct"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.130538, "supported_languages": null}, "macro.dbt_bigquery.bigquery__get_show_grant_sql": {"unique_id": "macro.dbt_bigquery.bigquery__get_show_grant_sql", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "bigquery__get_show_grant_sql", "macro_sql": "{% macro bigquery__get_show_grant_sql(relation) %}\n {% set location = adapter.get_dataset_location(relation) %}\n {% set relation = relation.incorporate(location=location) %}\n\n select privilege_type, grantee\n from {{ relation.information_schema(\"OBJECT_PRIVILEGES\") }}\n where object_schema = \"{{ relation.dataset }}\"\n and object_name = \"{{ relation.identifier }}\"\n -- filter out current user\n and split(grantee, ':')[offset(1)] != session_user()\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.1326349, "supported_languages": null}, "macro.dbt_bigquery.bigquery__get_grant_sql": {"unique_id": "macro.dbt_bigquery.bigquery__get_grant_sql", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "bigquery__get_grant_sql", "macro_sql": "\n\n\n{%- macro bigquery__get_grant_sql(relation, privilege, grantee) -%}\n grant `{{ privilege }}` on {{ relation.type }} {{ relation }} to {{ '\\\"' + grantee|join('\\\", \\\"') + '\\\"' }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.133445, "supported_languages": null}, "macro.dbt_bigquery.bigquery__get_revoke_sql": {"unique_id": "macro.dbt_bigquery.bigquery__get_revoke_sql", "package_name": "dbt_bigquery", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/bigquery", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "bigquery__get_revoke_sql", "macro_sql": "{%- macro bigquery__get_revoke_sql(relation, privilege, grantee) -%}\n revoke `{{ privilege }}` on {{ relation.type }} {{ relation }} from {{ '\\\"' + grantee|join('\\\", \\\"') + '\\\"' }}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.134235, "supported_languages": null}, "macro.dbt.run_hooks": {"unique_id": "macro.dbt.run_hooks", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.1376069, "supported_languages": null}, "macro.dbt.make_hook_config": {"unique_id": "macro.dbt.make_hook_config", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.138248, "supported_languages": null}, "macro.dbt.before_begin": {"unique_id": "macro.dbt.before_begin", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.1387389, "supported_languages": null}, "macro.dbt.in_transaction": {"unique_id": "macro.dbt.in_transaction", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.13923, "supported_languages": null}, "macro.dbt.after_commit": {"unique_id": "macro.dbt.after_commit", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.139714, "supported_languages": null}, "macro.dbt.set_sql_header": {"unique_id": "macro.dbt.set_sql_header", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.1410298, "supported_languages": null}, "macro.dbt.should_full_refresh": {"unique_id": "macro.dbt.should_full_refresh", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.142035, "supported_languages": null}, "macro.dbt.should_store_failures": {"unique_id": "macro.dbt.should_store_failures", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.143051, "supported_languages": null}, "macro.dbt.snapshot_merge_sql": {"unique_id": "macro.dbt.snapshot_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "name": "snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.144536, "supported_languages": null}, "macro.dbt.default__snapshot_merge_sql": {"unique_id": "macro.dbt.default__snapshot_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "name": "default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.dbt_scd_id = DBT_INTERNAL_DEST.dbt_scd_id\n\n when matched\n and DBT_INTERNAL_DEST.dbt_valid_to is null\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.145429, "supported_languages": null}, "macro.dbt.strategy_dispatch": {"unique_id": "macro.dbt.strategy_dispatch", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "strategy_dispatch", "macro_sql": "{% macro strategy_dispatch(name) -%}\n{% set original_name = name %}\n {% if '.' in name %}\n {% set package_name, name = name.split(\".\", 1) %}\n {% else %}\n {% set package_name = none %}\n {% endif %}\n\n {% if package_name is none %}\n {% set package_context = context %}\n {% elif package_name in context %}\n {% set package_context = context[package_name] %}\n {% else %}\n {% set error_msg %}\n Could not find package '{{package_name}}', called with '{{original_name}}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n\n {%- set search_name = 'snapshot_' ~ name ~ '_strategy' -%}\n\n {% if search_name not in package_context %}\n {% set error_msg %}\n The specified strategy macro '{{name}}' was not found in package '{{ package_name }}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n {{ return(package_context[search_name]) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.154826, "supported_languages": null}, "macro.dbt.snapshot_hash_arguments": {"unique_id": "macro.dbt.snapshot_hash_arguments", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments', 'dbt')(args) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.155394, "supported_languages": null}, "macro.dbt.default__snapshot_hash_arguments": {"unique_id": "macro.dbt.default__snapshot_hash_arguments", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "default__snapshot_hash_arguments", "macro_sql": "{% macro default__snapshot_hash_arguments(args) -%}\n md5({%- for arg in args -%}\n coalesce(cast({{ arg }} as varchar ), '')\n {% if not loop.last %} || '|' || {% endif %}\n {%- endfor -%})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.1561441, "supported_languages": null}, "macro.dbt.snapshot_timestamp_strategy": {"unique_id": "macro.dbt.snapshot_timestamp_strategy", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_timestamp_strategy", "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set primary_key = config['unique_key'] %}\n {% set updated_at = config['updated_at'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/dbt-labs/dbt-core/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.dbt_valid_from < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.158421, "supported_languages": null}, "macro.dbt.snapshot_string_as_time": {"unique_id": "macro.dbt.snapshot_string_as_time", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time', 'dbt')(timestamp) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.158977, "supported_languages": null}, "macro.dbt.default__snapshot_string_as_time": {"unique_id": "macro.dbt.default__snapshot_string_as_time", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "default__snapshot_string_as_time", "macro_sql": "{% macro default__snapshot_string_as_time(timestamp) %}\n {% do exceptions.raise_not_implemented(\n 'snapshot_string_as_time macro not implemented for adapter '+adapter.type()\n ) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.159549, "supported_languages": null}, "macro.dbt.snapshot_check_all_get_existing_columns": {"unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) -%}\n {%- if not target_exists -%}\n {#-- no table yet -> return whatever the query does --#}\n {{ return((false, query_columns)) }}\n {%- endif -%}\n\n {#-- handle any schema changes --#}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=node.alias) -%}\n\n {% if check_cols_config == 'all' %}\n {%- set query_columns = get_columns_in_query(node['compiled_code']) -%}\n\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {#-- query for proper casing/quoting, to support comparison below --#}\n {%- set select_check_cols_from_target -%}\n select {{ check_cols_config | join(', ') }} from ({{ node['compiled_code'] }}) subq\n {%- endset -%}\n {% set query_columns = get_columns_in_query(select_check_cols_from_target) %}\n\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set existing_cols = adapter.get_columns_in_relation(target_relation) | map(attribute = 'name') | list -%}\n {%- set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(adapter.quote(col)) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return((ns.column_added, intersection)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.163959, "supported_languages": null}, "macro.dbt.snapshot_check_strategy": {"unique_id": "macro.dbt.snapshot_check_strategy", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set check_cols_config = config['check_cols'] %}\n {% set primary_key = config['unique_key'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n {% set updated_at = config.get('updated_at', snapshot_get_time()) %}\n\n {% set column_added = false %}\n\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n {{ get_true_sql() }}\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.get_true_sql", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.168245, "supported_languages": null}, "macro.dbt.create_columns": {"unique_id": "macro.dbt.create_columns", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns', 'dbt')(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.1776361, "supported_languages": null}, "macro.dbt.default__create_columns": {"unique_id": "macro.dbt.default__create_columns", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation }} add column \"{{ column.name }}\" {{ column.data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.178567, "supported_languages": null}, "macro.dbt.post_snapshot": {"unique_id": "macro.dbt.post_snapshot", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.17913, "supported_languages": null}, "macro.dbt.default__post_snapshot": {"unique_id": "macro.dbt.default__post_snapshot", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.179445, "supported_languages": null}, "macro.dbt.get_true_sql": {"unique_id": "macro.dbt.get_true_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "get_true_sql", "macro_sql": "{% macro get_true_sql() %}\n {{ adapter.dispatch('get_true_sql', 'dbt')() }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_true_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.179939, "supported_languages": null}, "macro.dbt.default__get_true_sql": {"unique_id": "macro.dbt.default__get_true_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__get_true_sql", "macro_sql": "{% macro default__get_true_sql() %}\n {{ return('TRUE') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.180347, "supported_languages": null}, "macro.dbt.snapshot_staging_table": {"unique_id": "macro.dbt.snapshot_staging_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "snapshot_staging_table", "macro_sql": "{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {{ adapter.dispatch('snapshot_staging_table', 'dbt')(strategy, source_sql, target_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_staging_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.1810272, "supported_languages": null}, "macro.dbt.default__snapshot_staging_table": {"unique_id": "macro.dbt.default__snapshot_staging_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__snapshot_staging_table", "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *,\n {{ strategy.unique_key }} as dbt_unique_key\n\n from {{ target_relation }}\n where dbt_valid_to is null\n\n ),\n\n insertions_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to,\n {{ strategy.scd_id }} as dbt_scd_id\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n {{ strategy.updated_at }} as dbt_valid_to\n\n from snapshot_query\n ),\n\n {%- if strategy.invalidate_hard_deletes %}\n\n deletes_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from insertions_source_data as source_data\n left outer join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_unique_key is null\n or (\n snapshotted_data.dbt_unique_key is not null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.dbt_scd_id\n\n from updates_source_data as source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where (\n {{ strategy.row_changed }}\n )\n )\n\n {%- if strategy.invalidate_hard_deletes -%}\n ,\n\n deletes as (\n\n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as dbt_valid_from,\n {{ snapshot_get_time() }} as dbt_updated_at,\n {{ snapshot_get_time() }} as dbt_valid_to,\n snapshotted_data.dbt_scd_id\n\n from snapshotted_data\n left join deletes_source_data as source_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where source_data.dbt_unique_key is null\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.invalidate_hard_deletes %}\n union all\n select * from deletes\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.1838, "supported_languages": null}, "macro.dbt.build_snapshot_table": {"unique_id": "macro.dbt.build_snapshot_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) -%}\n {{ adapter.dispatch('build_snapshot_table', 'dbt')(strategy, sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__build_snapshot_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.1844301, "supported_languages": null}, "macro.dbt.default__build_snapshot_table": {"unique_id": "macro.dbt.default__build_snapshot_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__build_snapshot_table", "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.1852689, "supported_languages": null}, "macro.dbt.build_snapshot_staging_table": {"unique_id": "macro.dbt.build_snapshot_staging_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set temp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, temp_relation, select) }}\n {% endcall %}\n\n {% do return(temp_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.18665, "supported_languages": null}, "macro.dbt.materialization_snapshot_default": {"unique_id": "macro.dbt.materialization_snapshot_default", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot.sql", "original_file_path": "macros/materializations/snapshots/snapshot.sql", "name": "materialization_snapshot_default", "macro_sql": "{% materialization snapshot, default %}\n {%- set config = model['config'] -%}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\n\n {% set target_relation_exists, target_relation = get_or_create_relation(\n database=model.database,\n schema=model.schema,\n identifier=target_table,\n type='table') -%}\n\n {%- if not target_relation.is_table -%}\n {% do exceptions.relation_wrong_type(target_relation, 'table') %}\n {%- endif -%}\n\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set strategy_macro = strategy_dispatch(strategy_name) %}\n {% set strategy = strategy_macro(model, \"snapshotted_data\", \"source_data\", config, target_relation_exists) %}\n\n {% if not target_relation_exists %}\n\n {% set build_sql = build_snapshot_table(strategy, model['compiled_code']) %}\n {% set final_sql = create_table_as(False, target_relation, build_sql) %}\n\n {% else %}\n\n {{ adapter.valid_snapshot_target(target_relation) }}\n\n {% set staging_table = build_snapshot_staging_table(strategy, sql, target_relation) %}\n\n -- this may no-op if the database does not require column expansion\n {% do adapter.expand_target_column_types(from_relation=staging_table,\n to_relation=target_relation) %}\n\n {% set missing_columns = adapter.get_missing_columns(staging_table, target_relation)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% do create_columns(target_relation, missing_columns) %}\n\n {% set source_columns = adapter.get_columns_in_relation(staging_table)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% set quoted_source_columns = [] %}\n {% for column in source_columns %}\n {% do quoted_source_columns.append(adapter.quote(column.name)) %}\n {% endfor %}\n\n {% set final_sql = snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n %}\n\n {% endif %}\n\n {% call statement('main') %}\n {{ final_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(target_relation_exists, full_refresh_mode=False) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if not target_relation_exists %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if staging_table is defined %}\n {% do post_snapshot(staging_table) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_or_create_relation", "macro.dbt.run_hooks", "macro.dbt.strategy_dispatch", "macro.dbt.build_snapshot_table", "macro.dbt.create_table_as", "macro.dbt.build_snapshot_staging_table", "macro.dbt.create_columns", "macro.dbt.snapshot_merge_sql", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes", "macro.dbt.post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.203635, "supported_languages": ["sql"]}, "macro.dbt.materialization_test_default": {"unique_id": "macro.dbt.materialization_test_default", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/test.sql", "original_file_path": "macros/materializations/tests/test.sql", "name": "materialization_test_default", "macro_sql": "{%- materialization test, default -%}\n\n {% set relations = [] %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type='table') -%} %}\n\n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n\n {% call statement(auto_begin=True) %}\n {{ create_table_as(False, target_relation, sql) }}\n {% endcall %}\n\n {% do relations.append(target_relation) %}\n\n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n\n {{ adapter.commit() }}\n\n {% else %}\n\n {% set main_sql = sql %}\n\n {% endif %}\n\n {% set limit = config.get('limit') %}\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit)}}\n\n {%- endcall %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.20992, "supported_languages": ["sql"]}, "macro.dbt.get_test_sql": {"unique_id": "macro.dbt.get_test_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "name": "get_test_sql", "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql', 'dbt')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.2114549, "supported_languages": null}, "macro.dbt.default__get_test_sql": {"unique_id": "macro.dbt.default__get_test_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "name": "default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.212451, "supported_languages": null}, "macro.dbt.get_where_subquery": {"unique_id": "macro.dbt.get_where_subquery", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "name": "get_where_subquery", "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_where_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.21379, "supported_languages": null}, "macro.dbt.default__get_where_subquery": {"unique_id": "macro.dbt.default__get_where_subquery", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "name": "default__get_where_subquery", "macro_sql": "{% macro default__get_where_subquery(relation) -%}\n {% set where = config.get('where', '') %}\n {% if where %}\n {%- set filtered -%}\n (select * from {{ relation }} where {{ where }}) dbt_subquery\n {%- endset -%}\n {% do return(filtered) %}\n {%- else -%}\n {% do return(relation) %}\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.215034, "supported_languages": null}, "macro.dbt.get_quoted_csv": {"unique_id": "macro.dbt.get_quoted_csv", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\n\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.219352, "supported_languages": null}, "macro.dbt.diff_columns": {"unique_id": "macro.dbt.diff_columns", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "diff_columns", "macro_sql": "{% macro diff_columns(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% set source_names = source_columns | map(attribute = 'column') | list %}\n {% set target_names = target_columns | map(attribute = 'column') | list %}\n\n {# --check whether the name attribute exists in the target - this does not perform a data type check #}\n {% for sc in source_columns %}\n {% if sc.name not in target_names %}\n {{ result.append(sc) }}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.2211351, "supported_languages": null}, "macro.dbt.diff_column_data_types": {"unique_id": "macro.dbt.diff_column_data_types", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "diff_column_data_types", "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.data_type != tc.data_type and not sc.can_expand_to(other_column=tc) %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.data_type } ) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.223254, "supported_languages": null}, "macro.dbt.get_merge_update_columns": {"unique_id": "macro.dbt.get_merge_update_columns", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "get_merge_update_columns", "macro_sql": "{% macro get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {{ return(adapter.dispatch('get_merge_update_columns', 'dbt')(merge_update_columns, merge_exclude_columns, dest_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.224027, "supported_languages": null}, "macro.dbt.default__get_merge_update_columns": {"unique_id": "macro.dbt.default__get_merge_update_columns", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "default__get_merge_update_columns", "macro_sql": "{% macro default__get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {%- set default_cols = dest_columns | map(attribute=\"quoted\") | list -%}\n\n {%- if merge_update_columns and merge_exclude_columns -%}\n {{ exceptions.raise_compiler_error(\n 'Model cannot specify merge_update_columns and merge_exclude_columns. Please update model to use only one config'\n )}}\n {%- elif merge_update_columns -%}\n {%- set update_columns = merge_update_columns -%}\n {%- elif merge_exclude_columns -%}\n {%- set update_columns = [] -%}\n {%- for column in dest_columns -%}\n {% if column.column | lower not in merge_exclude_columns | map(\"lower\") | list %}\n {%- do update_columns.append(column.quoted) -%}\n {% endif %}\n {%- endfor -%}\n {%- else -%}\n {%- set update_columns = default_cols -%}\n {%- endif -%}\n\n {{ return(update_columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.2263439, "supported_languages": null}, "macro.dbt.get_merge_sql": {"unique_id": "macro.dbt.get_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, predicates=none) -%}\n {{ adapter.dispatch('get_merge_sql', 'dbt')(target, source, unique_key, dest_columns, predicates) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.2369258, "supported_languages": null}, "macro.dbt.default__get_merge_sql": {"unique_id": "macro.dbt.default__get_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, predicates) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set merge_update_columns = config.get('merge_update_columns') -%}\n {%- set merge_exclude_columns = config.get('merge_exclude_columns') -%}\n {%- set update_columns = get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not mapping and unique_key is not string %}\n {% for key in unique_key %}\n {% set this_key_match %}\n DBT_INTERNAL_SOURCE.{{ key }} = DBT_INTERNAL_DEST.{{ key }}\n {% endset %}\n {% do predicates.append(this_key_match) %}\n {% endfor %}\n {% else %}\n {% set unique_key_match %}\n DBT_INTERNAL_SOURCE.{{ unique_key }} = DBT_INTERNAL_DEST.{{ unique_key }}\n {% endset %}\n {% do predicates.append(unique_key_match) %}\n {% endif %}\n {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\n\n {{ sql_header if sql_header is not none }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on {{ predicates | join(' and ') }}\n\n {% if unique_key %}\n when matched then update set\n {% for column_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv", "macro.dbt.get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.242033, "supported_languages": null}, "macro.dbt.get_delete_insert_merge_sql": {"unique_id": "macro.dbt.get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql', 'dbt')(target, source, unique_key, dest_columns) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.242809, "supported_languages": null}, "macro.dbt.default__get_delete_insert_merge_sql": {"unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not string %}\n delete from {{target }}\n using {{ source }}\n where (\n {% for key in unique_key %}\n {{ source }}.{{ key }} = {{ target }}.{{ key }}\n {{ \"and \" if not loop.last }}\n {% endfor %}\n );\n {% else %}\n delete from {{ target }}\n where (\n {{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n );\n\n {% endif %}\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.245188, "supported_languages": null}, "macro.dbt.get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql', 'dbt')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.246043, "supported_languages": null}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {#-- The only time include_sql_header is True: --#}\n {#-- BigQuery + insert_overwrite strategy + \"static\" partitions config --#}\n {#-- We should consider including the sql header at the materialization level instead --#}\n\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.248106, "supported_languages": null}, "macro.dbt.is_incremental": {"unique_id": "macro.dbt.is_incremental", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/is_incremental.sql", "original_file_path": "macros/materializations/models/incremental/is_incremental.sql", "name": "is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.2502542, "supported_languages": null}, "macro.dbt.get_incremental_append_sql": {"unique_id": "macro.dbt.get_incremental_append_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_append_sql", "macro_sql": "{% macro get_incremental_append_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_append_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.252784, "supported_languages": null}, "macro.dbt.default__get_incremental_append_sql": {"unique_id": "macro.dbt.default__get_incremental_append_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_append_sql", "macro_sql": "{% macro default__get_incremental_append_sql(arg_dict) %}\n\n {% do return(get_insert_into_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_insert_into_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.25355, "supported_languages": null}, "macro.dbt.get_incremental_delete_insert_sql": {"unique_id": "macro.dbt.get_incremental_delete_insert_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_delete_insert_sql", "macro_sql": "{% macro get_incremental_delete_insert_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_delete_insert_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_delete_insert_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.254168, "supported_languages": null}, "macro.dbt.default__get_incremental_delete_insert_sql": {"unique_id": "macro.dbt.default__get_incremental_delete_insert_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_delete_insert_sql", "macro_sql": "{% macro default__get_incremental_delete_insert_sql(arg_dict) %}\n\n {% do return(get_delete_insert_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.2550411, "supported_languages": null}, "macro.dbt.get_incremental_merge_sql": {"unique_id": "macro.dbt.get_incremental_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_merge_sql", "macro_sql": "{% macro get_incremental_merge_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.255666, "supported_languages": null}, "macro.dbt.default__get_incremental_merge_sql": {"unique_id": "macro.dbt.default__get_incremental_merge_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_merge_sql", "macro_sql": "{% macro default__get_incremental_merge_sql(arg_dict) %}\n\n {% do return(get_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.2565272, "supported_languages": null}, "macro.dbt.get_incremental_insert_overwrite_sql": {"unique_id": "macro.dbt.get_incremental_insert_overwrite_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_insert_overwrite_sql", "macro_sql": "{% macro get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_insert_overwrite_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_insert_overwrite_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.2571461, "supported_languages": null}, "macro.dbt.default__get_incremental_insert_overwrite_sql": {"unique_id": "macro.dbt.default__get_incremental_insert_overwrite_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_insert_overwrite_sql", "macro_sql": "{% macro default__get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {% do return(get_insert_overwrite_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"], arg_dict[\"predicates\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.2580101, "supported_languages": null}, "macro.dbt.get_incremental_default_sql": {"unique_id": "macro.dbt.get_incremental_default_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_default_sql", "macro_sql": "{% macro get_incremental_default_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_default_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_default_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.258629, "supported_languages": null}, "macro.dbt.default__get_incremental_default_sql": {"unique_id": "macro.dbt.default__get_incremental_default_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_default_sql", "macro_sql": "{% macro default__get_incremental_default_sql(arg_dict) %}\n\n {% do return(get_incremental_append_sql(arg_dict)) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.2591429, "supported_languages": null}, "macro.dbt.get_insert_into_sql": {"unique_id": "macro.dbt.get_insert_into_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_insert_into_sql", "macro_sql": "{% macro get_insert_into_sql(target_relation, temp_relation, dest_columns) %}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ temp_relation }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.260065, "supported_languages": null}, "macro.dbt.materialization_incremental_default": {"unique_id": "macro.dbt.materialization_incremental_default", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/incremental.sql", "original_file_path": "macros/materializations/models/incremental/incremental.sql", "name": "materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% if existing_relation is none %}\n {% set build_sql = get_create_table_as_sql(False, target_relation, sql) %}\n {% elif full_refresh_mode %}\n {% set build_sql = get_create_table_as_sql(False, intermediate_relation, sql) %}\n {% set need_swap = true %}\n {% else %}\n {% do run_query(get_create_table_as_sql(True, temp_relation, sql)) %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set incremental_predicates = config.get('incremental_predicates', none) %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.get_create_table_as_sql", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.274704, "supported_languages": ["sql"]}, "macro.dbt.incremental_validate_on_schema_change": {"unique_id": "macro.dbt.incremental_validate_on_schema_change", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "incremental_validate_on_schema_change", "macro_sql": "{% macro incremental_validate_on_schema_change(on_schema_change, default='ignore') %}\n\n {% if on_schema_change not in ['sync_all_columns', 'append_new_columns', 'fail', 'ignore'] %}\n\n {% set log_message = 'Invalid value for on_schema_change (%s) specified. Setting default value of %s.' % (on_schema_change, default) %}\n {% do log(log_message) %}\n\n {{ return(default) }}\n\n {% else %}\n\n {{ return(on_schema_change) }}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.287938, "supported_languages": null}, "macro.dbt.check_for_schema_changes": {"unique_id": "macro.dbt.check_for_schema_changes", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "check_for_schema_changes", "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n\n {% set schema_changed = False %}\n\n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n\n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n\n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.diff_columns", "macro.dbt.diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.291851, "supported_languages": null}, "macro.dbt.sync_column_schemas": {"unique_id": "macro.dbt.sync_column_schemas", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "sync_column_schemas", "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n\n {% elif on_schema_change == 'sync_all_columns' %}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n\n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n\n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n\n {% do log(schema_change_message) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.alter_relation_add_remove_columns", "macro.dbt.alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.295676, "supported_languages": null}, "macro.dbt.process_schema_changes": {"unique_id": "macro.dbt.process_schema_changes", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "process_schema_changes", "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n\n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n\n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n\n {% if schema_changes_dict['schema_changed'] %}\n\n {% if on_schema_change == 'fail' %}\n\n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways:\n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n\n Additional troubleshooting context:\n Source columns not in target: {{ schema_changes_dict['source_not_in_target'] }}\n Target columns not in source: {{ schema_changes_dict['target_not_in_source'] }}\n New column types: {{ schema_changes_dict['new_target_types'] }}\n {% endset %}\n\n {% do exceptions.raise_compiler_error(fail_msg) %}\n\n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n\n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {% endif %}\n\n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.298419, "supported_languages": null}, "macro.dbt.materialization_table_default": {"unique_id": "macro.dbt.materialization_table_default", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/table.sql", "original_file_path": "macros/materializations/models/table/table.sql", "name": "materialization_table_default", "macro_sql": "{% materialization table, default %}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do create_indexes(target_relation) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.get_create_table_as_sql", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.306106, "supported_languages": ["sql"]}, "macro.dbt.get_create_table_as_sql": {"unique_id": "macro.dbt.get_create_table_as_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "get_create_table_as_sql", "macro_sql": "{% macro get_create_table_as_sql(temporary, relation, sql) -%}\n {{ adapter.dispatch('get_create_table_as_sql', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_table_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.307809, "supported_languages": null}, "macro.dbt.default__get_create_table_as_sql": {"unique_id": "macro.dbt.default__get_create_table_as_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "default__get_create_table_as_sql", "macro_sql": "{% macro default__get_create_table_as_sql(temporary, relation, sql) -%}\n {{ return(create_table_as(temporary, relation, sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.308418, "supported_languages": null}, "macro.dbt.create_table_as": {"unique_id": "macro.dbt.create_table_as", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {# backward compatibility for create_table_as that does not support language #}\n {% if language == \"sql\" %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code)}}\n {% else %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code, language) }}\n {% endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.30982, "supported_languages": null}, "macro.dbt.default__create_table_as": {"unique_id": "macro.dbt.default__create_table_as", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.311156, "supported_languages": null}, "macro.dbt.materialization_view_default": {"unique_id": "macro.dbt.materialization_view_default", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/view.sql", "original_file_path": "macros/materializations/models/view/view.sql", "name": "materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='view') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n This relation (probably) doesn't exist yet. If it does exist, it's a leftover from\n a previous run, and we're going to try to drop it immediately. At the end of this\n materialization, we're going to rename the \"existing_relation\" to this identifier,\n and then we're going to drop it. In order to make sure we run the correct one of:\n - drop view ...\n - drop table ...\n\n We need to set the type of this relation to be the type of the existing_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the existing_relation does not\n exist, then there is nothing to move out of the way and subsequentally drop. In that case,\n this relation will be effectively unused.\n */\n {%- set backup_relation_type = 'view' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.318738, "supported_languages": ["sql"]}, "macro.dbt.handle_existing_table": {"unique_id": "macro.dbt.handle_existing_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/helpers.sql", "original_file_path": "macros/materializations/models/view/helpers.sql", "name": "handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.3199072, "supported_languages": null}, "macro.dbt.default__handle_existing_table": {"unique_id": "macro.dbt.default__handle_existing_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/helpers.sql", "original_file_path": "macros/materializations/models/view/helpers.sql", "name": "default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.320638, "supported_languages": null}, "macro.dbt.create_or_replace_view": {"unique_id": "macro.dbt.create_or_replace_view", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/models/view/create_or_replace_view.sql", "name": "create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {% set should_revoke = should_revoke(exists_as_view, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=True) %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.3253481, "supported_languages": null}, "macro.dbt.get_create_view_as_sql": {"unique_id": "macro.dbt.get_create_view_as_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "get_create_view_as_sql", "macro_sql": "{% macro get_create_view_as_sql(relation, sql) -%}\n {{ adapter.dispatch('get_create_view_as_sql', 'dbt')(relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.326668, "supported_languages": null}, "macro.dbt.default__get_create_view_as_sql": {"unique_id": "macro.dbt.default__get_create_view_as_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "default__get_create_view_as_sql", "macro_sql": "{% macro default__get_create_view_as_sql(relation, sql) -%}\n {{ return(create_view_as(relation, sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.327213, "supported_languages": null}, "macro.dbt.create_view_as": {"unique_id": "macro.dbt.create_view_as", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.327821, "supported_languages": null}, "macro.dbt.default__create_view_as": {"unique_id": "macro.dbt.default__create_view_as", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation }} as (\n {{ sql }}\n );\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.3286731, "supported_languages": null}, "macro.dbt.materialization_seed_default": {"unique_id": "macro.dbt.materialization_seed_default", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/seed.sql", "original_file_path": "macros/materializations/seeds/seed.sql", "name": "materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set grant_config = config.get('grants') -%}\n {%- set agate_table = load_agate_table() -%}\n -- grab current tables grants config for comparision later on\n\n {%- do store_result('agate_table', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation)) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', code ~ ' ' ~ rows_affected, code, rows_affected) %}\n {{ get_csv_sql(create_table_sql, sql) }};\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if full_refresh_mode or not exists_as_table %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.run_hooks", "macro.dbt.reset_csv_table", "macro.dbt.create_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.noop_statement", "macro.dbt.get_csv_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.338463, "supported_languages": ["sql"]}, "macro.dbt.create_csv_table": {"unique_id": "macro.dbt.create_csv_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.350079, "supported_languages": null}, "macro.dbt.default__create_csv_table": {"unique_id": "macro.dbt.default__create_csv_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.352968, "supported_languages": null}, "macro.dbt.reset_csv_table": {"unique_id": "macro.dbt.reset_csv_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table', 'dbt')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.353729, "supported_languages": null}, "macro.dbt.default__reset_csv_table": {"unique_id": "macro.dbt.default__reset_csv_table", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.355298, "supported_languages": null}, "macro.dbt.get_csv_sql": {"unique_id": "macro.dbt.get_csv_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_csv_sql", "macro_sql": "{% macro get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ adapter.dispatch('get_csv_sql', 'dbt')(create_or_truncate_sql, insert_sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_csv_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.3559391, "supported_languages": null}, "macro.dbt.default__get_csv_sql": {"unique_id": "macro.dbt.default__get_csv_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_csv_sql", "macro_sql": "{% macro default__get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ create_or_truncate_sql }};\n -- dbt seed --\n {{ insert_sql }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.3563972, "supported_languages": null}, "macro.dbt.get_binding_char": {"unique_id": "macro.dbt.get_binding_char", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_binding_char", "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.356871, "supported_languages": null}, "macro.dbt.default__get_binding_char": {"unique_id": "macro.dbt.default__get_binding_char", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_binding_char", "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.35727, "supported_languages": null}, "macro.dbt.get_batch_size": {"unique_id": "macro.dbt.get_batch_size", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_batch_size", "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_batch_size"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.357803, "supported_languages": null}, "macro.dbt.default__get_batch_size": {"unique_id": "macro.dbt.default__get_batch_size", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_batch_size", "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.358203, "supported_languages": null}, "macro.dbt.get_seed_column_quoted_csv": {"unique_id": "macro.dbt.get_seed_column_quoted_csv", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.3597472, "supported_languages": null}, "macro.dbt.load_csv_rows": {"unique_id": "macro.dbt.load_csv_rows", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.36036, "supported_languages": null}, "macro.dbt.default__load_csv_rows": {"unique_id": "macro.dbt.default__load_csv_rows", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n\n {% set batch_size = get_batch_size() %}\n\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.36444, "supported_languages": null}, "macro.dbt.generate_alias_name": {"unique_id": "macro.dbt.generate_alias_name", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "name": "generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_alias_name', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_alias_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.365839, "supported_languages": null}, "macro.dbt.default__generate_alias_name": {"unique_id": "macro.dbt.default__generate_alias_name", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "name": "default__generate_alias_name", "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name is none -%}\n\n {{ node.name }}\n\n {%- else -%}\n\n {{ custom_alias_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.366606, "supported_languages": null}, "macro.dbt.generate_schema_name": {"unique_id": "macro.dbt.generate_schema_name", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name=none, node=none) -%}\n {{ return(adapter.dispatch('generate_schema_name', 'dbt')(custom_schema_name, node)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.368313, "supported_languages": null}, "macro.dbt.default__generate_schema_name": {"unique_id": "macro.dbt.default__generate_schema_name", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.3691862, "supported_languages": null}, "macro.dbt.generate_schema_name_for_env": {"unique_id": "macro.dbt.generate_schema_name_for_env", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.370128, "supported_languages": null}, "macro.dbt.generate_database_name": {"unique_id": "macro.dbt.generate_database_name", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "name": "generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name', 'dbt')(custom_database_name, node)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.371542, "supported_languages": null}, "macro.dbt.default__generate_database_name": {"unique_id": "macro.dbt.default__generate_database_name", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "name": "default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.372382, "supported_languages": null}, "macro.dbt.default__test_relationships": {"unique_id": "macro.dbt.default__test_relationships", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/relationships.sql", "original_file_path": "macros/generic_test_sql/relationships.sql", "name": "default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.373656, "supported_languages": null}, "macro.dbt.default__test_not_null": {"unique_id": "macro.dbt.default__test_not_null", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/not_null.sql", "original_file_path": "macros/generic_test_sql/not_null.sql", "name": "default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else column_name %}\n\nselect {{ column_list }}\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.3748622, "supported_languages": null}, "macro.dbt.default__test_unique": {"unique_id": "macro.dbt.default__test_unique", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/unique.sql", "original_file_path": "macros/generic_test_sql/unique.sql", "name": "default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.375886, "supported_languages": null}, "macro.dbt.default__test_accepted_values": {"unique_id": "macro.dbt.default__test_accepted_values", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/accepted_values.sql", "original_file_path": "macros/generic_test_sql/accepted_values.sql", "name": "default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by {{ column_name }}\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.377843, "supported_languages": null}, "macro.dbt.statement": {"unique_id": "macro.dbt.statement", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "statement", "macro_sql": "\n{%- macro statement(name=None, fetch_result=False, auto_begin=True, language='sql') -%}\n {%- if execute: -%}\n {%- set compiled_code = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime {} for node \"{}\"'.format(language, model['unique_id'])) }}\n {{ write(compiled_code) }}\n {%- endif -%}\n {%- if language == 'sql'-%}\n {%- set res, table = adapter.execute(compiled_code, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- elif language == 'python' -%}\n {%- set res = submit_python_job(model, compiled_code) -%}\n {#-- TODO: What should table be for python models? --#}\n {%- set table = None -%}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"statement macro didn't get supported language\") %}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.3824131, "supported_languages": null}, "macro.dbt.noop_statement": {"unique_id": "macro.dbt.noop_statement", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.384428, "supported_languages": null}, "macro.dbt.run_query": {"unique_id": "macro.dbt.run_query", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.385372, "supported_languages": null}, "macro.dbt.convert_datetime": {"unique_id": "macro.dbt.convert_datetime", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "convert_datetime", "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.390149, "supported_languages": null}, "macro.dbt.dates_in_range": {"unique_id": "macro.dbt.dates_in_range", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "dates_in_range", "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n Partiton start date is after the end date ({{ start_date }}, {{ end_date }})\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg, model) }}\n {% endif %}\n\n {% set date_list = [] %}\n {% for i in range(0, day_count + 1) %}\n {% set the_date = (modules.datetime.timedelta(days=i) + start_date) %}\n {% if not out_fmt %}\n {% set _ = date_list.append(the_date) %}\n {% else %}\n {% set _ = date_list.append(the_date.strftime(out_fmt)) %}\n {% endif %}\n {% endfor %}\n\n {{ return(date_list) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.3939168, "supported_languages": null}, "macro.dbt.partition_range": {"unique_id": "macro.dbt.partition_range", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "partition_range", "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.396317, "supported_languages": null}, "macro.dbt.py_current_timestring": {"unique_id": "macro.dbt.py_current_timestring", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "py_current_timestring", "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.397082, "supported_languages": null}, "macro.dbt.except": {"unique_id": "macro.dbt.except", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "name": "except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.39807, "supported_languages": null}, "macro.dbt.default__except": {"unique_id": "macro.dbt.default__except", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "name": "default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.398342, "supported_languages": null}, "macro.dbt.replace": {"unique_id": "macro.dbt.replace", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "name": "replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt') (field, old_chars, new_chars)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.399589, "supported_languages": null}, "macro.dbt.default__replace": {"unique_id": "macro.dbt.default__replace", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "name": "default__replace", "macro_sql": "{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.400138, "supported_languages": null}, "macro.dbt.concat": {"unique_id": "macro.dbt.concat", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "name": "concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt')(fields)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.401171, "supported_languages": null}, "macro.dbt.default__concat": {"unique_id": "macro.dbt.default__concat", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "name": "default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n {{ fields|join(' || ') }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.401603, "supported_languages": null}, "macro.dbt.length": {"unique_id": "macro.dbt.length", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "name": "length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__length"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.402658, "supported_languages": null}, "macro.dbt.default__length": {"unique_id": "macro.dbt.default__length", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "name": "default__length", "macro_sql": "{% macro default__length(expression) %}\n\n length(\n {{ expression }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.403025, "supported_languages": null}, "macro.dbt.dateadd": {"unique_id": "macro.dbt.dateadd", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "name": "dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.404323, "supported_languages": null}, "macro.dbt.default__dateadd": {"unique_id": "macro.dbt.default__dateadd", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "name": "default__dateadd", "macro_sql": "{% macro default__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_date_or_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.404876, "supported_languages": null}, "macro.dbt.intersect": {"unique_id": "macro.dbt.intersect", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "name": "intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__intersect"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.405857, "supported_languages": null}, "macro.dbt.default__intersect": {"unique_id": "macro.dbt.default__intersect", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "name": "default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4061272, "supported_languages": null}, "macro.dbt.escape_single_quotes": {"unique_id": "macro.dbt.escape_single_quotes", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "name": "escape_single_quotes", "macro_sql": "{% macro escape_single_quotes(expression) %}\n {{ return(adapter.dispatch('escape_single_quotes', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__escape_single_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.407231, "supported_languages": null}, "macro.dbt.default__escape_single_quotes": {"unique_id": "macro.dbt.default__escape_single_quotes", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "name": "default__escape_single_quotes", "macro_sql": "{% macro default__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\",\"''\") }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.407718, "supported_languages": null}, "macro.dbt.right": {"unique_id": "macro.dbt.right", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "name": "right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt') (string_text, length_expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__right"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.408916, "supported_languages": null}, "macro.dbt.default__right": {"unique_id": "macro.dbt.default__right", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "name": "default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.409546, "supported_languages": null}, "macro.dbt.listagg": {"unique_id": "macro.dbt.listagg", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "name": "listagg", "macro_sql": "{% macro listagg(measure, delimiter_text=\"','\", order_by_clause=none, limit_num=none) -%}\n {{ return(adapter.dispatch('listagg', 'dbt') (measure, delimiter_text, order_by_clause, limit_num)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__listagg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.41152, "supported_languages": null}, "macro.dbt.default__listagg": {"unique_id": "macro.dbt.default__listagg", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "name": "default__listagg", "macro_sql": "{% macro default__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n array_slice(\n array_agg(\n {{ measure }}\n ){% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n ,0\n ,{{ limit_num }}\n ),\n {{ delimiter_text }}\n )\n {%- else %}\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4128299, "supported_languages": null}, "macro.dbt.datediff": {"unique_id": "macro.dbt.datediff", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "name": "datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt')(first_date, second_date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.414102, "supported_languages": null}, "macro.dbt.default__datediff": {"unique_id": "macro.dbt.default__datediff", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "name": "default__datediff", "macro_sql": "{% macro default__datediff(first_date, second_date, datepart) -%}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.414657, "supported_languages": null}, "macro.dbt.safe_cast": {"unique_id": "macro.dbt.safe_cast", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "name": "safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt') (field, type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4158049, "supported_languages": null}, "macro.dbt.default__safe_cast": {"unique_id": "macro.dbt.default__safe_cast", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "name": "default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4162781, "supported_languages": null}, "macro.dbt.hash": {"unique_id": "macro.dbt.hash", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "name": "hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt') (field)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.417341, "supported_languages": null}, "macro.dbt.default__hash": {"unique_id": "macro.dbt.default__hash", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "name": "default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{ field }} as {{ api.Column.translate_type('string') }}))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4178839, "supported_languages": null}, "macro.dbt.cast_bool_to_text": {"unique_id": "macro.dbt.cast_bool_to_text", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "name": "cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', 'dbt') (field) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.418924, "supported_languages": null}, "macro.dbt.default__cast_bool_to_text": {"unique_id": "macro.dbt.default__cast_bool_to_text", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "name": "default__cast_bool_to_text", "macro_sql": "{% macro default__cast_bool_to_text(field) %}\n cast({{ field }} as {{ api.Column.translate_type('string') }})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.419467, "supported_languages": null}, "macro.dbt.any_value": {"unique_id": "macro.dbt.any_value", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "name": "any_value", "macro_sql": "{% macro any_value(expression) -%}\n {{ return(adapter.dispatch('any_value', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__any_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.420506, "supported_languages": null}, "macro.dbt.default__any_value": {"unique_id": "macro.dbt.default__any_value", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "name": "default__any_value", "macro_sql": "{% macro default__any_value(expression) -%}\n\n any_value({{ expression }})\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4208698, "supported_languages": null}, "macro.dbt.position": {"unique_id": "macro.dbt.position", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "name": "position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt') (substring_text, string_text)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__position"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4220212, "supported_languages": null}, "macro.dbt.default__position": {"unique_id": "macro.dbt.default__position", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "name": "default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4225101, "supported_languages": null}, "macro.dbt.string_literal": {"unique_id": "macro.dbt.string_literal", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "name": "string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt') (value)) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4235451, "supported_languages": null}, "macro.dbt.default__string_literal": {"unique_id": "macro.dbt.default__string_literal", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "name": "default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.423916, "supported_languages": null}, "macro.dbt.type_string": {"unique_id": "macro.dbt.type_string", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.426599, "supported_languages": null}, "macro.dbt.default__type_string": {"unique_id": "macro.dbt.default__type_string", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_string", "macro_sql": "{% macro default__type_string() %}\n {{ return(api.Column.translate_type(\"string\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.427125, "supported_languages": null}, "macro.dbt.type_timestamp": {"unique_id": "macro.dbt.type_timestamp", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.427826, "supported_languages": null}, "macro.dbt.default__type_timestamp": {"unique_id": "macro.dbt.default__type_timestamp", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n {{ return(api.Column.translate_type(\"timestamp\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.428344, "supported_languages": null}, "macro.dbt.type_float": {"unique_id": "macro.dbt.type_float", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.428886, "supported_languages": null}, "macro.dbt.default__type_float": {"unique_id": "macro.dbt.default__type_float", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_float", "macro_sql": "{% macro default__type_float() %}\n {{ return(api.Column.translate_type(\"float\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.429397, "supported_languages": null}, "macro.dbt.type_numeric": {"unique_id": "macro.dbt.type_numeric", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4299378, "supported_languages": null}, "macro.dbt.default__type_numeric": {"unique_id": "macro.dbt.default__type_numeric", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n {{ return(api.Column.numeric_type(\"numeric\", 28, 6)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.430528, "supported_languages": null}, "macro.dbt.type_bigint": {"unique_id": "macro.dbt.type_bigint", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.431073, "supported_languages": null}, "macro.dbt.default__type_bigint": {"unique_id": "macro.dbt.default__type_bigint", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n {{ return(api.Column.translate_type(\"bigint\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4315891, "supported_languages": null}, "macro.dbt.type_int": {"unique_id": "macro.dbt.type_int", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.432129, "supported_languages": null}, "macro.dbt.default__type_int": {"unique_id": "macro.dbt.default__type_int", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_int", "macro_sql": "{%- macro default__type_int() -%}\n {{ return(api.Column.translate_type(\"integer\")) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4326138, "supported_languages": null}, "macro.dbt.type_boolean": {"unique_id": "macro.dbt.type_boolean", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_boolean", "macro_sql": "\n\n{%- macro type_boolean() -%}\n {{ return(adapter.dispatch('type_boolean', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_boolean"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.433146, "supported_languages": null}, "macro.dbt.default__type_boolean": {"unique_id": "macro.dbt.default__type_boolean", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_boolean", "macro_sql": "{%- macro default__type_boolean() -%}\n {{ return(api.Column.translate_type(\"boolean\")) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.433642, "supported_languages": null}, "macro.dbt.array_concat": {"unique_id": "macro.dbt.array_concat", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "name": "array_concat", "macro_sql": "{% macro array_concat(array_1, array_2) -%}\n {{ return(adapter.dispatch('array_concat', 'dbt')(array_1, array_2)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__array_concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4347572, "supported_languages": null}, "macro.dbt.default__array_concat": {"unique_id": "macro.dbt.default__array_concat", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "name": "default__array_concat", "macro_sql": "{% macro default__array_concat(array_1, array_2) -%}\n array_cat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.435209, "supported_languages": null}, "macro.dbt.bool_or": {"unique_id": "macro.dbt.bool_or", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "name": "bool_or", "macro_sql": "{% macro bool_or(expression) -%}\n {{ return(adapter.dispatch('bool_or', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__bool_or"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.436243, "supported_languages": null}, "macro.dbt.default__bool_or": {"unique_id": "macro.dbt.default__bool_or", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "name": "default__bool_or", "macro_sql": "{% macro default__bool_or(expression) -%}\n\n bool_or({{ expression }})\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.436714, "supported_languages": null}, "macro.dbt.last_day": {"unique_id": "macro.dbt.last_day", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "name": "last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt') (date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4380338, "supported_languages": null}, "macro.dbt.default_last_day": {"unique_id": "macro.dbt.default_last_day", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "name": "default_last_day", "macro_sql": "\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd(datepart, '1', dbt.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.43891, "supported_languages": null}, "macro.dbt.default__last_day": {"unique_id": "macro.dbt.default__last_day", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "name": "default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt.default_last_day(date, datepart)}}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.439405, "supported_languages": null}, "macro.dbt.split_part": {"unique_id": "macro.dbt.split_part", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "name": "split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ return(adapter.dispatch('split_part', 'dbt') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.441097, "supported_languages": null}, "macro.dbt.default__split_part": {"unique_id": "macro.dbt.default__split_part", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "name": "default__split_part", "macro_sql": "{% macro default__split_part(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n {{ part_number }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.441665, "supported_languages": null}, "macro.dbt._split_part_negative": {"unique_id": "macro.dbt._split_part_negative", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "name": "_split_part_negative", "macro_sql": "{% macro _split_part_negative(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n length({{ string_text }})\n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 2 {{ part_number }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4425879, "supported_languages": null}, "macro.dbt.date_trunc": {"unique_id": "macro.dbt.date_trunc", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "name": "date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt') (datepart, date)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4437099, "supported_languages": null}, "macro.dbt.default__date_trunc": {"unique_id": "macro.dbt.default__date_trunc", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "name": "default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) -%}\n date_trunc('{{datepart}}', {{date}})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4441578, "supported_languages": null}, "macro.dbt.array_construct": {"unique_id": "macro.dbt.array_construct", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "name": "array_construct", "macro_sql": "{% macro array_construct(inputs=[], data_type=api.Column.translate_type('integer')) -%}\n {{ return(adapter.dispatch('array_construct', 'dbt')(inputs, data_type)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__array_construct"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.445559, "supported_languages": null}, "macro.dbt.default__array_construct": {"unique_id": "macro.dbt.default__array_construct", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "name": "default__array_construct", "macro_sql": "{% macro default__array_construct(inputs, data_type) -%}\n {% if inputs|length > 0 %}\n array[ {{ inputs|join(' , ') }} ]\n {% else %}\n array[]::{{data_type}}[]\n {% endif %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.44636, "supported_languages": null}, "macro.dbt.array_append": {"unique_id": "macro.dbt.array_append", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "name": "array_append", "macro_sql": "{% macro array_append(array, new_element) -%}\n {{ return(adapter.dispatch('array_append', 'dbt')(array, new_element)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__array_append"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.447506, "supported_languages": null}, "macro.dbt.default__array_append": {"unique_id": "macro.dbt.default__array_append", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "name": "default__array_append", "macro_sql": "{% macro default__array_append(array, new_element) -%}\n array_append({{ array }}, {{ new_element }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.447964, "supported_languages": null}, "macro.dbt.create_schema": {"unique_id": "macro.dbt.create_schema", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema', 'dbt')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.44931, "supported_languages": null}, "macro.dbt.default__create_schema": {"unique_id": "macro.dbt.default__create_schema", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4499478, "supported_languages": null}, "macro.dbt.drop_schema": {"unique_id": "macro.dbt.drop_schema", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.45051, "supported_languages": null}, "macro.dbt.default__drop_schema": {"unique_id": "macro.dbt.default__drop_schema", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.451156, "supported_languages": null}, "macro.dbt.current_timestamp": {"unique_id": "macro.dbt.current_timestamp", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "current_timestamp", "macro_sql": "{%- macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.452808, "supported_languages": null}, "macro.dbt.default__current_timestamp": {"unique_id": "macro.dbt.default__current_timestamp", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter ' + adapter.type()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.453341, "supported_languages": null}, "macro.dbt.snapshot_get_time": {"unique_id": "macro.dbt.snapshot_get_time", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "snapshot_get_time", "macro_sql": "\n\n{%- macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.453865, "supported_languages": null}, "macro.dbt.default__snapshot_get_time": {"unique_id": "macro.dbt.default__snapshot_get_time", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() %}\n {{ current_timestamp() }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.454248, "supported_languages": null}, "macro.dbt.current_timestamp_backcompat": {"unique_id": "macro.dbt.current_timestamp_backcompat", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "current_timestamp_backcompat", "macro_sql": "{% macro current_timestamp_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.454805, "supported_languages": null}, "macro.dbt.default__current_timestamp_backcompat": {"unique_id": "macro.dbt.default__current_timestamp_backcompat", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "default__current_timestamp_backcompat", "macro_sql": "{% macro default__current_timestamp_backcompat() %}\n current_timestamp::timestamp\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.455076, "supported_languages": null}, "macro.dbt.current_timestamp_in_utc_backcompat": {"unique_id": "macro.dbt.current_timestamp_in_utc_backcompat", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "current_timestamp_in_utc_backcompat", "macro_sql": "{% macro current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_in_utc_backcompat', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__current_timestamp_in_utc_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.455637, "supported_languages": null}, "macro.dbt.default__current_timestamp_in_utc_backcompat": {"unique_id": "macro.dbt.default__current_timestamp_in_utc_backcompat", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "default__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro default__current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt_bigquery.bigquery__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.456204, "supported_languages": null}, "macro.dbt.get_create_index_sql": {"unique_id": "macro.dbt.get_create_index_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.457786, "supported_languages": null}, "macro.dbt.default__get_create_index_sql": {"unique_id": "macro.dbt.default__get_create_index_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.458435, "supported_languages": null}, "macro.dbt.create_indexes": {"unique_id": "macro.dbt.create_indexes", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes', 'dbt')(relation) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.458969, "supported_languages": null}, "macro.dbt.default__create_indexes": {"unique_id": "macro.dbt.default__create_indexes", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.460272, "supported_languages": null}, "macro.dbt.make_intermediate_relation": {"unique_id": "macro.dbt.make_intermediate_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "make_intermediate_relation", "macro_sql": "{% macro make_intermediate_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_intermediate_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_intermediate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.468462, "supported_languages": null}, "macro.dbt.default__make_intermediate_relation": {"unique_id": "macro.dbt.default__make_intermediate_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__make_intermediate_relation", "macro_sql": "{% macro default__make_intermediate_relation(base_relation, suffix) %}\n {{ return(default__make_temp_relation(base_relation, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4690292, "supported_languages": null}, "macro.dbt.make_temp_relation": {"unique_id": "macro.dbt.make_temp_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4697611, "supported_languages": null}, "macro.dbt.default__make_temp_relation": {"unique_id": "macro.dbt.default__make_temp_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {%- set temp_identifier = base_relation.identifier ~ suffix -%}\n {%- set temp_relation = base_relation.incorporate(\n path={\"identifier\": temp_identifier}) -%}\n\n {{ return(temp_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.470711, "supported_languages": null}, "macro.dbt.make_backup_relation": {"unique_id": "macro.dbt.make_backup_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "make_backup_relation", "macro_sql": "{% macro make_backup_relation(base_relation, backup_relation_type, suffix='__dbt_backup') %}\n {{ return(adapter.dispatch('make_backup_relation', 'dbt')(base_relation, backup_relation_type, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_backup_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4715269, "supported_languages": null}, "macro.dbt.default__make_backup_relation": {"unique_id": "macro.dbt.default__make_backup_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__make_backup_relation", "macro_sql": "{% macro default__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {%- set backup_identifier = base_relation.identifier ~ suffix -%}\n {%- set backup_relation = base_relation.incorporate(\n path={\"identifier\": backup_identifier},\n type=backup_relation_type\n ) -%}\n {{ return(backup_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.472574, "supported_languages": null}, "macro.dbt.drop_relation": {"unique_id": "macro.dbt.drop_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.473184, "supported_languages": null}, "macro.dbt.default__drop_relation": {"unique_id": "macro.dbt.default__drop_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__drop_relation", "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.473896, "supported_languages": null}, "macro.dbt.truncate_relation": {"unique_id": "macro.dbt.truncate_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.474498, "supported_languages": null}, "macro.dbt.default__truncate_relation": {"unique_id": "macro.dbt.default__truncate_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.475052, "supported_languages": null}, "macro.dbt.rename_relation": {"unique_id": "macro.dbt.rename_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.475714, "supported_languages": null}, "macro.dbt.default__rename_relation": {"unique_id": "macro.dbt.default__rename_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.476663, "supported_languages": null}, "macro.dbt.get_or_create_relation": {"unique_id": "macro.dbt.get_or_create_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) -%}\n {{ return(adapter.dispatch('get_or_create_relation', 'dbt')(database, schema, identifier, type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_or_create_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.477479, "supported_languages": null}, "macro.dbt.default__get_or_create_relation": {"unique_id": "macro.dbt.default__get_or_create_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__get_or_create_relation", "macro_sql": "{% macro default__get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.479247, "supported_languages": null}, "macro.dbt.load_cached_relation": {"unique_id": "macro.dbt.load_cached_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "load_cached_relation", "macro_sql": "{% macro load_cached_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.48015, "supported_languages": null}, "macro.dbt.load_relation": {"unique_id": "macro.dbt.load_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {{ return(load_cached_relation(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.480633, "supported_languages": null}, "macro.dbt.drop_relation_if_exists": {"unique_id": "macro.dbt.drop_relation_if_exists", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.481281, "supported_languages": null}, "macro.dbt.collect_freshness": {"unique_id": "macro.dbt.collect_freshness", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness', 'dbt')(source, loaded_at_field, filter))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.48277, "supported_languages": null}, "macro.dbt.default__collect_freshness": {"unique_id": "macro.dbt.default__collect_freshness", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.484145, "supported_languages": null}, "macro.dbt.copy_grants": {"unique_id": "macro.dbt.copy_grants", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "copy_grants", "macro_sql": "{% macro copy_grants() %}\n {{ return(adapter.dispatch('copy_grants', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.488588, "supported_languages": null}, "macro.dbt.default__copy_grants": {"unique_id": "macro.dbt.default__copy_grants", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__copy_grants", "macro_sql": "{% macro default__copy_grants() %}\n {{ return(True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4889941, "supported_languages": null}, "macro.dbt.support_multiple_grantees_per_dcl_statement": {"unique_id": "macro.dbt.support_multiple_grantees_per_dcl_statement", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "support_multiple_grantees_per_dcl_statement", "macro_sql": "{% macro support_multiple_grantees_per_dcl_statement() %}\n {{ return(adapter.dispatch('support_multiple_grantees_per_dcl_statement', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.489558, "supported_languages": null}, "macro.dbt.default__support_multiple_grantees_per_dcl_statement": {"unique_id": "macro.dbt.default__support_multiple_grantees_per_dcl_statement", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__support_multiple_grantees_per_dcl_statement", "macro_sql": "\n\n{%- macro default__support_multiple_grantees_per_dcl_statement() -%}\n {{ return(True) }}\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4899468, "supported_languages": null}, "macro.dbt.should_revoke": {"unique_id": "macro.dbt.should_revoke", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "should_revoke", "macro_sql": "{% macro should_revoke(existing_relation, full_refresh_mode=True) %}\n\n {% if not existing_relation %}\n {#-- The table doesn't already exist, so no grants to copy over --#}\n {{ return(False) }}\n {% elif full_refresh_mode %}\n {#-- The object is being REPLACED -- whether grants are copied over depends on the value of user config --#}\n {{ return(copy_grants()) }}\n {% else %}\n {#-- The table is being merged/upserted/inserted -- grants will be carried over --#}\n {{ return(True) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.491083, "supported_languages": null}, "macro.dbt.get_show_grant_sql": {"unique_id": "macro.dbt.get_show_grant_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_show_grant_sql", "macro_sql": "{% macro get_show_grant_sql(relation) %}\n {{ return(adapter.dispatch(\"get_show_grant_sql\", \"dbt\")(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_show_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.491717, "supported_languages": null}, "macro.dbt.default__get_show_grant_sql": {"unique_id": "macro.dbt.default__get_show_grant_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_show_grant_sql", "macro_sql": "{% macro default__get_show_grant_sql(relation) %}\n show grants on {{ relation }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4920819, "supported_languages": null}, "macro.dbt.get_grant_sql": {"unique_id": "macro.dbt.get_grant_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_grant_sql", "macro_sql": "{% macro get_grant_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_grant_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.492824, "supported_languages": null}, "macro.dbt.default__get_grant_sql": {"unique_id": "macro.dbt.default__get_grant_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_grant_sql", "macro_sql": "\n\n{%- macro default__get_grant_sql(relation, privilege, grantees) -%}\n grant {{ privilege }} on {{ relation }} to {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.493456, "supported_languages": null}, "macro.dbt.get_revoke_sql": {"unique_id": "macro.dbt.get_revoke_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_revoke_sql", "macro_sql": "{% macro get_revoke_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_revoke_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_revoke_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.494207, "supported_languages": null}, "macro.dbt.default__get_revoke_sql": {"unique_id": "macro.dbt.default__get_revoke_sql", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_revoke_sql", "macro_sql": "\n\n{%- macro default__get_revoke_sql(relation, privilege, grantees) -%}\n revoke {{ privilege }} on {{ relation }} from {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.49486, "supported_languages": null}, "macro.dbt.get_dcl_statement_list": {"unique_id": "macro.dbt.get_dcl_statement_list", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_dcl_statement_list", "macro_sql": "{% macro get_dcl_statement_list(relation, grant_config, get_dcl_macro) %}\n {{ return(adapter.dispatch('get_dcl_statement_list', 'dbt')(relation, grant_config, get_dcl_macro)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_dcl_statement_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.4956229, "supported_languages": null}, "macro.dbt.default__get_dcl_statement_list": {"unique_id": "macro.dbt.default__get_dcl_statement_list", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_dcl_statement_list", "macro_sql": "\n\n{%- macro default__get_dcl_statement_list(relation, grant_config, get_dcl_macro) -%}\n {#\n -- Unpack grant_config into specific privileges and the set of users who need them granted/revoked.\n -- Depending on whether this database supports multiple grantees per statement, pass in the list of\n -- all grantees per privilege, or (if not) template one statement per privilege-grantee pair.\n -- `get_dcl_macro` will be either `get_grant_sql` or `get_revoke_sql`\n #}\n {%- set dcl_statements = [] -%}\n {%- for privilege, grantees in grant_config.items() %}\n {%- if support_multiple_grantees_per_dcl_statement() and grantees -%}\n {%- set dcl = get_dcl_macro(relation, privilege, grantees) -%}\n {%- do dcl_statements.append(dcl) -%}\n {%- else -%}\n {%- for grantee in grantees -%}\n {% set dcl = get_dcl_macro(relation, privilege, [grantee]) %}\n {%- do dcl_statements.append(dcl) -%}\n {% endfor -%}\n {%- endif -%}\n {%- endfor -%}\n {{ return(dcl_statements) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.497808, "supported_languages": null}, "macro.dbt.call_dcl_statements": {"unique_id": "macro.dbt.call_dcl_statements", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "call_dcl_statements", "macro_sql": "{% macro call_dcl_statements(dcl_statement_list) %}\n {{ return(adapter.dispatch(\"call_dcl_statements\", \"dbt\")(dcl_statement_list)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.498594, "supported_languages": null}, "macro.dbt.default__call_dcl_statements": {"unique_id": "macro.dbt.default__call_dcl_statements", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__call_dcl_statements", "macro_sql": "{% macro default__call_dcl_statements(dcl_statement_list) %}\n {#\n -- By default, supply all grant + revoke statements in a single semicolon-separated block,\n -- so that they're all processed together.\n\n -- Some databases do not support this. Those adapters will need to override this macro\n -- to run each statement individually.\n #}\n {% call statement('grants') %}\n {% for dcl_statement in dcl_statement_list %}\n {{ dcl_statement }};\n {% endfor %}\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.499413, "supported_languages": null}, "macro.dbt.apply_grants": {"unique_id": "macro.dbt.apply_grants", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "apply_grants", "macro_sql": "{% macro apply_grants(relation, grant_config, should_revoke) %}\n {{ return(adapter.dispatch(\"apply_grants\", \"dbt\")(relation, grant_config, should_revoke)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5001578, "supported_languages": null}, "macro.dbt.default__apply_grants": {"unique_id": "macro.dbt.default__apply_grants", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__apply_grants", "macro_sql": "{% macro default__apply_grants(relation, grant_config, should_revoke=True) %}\n {#-- If grant_config is {} or None, this is a no-op --#}\n {% if grant_config %}\n {% if should_revoke %}\n {#-- We think previous grants may have carried over --#}\n {#-- Show current grants and calculate diffs --#}\n {% set current_grants_table = run_query(get_show_grant_sql(relation)) %}\n {% set current_grants_dict = adapter.standardize_grants_dict(current_grants_table) %}\n {% set needs_granting = diff_of_two_dicts(grant_config, current_grants_dict) %}\n {% set needs_revoking = diff_of_two_dicts(current_grants_dict, grant_config) %}\n {% if not (needs_granting or needs_revoking) %}\n {{ log('On ' ~ relation ~': All grants are in place, no revocation or granting needed.')}}\n {% endif %}\n {% else %}\n {#-- We don't think there's any chance of previous grants having carried over. --#}\n {#-- Jump straight to granting what the user has configured. --#}\n {% set needs_revoking = {} %}\n {% set needs_granting = grant_config %}\n {% endif %}\n {% if needs_granting or needs_revoking %}\n {% set revoke_statement_list = get_dcl_statement_list(relation, needs_revoking, get_revoke_sql) %}\n {% set grant_statement_list = get_dcl_statement_list(relation, needs_granting, get_grant_sql) %}\n {% set dcl_statement_list = revoke_statement_list + grant_statement_list %}\n {% if dcl_statement_list %}\n {{ call_dcl_statements(dcl_statement_list) }}\n {% endif %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_grant_sql", "macro.dbt.get_dcl_statement_list", "macro.dbt.call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.503792, "supported_languages": null}, "macro.dbt.alter_column_comment": {"unique_id": "macro.dbt.alter_column_comment", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment', 'dbt')(relation, column_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.505903, "supported_languages": null}, "macro.dbt.default__alter_column_comment": {"unique_id": "macro.dbt.default__alter_column_comment", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.506481, "supported_languages": null}, "macro.dbt.alter_relation_comment": {"unique_id": "macro.dbt.alter_relation_comment", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment', 'dbt')(relation, relation_comment)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.507159, "supported_languages": null}, "macro.dbt.default__alter_relation_comment": {"unique_id": "macro.dbt.default__alter_relation_comment", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.507722, "supported_languages": null}, "macro.dbt.persist_docs": {"unique_id": "macro.dbt.persist_docs", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs', 'dbt')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5085928, "supported_languages": null}, "macro.dbt.default__persist_docs": {"unique_id": "macro.dbt.default__persist_docs", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do run_query(alter_column_comment(relation, model.columns)) %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5101418, "supported_languages": null}, "macro.dbt.get_catalog": {"unique_id": "macro.dbt.get_catalog", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.514124, "supported_languages": null}, "macro.dbt.default__get_catalog": {"unique_id": "macro.dbt.default__get_catalog", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.514983, "supported_languages": null}, "macro.dbt.information_schema_name": {"unique_id": "macro.dbt.information_schema_name", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.515614, "supported_languages": null}, "macro.dbt.default__information_schema_name": {"unique_id": "macro.dbt.default__information_schema_name", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5161521, "supported_languages": null}, "macro.dbt.list_schemas": {"unique_id": "macro.dbt.list_schemas", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5167649, "supported_languages": null}, "macro.dbt.default__list_schemas": {"unique_id": "macro.dbt.default__list_schemas", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5175989, "supported_languages": null}, "macro.dbt.check_schema_exists": {"unique_id": "macro.dbt.check_schema_exists", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists', 'dbt')(information_schema, schema)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.518281, "supported_languages": null}, "macro.dbt.default__check_schema_exists": {"unique_id": "macro.dbt.default__check_schema_exists", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.519275, "supported_languages": null}, "macro.dbt.list_relations_without_caching": {"unique_id": "macro.dbt.list_relations_without_caching", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.519912, "supported_languages": null}, "macro.dbt.default__list_relations_without_caching": {"unique_id": "macro.dbt.default__list_relations_without_caching", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.520465, "supported_languages": null}, "macro.dbt.get_columns_in_relation": {"unique_id": "macro.dbt.get_columns_in_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.524847, "supported_languages": null}, "macro.dbt.default__get_columns_in_relation": {"unique_id": "macro.dbt.default__get_columns_in_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5258749, "supported_languages": null}, "macro.dbt.sql_convert_columns_in_relation": {"unique_id": "macro.dbt.sql_convert_columns_in_relation", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5269172, "supported_languages": null}, "macro.dbt.get_columns_in_query": {"unique_id": "macro.dbt.get_columns_in_query", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5275252, "supported_languages": null}, "macro.dbt.default__get_columns_in_query": {"unique_id": "macro.dbt.default__get_columns_in_query", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.52863, "supported_languages": null}, "macro.dbt.alter_column_type": {"unique_id": "macro.dbt.alter_column_type", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type', 'dbt')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.529376, "supported_languages": null}, "macro.dbt.default__alter_column_type": {"unique_id": "macro.dbt.default__alter_column_type", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.531296, "supported_languages": null}, "macro.dbt.alter_relation_add_remove_columns": {"unique_id": "macro.dbt.alter_relation_add_remove_columns", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "alter_relation_add_remove_columns", "macro_sql": "{% macro alter_relation_add_remove_columns(relation, add_columns = none, remove_columns = none) -%}\n {{ return(adapter.dispatch('alter_relation_add_remove_columns', 'dbt')(relation, add_columns, remove_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__alter_relation_add_remove_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5321321, "supported_languages": null}, "macro.dbt.default__alter_relation_add_remove_columns": {"unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__alter_relation_add_remove_columns", "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation }}\n\n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n\n {% for column in remove_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.534654, "supported_languages": null}, "macro.dbt.build_ref_function": {"unique_id": "macro.dbt.build_ref_function", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "build_ref_function", "macro_sql": "{% macro build_ref_function(model) %}\n\n {%- set ref_dict = {} -%}\n {%- for _ref in model.refs -%}\n {%- set resolved = ref(*_ref) -%}\n {%- do ref_dict.update({_ref | join(\".\"): resolved.quote(database=False, schema=False, identifier=False) | string}) -%}\n {%- endfor -%}\n\ndef ref(*args,dbt_load_df_function):\n refs = {{ ref_dict | tojson }}\n key = \".\".join(args)\n return dbt_load_df_function(refs[key])\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.53872, "supported_languages": null}, "macro.dbt.build_source_function": {"unique_id": "macro.dbt.build_source_function", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "build_source_function", "macro_sql": "{% macro build_source_function(model) %}\n\n {%- set source_dict = {} -%}\n {%- for _source in model.sources -%}\n {%- set resolved = source(*_source) -%}\n {%- do source_dict.update({_source | join(\".\"): resolved.quote(database=False, schema=False, identifier=False) | string}) -%}\n {%- endfor -%}\n\ndef source(*args, dbt_load_df_function):\n sources = {{ source_dict | tojson }}\n key = \".\".join(args)\n return dbt_load_df_function(sources[key])\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.540236, "supported_languages": null}, "macro.dbt.build_config_dict": {"unique_id": "macro.dbt.build_config_dict", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "build_config_dict", "macro_sql": "{% macro build_config_dict(model) %}\n {%- set config_dict = {} -%}\n {%- for key in model.config.config_keys_used -%}\n {# weird type testing with enum, would be much easier to write this logic in Python! #}\n {%- if key == 'language' -%}\n {%- set value = 'python' -%}\n {%- endif -%}\n {%- set value = model.config[key] -%}\n {%- do config_dict.update({key: value}) -%}\n {%- endfor -%}\nconfig_dict = {{ config_dict }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.541721, "supported_languages": null}, "macro.dbt.py_script_postfix": {"unique_id": "macro.dbt.py_script_postfix", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "py_script_postfix", "macro_sql": "{% macro py_script_postfix(model) %}\n# This part is user provided model code\n# you will need to copy the next section to run the code\n# COMMAND ----------\n# this part is dbt logic for get ref work, do not modify\n\n{{ build_ref_function(model ) }}\n{{ build_source_function(model ) }}\n{{ build_config_dict(model) }}\n\nclass config:\n def __init__(self, *args, **kwargs):\n pass\n\n @staticmethod\n def get(key, default=None):\n return config_dict.get(key, default)\n\nclass this:\n \"\"\"dbt.this() or dbt.this.identifier\"\"\"\n database = '{{ this.database }}'\n schema = '{{ this.schema }}'\n identifier = '{{ this.identifier }}'\n def __repr__(self):\n return '{{ this }}'\n\n\nclass dbtObj:\n def __init__(self, load_df_function) -> None:\n self.source = lambda *args: source(*args, dbt_load_df_function=load_df_function)\n self.ref = lambda *args: ref(*args, dbt_load_df_function=load_df_function)\n self.config = config\n self.this = this()\n self.is_incremental = {{ is_incremental() }}\n\n# COMMAND ----------\n{{py_script_comment()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.build_ref_function", "macro.dbt.build_source_function", "macro.dbt.build_config_dict", "macro.dbt.is_incremental", "macro.dbt.py_script_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5430348, "supported_languages": null}, "macro.dbt.py_script_comment": {"unique_id": "macro.dbt.py_script_comment", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "py_script_comment", "macro_sql": "{%macro py_script_comment()%}\n{%endmacro%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5433002, "supported_languages": null}, "macro.dbt.test_unique": {"unique_id": "macro.dbt.test_unique", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_bigquery.bigquery__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5450509, "supported_languages": null}, "macro.dbt.test_not_null": {"unique_id": "macro.dbt.test_not_null", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.54582, "supported_languages": null}, "macro.dbt.test_accepted_values": {"unique_id": "macro.dbt.test_accepted_values", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values', 'dbt') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.546762, "supported_languages": null}, "macro.dbt.test_relationships": {"unique_id": "macro.dbt.test_relationships", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships', 'dbt') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5476758, "supported_languages": null}, "macro.dbt_utils.xdb_deprecation_warning_without_replacement": {"unique_id": "macro.dbt_utils.xdb_deprecation_warning_without_replacement", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/cross_db_utils/deprecated/xdb_deprecation_warning.sql", "original_file_path": "macros/cross_db_utils/deprecated/xdb_deprecation_warning.sql", "name": "xdb_deprecation_warning_without_replacement", "macro_sql": "{% macro xdb_deprecation_warning_without_replacement(macro, package, model) %}\n {%- set error_message = \"Warning: the `\" ~ macro ~\"` macro is deprecated and will be removed in a future version of the package, once equivalent functionality is implemented in dbt Core. The \" ~ package ~ \".\" ~ model ~ \" model triggered this warning.\" -%}\n {%- do exceptions.warn(error_message) -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.548939, "supported_languages": null}, "macro.dbt_utils.get_url_host": {"unique_id": "macro.dbt_utils.get_url_host", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "name": "get_url_host", "macro_sql": "{% macro get_url_host(field) -%}\n {{ return(adapter.dispatch('get_url_host', 'dbt_utils')(field)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_host"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.55021, "supported_languages": null}, "macro.dbt_utils.default__get_url_host": {"unique_id": "macro.dbt_utils.default__get_url_host", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "name": "default__get_url_host", "macro_sql": "{% macro default__get_url_host(field) -%}\n\n{%- set parsed =\n split_part(\n split_part(\n replace(\n replace(\n replace(field, \"'android-app://'\", \"''\"\n ), \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n\n-%}\n\n\n {{ dbt.safe_cast(\n parsed,\n type_string()\n )}}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.split_part", "macro.dbt.replace", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.551788, "supported_languages": null}, "macro.dbt_utils.get_url_path": {"unique_id": "macro.dbt_utils.get_url_path", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "name": "get_url_path", "macro_sql": "{% macro get_url_path(field) -%}\n {{ return(adapter.dispatch('get_url_path', 'dbt_utils')(field)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_path"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.55335, "supported_languages": null}, "macro.dbt_utils.default__get_url_path": {"unique_id": "macro.dbt_utils.default__get_url_path", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "name": "default__get_url_path", "macro_sql": "{% macro default__get_url_path(field) -%}\n\n {%- set stripped_url =\n replace(\n replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{ position(\"'/'\", stripped_url) }}, 0),\n {{ position(\"'?'\", stripped_url) }} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n split_part(\n right(\n stripped_url,\n length(stripped_url) ~ \"-\" ~ first_slash_pos\n ),\n \"'?'\", 1\n )\n -%}\n\n {{ safe_cast(\n parsed_path,\n type_string()\n )}}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.position", "macro.dbt.split_part", "macro.dbt.right", "macro.dbt.length", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.555247, "supported_languages": null}, "macro.dbt_utils.get_url_parameter": {"unique_id": "macro.dbt_utils.get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "name": "get_url_parameter", "macro_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n {{ return(adapter.dispatch('get_url_parameter', 'dbt_utils')(field, url_parameter)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.556512, "supported_languages": null}, "macro.dbt_utils.default__get_url_parameter": {"unique_id": "macro.dbt_utils.default__get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "name": "default__get_url_parameter", "macro_sql": "{% macro default__get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = split_part(split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.557517, "supported_languages": null}, "macro.dbt_utils.test_fewer_rows_than": {"unique_id": "macro.dbt_utils.test_fewer_rows_than", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "name": "test_fewer_rows_than", "macro_sql": "{% test fewer_rows_than(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_fewer_rows_than', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_fewer_rows_than"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5605, "supported_languages": null}, "macro.dbt_utils.default__test_fewer_rows_than": {"unique_id": "macro.dbt_utils.default__test_fewer_rows_than", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "name": "default__test_fewer_rows_than", "macro_sql": "{% macro default__test_fewer_rows_than(model, compare_model, group_by_columns) %}\n\n{{ config(fail_calc = 'sum(coalesce(row_count_delta, 0))') }}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in equal_rowcount. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_fewer_rows_than'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_our_model \n from {{ model }}\n {{ groupby_gb_cols }}\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_comparison_model \n from {{ compare_model }}\n {{ groupby_gb_cols }}\n\n),\ncounts as (\n\n select\n\n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_our_model,\n count_comparison_model\n from a\n full join b on \n a.id_dbtutils_test_fewer_rows_than = b.id_dbtutils_test_fewer_rows_than\n {{ join_gb_cols }}\n\n),\nfinal as (\n\n select *,\n case\n -- fail the test if we have more rows than the reference model and return the row count delta\n when count_our_model > count_comparison_model then (count_our_model - count_comparison_model)\n -- fail the test if they are the same number\n when count_our_model = count_comparison_model then 1\n -- pass the test if the delta is positive (i.e. return the number 0)\n else 0\n end as row_count_delta\n from counts\n\n)\n\nselect * from final\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.563772, "supported_languages": null}, "macro.dbt_utils.test_equal_rowcount": {"unique_id": "macro.dbt_utils.test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "name": "test_equal_rowcount", "macro_sql": "{% test equal_rowcount(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_equal_rowcount', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_equal_rowcount"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.566273, "supported_languages": null}, "macro.dbt_utils.default__test_equal_rowcount": {"unique_id": "macro.dbt_utils.default__test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "name": "default__test_equal_rowcount", "macro_sql": "{% macro default__test_equal_rowcount(model, compare_model, group_by_columns) %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = 'sum(coalesce(diff_count, 0))') }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(', ') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in fewer_rows_than. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_equal_rowcount'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_a \n from {{ model }}\n {{groupby_gb_cols}}\n\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_b \n from {{ compare_model }}\n {{groupby_gb_cols}}\n\n),\nfinal as (\n\n select\n \n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_a,\n count_b,\n abs(count_a - count_b) as diff_count\n\n from a\n full join b\n on\n a.id_dbtutils_test_equal_rowcount = b.id_dbtutils_test_equal_rowcount\n {{join_gb_cols}}\n\n\n)\n\nselect * from final\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.569769, "supported_languages": null}, "macro.dbt_utils.test_relationships_where": {"unique_id": "macro.dbt_utils.test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "name": "test_relationships_where", "macro_sql": "{% test relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n {{ return(adapter.dispatch('test_relationships_where', 'dbt_utils')(model, column_name, to, field, from_condition, to_condition)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_relationships_where"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.57184, "supported_languages": null}, "macro.dbt_utils.default__test_relationships_where": {"unique_id": "macro.dbt_utils.default__test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "name": "default__test_relationships_where", "macro_sql": "{% macro default__test_relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n\nwith left_table as (\n\n select\n {{column_name}} as id\n\n from {{model}}\n\n where {{column_name}} is not null\n and {{from_condition}}\n\n),\n\nright_table as (\n\n select\n {{field}} as id\n\n from {{to}}\n\n where {{field}} is not null\n and {{to_condition}}\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.572944, "supported_languages": null}, "macro.dbt_utils.test_recency": {"unique_id": "macro.dbt_utils.test_recency", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "name": "test_recency", "macro_sql": "{% test recency(model, field, datepart, interval, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_recency', 'dbt_utils')(model, field, datepart, interval, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_recency"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.57485, "supported_languages": null}, "macro.dbt_utils.default__test_recency": {"unique_id": "macro.dbt_utils.default__test_recency", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "name": "default__test_recency", "macro_sql": "{% macro default__test_recency(model, field, datepart, interval, group_by_columns) %}\n\n{% set threshold = dateadd(datepart, interval * -1, current_timestamp_backcompat()) %}\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nwith recency as (\n\n select \n\n {{ select_gb_cols }}\n max({{field}}) as most_recent\n\n from {{ model }}\n\n {{ groupby_gb_cols }}\n\n)\n\nselect\n\n {{ select_gb_cols }}\n most_recent,\n {{ threshold }} as threshold\n\nfrom recency\nwhere most_recent < {{ threshold }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5769129, "supported_languages": null}, "macro.dbt_utils.test_not_constant": {"unique_id": "macro.dbt_utils.test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "name": "test_not_constant", "macro_sql": "{% test not_constant(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_constant', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_constant"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.57849, "supported_languages": null}, "macro.dbt_utils.default__test_not_constant": {"unique_id": "macro.dbt_utils.default__test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "name": "default__test_not_constant", "macro_sql": "{% macro default__test_not_constant(model, column_name, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nselect\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count(distinct {{ column_name }}) as filler_column\n\nfrom {{ model }}\n\n {{groupby_gb_cols}}\n\nhaving count(distinct {{ column_name }}) = 1\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5799959, "supported_languages": null}, "macro.dbt_utils.test_accepted_range": {"unique_id": "macro.dbt_utils.test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "name": "test_accepted_range", "macro_sql": "{% test accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n {{ return(adapter.dispatch('test_accepted_range', 'dbt_utils')(model, column_name, min_value, max_value, inclusive)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_accepted_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.581983, "supported_languages": null}, "macro.dbt_utils.default__test_accepted_range": {"unique_id": "macro.dbt_utils.default__test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "name": "default__test_accepted_range", "macro_sql": "{% macro default__test_accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n\nwith meet_condition as(\n select *\n from {{ model }}\n),\n\nvalidation_errors as (\n select *\n from meet_condition\n where\n -- never true, defaults to an empty result set. Exists to ensure any combo of the `or` clauses below succeeds\n 1 = 2\n\n {%- if min_value is not none %}\n -- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} > {{- \"=\" if inclusive }} {{ min_value }}\n {%- endif %}\n\n {%- if max_value is not none %}\n -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} < {{- \"=\" if inclusive }} {{ max_value }}\n {%- endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5834959, "supported_languages": null}, "macro.dbt_utils.test_not_accepted_values": {"unique_id": "macro.dbt_utils.test_not_accepted_values", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "name": "test_not_accepted_values", "macro_sql": "{% test not_accepted_values(model, column_name, values, quote=True) %}\n {{ return(adapter.dispatch('test_not_accepted_values', 'dbt_utils')(model, column_name, values, quote)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5852852, "supported_languages": null}, "macro.dbt_utils.default__test_not_accepted_values": {"unique_id": "macro.dbt_utils.default__test_not_accepted_values", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "name": "default__test_not_accepted_values", "macro_sql": "{% macro default__test_not_accepted_values(model, column_name, values, quote=True) %}\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5867488, "supported_languages": null}, "macro.dbt_utils.test_at_least_one": {"unique_id": "macro.dbt_utils.test_at_least_one", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "name": "test_at_least_one", "macro_sql": "{% test at_least_one(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_at_least_one', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_at_least_one"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5883389, "supported_languages": null}, "macro.dbt_utils.default__test_at_least_one": {"unique_id": "macro.dbt_utils.default__test_at_least_one", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "name": "default__test_at_least_one", "macro_sql": "{% macro default__test_at_least_one(model, column_name, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nselect *\nfrom (\n select\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count({{ column_name }}) as filler_column\n\n from {{ model }}\n\n {{groupby_gb_cols}}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5898519, "supported_languages": null}, "macro.dbt_utils.test_unique_combination_of_columns": {"unique_id": "macro.dbt_utils.test_unique_combination_of_columns", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "name": "test_unique_combination_of_columns", "macro_sql": "{% test unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n {{ return(adapter.dispatch('test_unique_combination_of_columns', 'dbt_utils')(model, combination_of_columns, quote_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_combination_of_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5918112, "supported_languages": null}, "macro.dbt_utils.default__test_unique_combination_of_columns": {"unique_id": "macro.dbt_utils.default__test_unique_combination_of_columns", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "name": "default__test_unique_combination_of_columns", "macro_sql": "{% macro default__test_unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n\n{% if not quote_columns %}\n {%- set column_list=combination_of_columns %}\n{% elif quote_columns %}\n {%- set column_list=[] %}\n {% for column in combination_of_columns -%}\n {% set column_list = column_list.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set columns_csv=column_list | join(', ') %}\n\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.5938911, "supported_languages": null}, "macro.dbt_utils.test_cardinality_equality": {"unique_id": "macro.dbt_utils.test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "name": "test_cardinality_equality", "macro_sql": "{% test cardinality_equality(model, column_name, to, field) %}\n {{ return(adapter.dispatch('test_cardinality_equality', 'dbt_utils')(model, column_name, to, field)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_cardinality_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.595635, "supported_languages": null}, "macro.dbt_utils.default__test_cardinality_equality": {"unique_id": "macro.dbt_utils.default__test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "name": "default__test_cardinality_equality", "macro_sql": "{% macro default__test_cardinality_equality(model, column_name, to, field) %}\n\n{# T-SQL does not let you use numbers as aliases for columns #}\n{# Thus, no \"GROUP BY 1\" #}\n\nwith table_a as (\nselect\n {{ column_name }},\n count(*) as num_rows\nfrom {{ model }}\ngroup by {{ column_name }}\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by {{ field }}\n),\n\nexcept_a as (\n select *\n from table_a\n {{ except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ except() }}\n select *\n from table_a\n),\n\nunioned as (\n select *\n from except_a\n union all\n select *\n from except_b\n)\n\nselect *\nfrom unioned\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.596713, "supported_languages": null}, "macro.dbt_utils.test_expression_is_true": {"unique_id": "macro.dbt_utils.test_expression_is_true", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "name": "test_expression_is_true", "macro_sql": "{% test expression_is_true(model, expression, column_name=None, condition='1=1') %}\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n {{ return(adapter.dispatch('test_expression_is_true', 'dbt_utils')(model, expression, column_name, condition)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.598424, "supported_languages": null}, "macro.dbt_utils.default__test_expression_is_true": {"unique_id": "macro.dbt_utils.default__test_expression_is_true", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "name": "default__test_expression_is_true", "macro_sql": "{% macro default__test_expression_is_true(model, expression, column_name, condition) %}\n\n{% set column_list = '*' if should_store_failures() else \"1\" %}\n\nwith meet_condition as (\n select * from {{ model }} where {{ condition }}\n)\n\nselect\n {{ column_list }}\nfrom meet_condition\n{% if column_name is none %}\nwhere not({{ expression }})\n{%- else %}\nwhere not({{ column_name }} {{ expression }})\n{%- endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.599723, "supported_languages": null}, "macro.dbt_utils.test_not_null_proportion": {"unique_id": "macro.dbt_utils.test_not_null_proportion", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "name": "test_not_null_proportion", "macro_sql": "{% macro test_not_null_proportion(model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_null_proportion', 'dbt_utils')(model, group_by_columns, **kwargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_proportion"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.6017249, "supported_languages": null}, "macro.dbt_utils.default__test_not_null_proportion": {"unique_id": "macro.dbt_utils.default__test_not_null_proportion", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "name": "default__test_not_null_proportion", "macro_sql": "{% macro default__test_not_null_proportion(model, group_by_columns) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n{% set at_least = kwargs.get('at_least', kwargs.get('arg')) %}\n{% set at_most = kwargs.get('at_most', kwargs.get('arg', 1)) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith validation as (\n select\n {{select_gb_cols}}\n sum(case when {{ column_name }} is null then 0 else 1 end) / cast(count(*) as numeric) as not_null_proportion\n from {{ model }}\n {{groupby_gb_cols}}\n),\nvalidation_errors as (\n select\n {{select_gb_cols}}\n not_null_proportion\n from validation\n where not_null_proportion < {{ at_least }} or not_null_proportion > {{ at_most }}\n)\nselect\n *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.6043751, "supported_languages": null}, "macro.dbt_utils.test_sequential_values": {"unique_id": "macro.dbt_utils.test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "name": "test_sequential_values", "macro_sql": "{% test sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n {{ return(adapter.dispatch('test_sequential_values', 'dbt_utils')(model, column_name, interval, datepart, group_by_columns)) }}\n\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_sequential_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.60698, "supported_languages": null}, "macro.dbt_utils.default__test_sequential_values": {"unique_id": "macro.dbt_utils.default__test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "name": "default__test_sequential_values", "macro_sql": "{% macro default__test_sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n{% set previous_column_name = \"previous_\" ~ dbt_utils.slugify(column_name) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(',') + ', ' %}\n {% set partition_gb_cols = 'partition by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith windowed as (\n\n select\n {{ select_gb_cols }}\n {{ column_name }},\n lag({{ column_name }}) over (\n {{partition_gb_cols}}\n order by {{ column_name }}\n ) as {{ previous_column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ type_timestamp() }})= cast({{ dateadd(datepart, interval, previous_column_name) }} as {{ type_timestamp() }}))\n {% else %}\n where not({{ column_name }} = {{ previous_column_name }} + {{ interval }})\n {% endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.slugify", "macro.dbt.type_timestamp", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.6098719, "supported_languages": null}, "macro.dbt_utils.test_equality": {"unique_id": "macro.dbt_utils.test_equality", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "name": "test_equality", "macro_sql": "{% test equality(model, compare_model, compare_columns=None) %}\n {{ return(adapter.dispatch('test_equality', 'dbt_utils')(model, compare_model, compare_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.612082, "supported_languages": null}, "macro.dbt_utils.default__test_equality": {"unique_id": "macro.dbt_utils.default__test_equality", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "name": "default__test_equality", "macro_sql": "{% macro default__test_equality(model, compare_model, compare_columns=None) %}\n\n{% set set_diff %}\n count(*) + coalesce(abs(\n sum(case when which_diff = 'a_minus_b' then 1 else 0 end) -\n sum(case when which_diff = 'b_minus_a' then 1 else 0 end)\n ), 0)\n{% endset %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = set_diff) }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n-- setup\n{%- do dbt_utils._is_relation(model, 'test_equality') -%}\n\n{#-\nIf the compare_cols arg is provided, we can run this test without querying the\ninformation schema\u00a0\u2014 this allows the model to be an ephemeral model\n-#}\n\n{%- if not compare_columns -%}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set compare_columns = adapter.get_columns_in_relation(model) | map(attribute='quoted') -%}\n{%- endif -%}\n\n{% set compare_cols_csv = compare_columns | join(', ') %}\n\nwith a as (\n\n select * from {{ model }}\n\n),\n\nb as (\n\n select * from {{ compare_model }}\n\n),\n\na_minus_b as (\n\n select {{compare_cols_csv}} from a\n {{ except() }}\n select {{compare_cols_csv}} from b\n\n),\n\nb_minus_a as (\n\n select {{compare_cols_csv}} from b\n {{ except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select 'a_minus_b' as which_diff, a_minus_b.* from a_minus_b\n union all\n select 'b_minus_a' as which_diff, b_minus_a.* from b_minus_a\n\n)\n\nselect * from unioned\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.6148531, "supported_languages": null}, "macro.dbt_utils.test_not_empty_string": {"unique_id": "macro.dbt_utils.test_not_empty_string", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "name": "test_not_empty_string", "macro_sql": "{% test not_empty_string(model, column_name, trim_whitespace=true) %}\n\n {{ return(adapter.dispatch('test_not_empty_string', 'dbt_utils')(model, column_name, trim_whitespace)) }}\n\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_empty_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.6165178, "supported_languages": null}, "macro.dbt_utils.default__test_not_empty_string": {"unique_id": "macro.dbt_utils.default__test_not_empty_string", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "name": "default__test_not_empty_string", "macro_sql": "{% macro default__test_not_empty_string(model, column_name, trim_whitespace=true) %}\n\n with\n \n all_values as (\n\n select \n\n\n {% if trim_whitespace == true -%}\n\n trim({{ column_name }}) as {{ column_name }}\n\n {%- else -%}\n\n {{ column_name }}\n\n {%- endif %}\n \n from {{ model }}\n\n ),\n\n errors as (\n\n select * from all_values\n where {{ column_name }} = ''\n\n )\n\n select * from errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.617503, "supported_languages": null}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "name": "test_mutually_exclusive_ranges", "macro_sql": "{% test mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', 'dbt_utils')(model, lower_bound_column, upper_bound_column, partition_by, gaps, zero_length_range_allowed)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_mutually_exclusive_ranges"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.6257348, "supported_languages": null}, "macro.dbt_utils.default__test_mutually_exclusive_ranges": {"unique_id": "macro.dbt_utils.default__test_mutually_exclusive_ranges", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "name": "default__test_mutually_exclusive_ranges", "macro_sql": "{% macro default__test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n{% if gaps == 'not_allowed' %}\n {% set allow_gaps_operator='=' %}\n {% set allow_gaps_operator_in_words='equal_to' %}\n{% elif gaps == 'allowed' %}\n {% set allow_gaps_operator='<=' %}\n {% set allow_gaps_operator_in_words='less_than_or_equal_to' %}\n{% elif gaps == 'required' %}\n {% set allow_gaps_operator='<' %}\n {% set allow_gaps_operator_in_words='less_than' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '\" ~ gaps ~\"'.'\"\n ) }}\n{% endif %}\n{% if not zero_length_range_allowed %}\n {% set allow_zero_length_operator='<' %}\n {% set allow_zero_length_operator_in_words='less_than' %}\n{% elif zero_length_range_allowed %}\n {% set allow_zero_length_operator='<=' %}\n {% set allow_zero_length_operator_in_words='less_than_or_equal_to' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`zero_length_range_allowed` argument for mutually_exclusive_ranges test must be one of [true, false] Got: '\" ~ zero_length_range_allowed ~\"'.'\"\n ) }}\n{% endif %}\n\n{% set partition_clause=\"partition by \" ~ partition_by if partition_by else '' %}\n\nwith window_functions as (\n\n select\n {% if partition_by %}\n {{ partition_by }} as partition_by_col,\n {% endif %}\n {{ lower_bound_column }} as lower_bound,\n {{ upper_bound_column }} as upper_bound,\n\n lead({{ lower_bound_column }}) over (\n {{ partition_clause }}\n order by {{ lower_bound_column }}, {{ upper_bound_column }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_bound_column }} desc, {{ upper_bound_column }} desc\n ) = 1 as is_last_record\n\n from {{ model }}\n\n),\n\ncalc as (\n -- We want to return records where one of our assumptions fails, so we'll use\n -- the `not` function with `and` statements so we can write our assumptions more cleanly\n select\n *,\n\n -- For each record: lower_bound should be < upper_bound.\n -- Coalesce it to return an error on the null case (implicit assumption\n -- these columns are not_null)\n coalesce(\n lower_bound {{ allow_zero_length_operator }} upper_bound,\n false\n ) as lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect * from validation_errors\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.630819, "supported_languages": null}, "macro.dbt_utils.pretty_log_format": {"unique_id": "macro.dbt_utils.pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "name": "pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n {{ return(adapter.dispatch('pretty_log_format', 'dbt_utils')(message)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.631938, "supported_languages": null}, "macro.dbt_utils.default__pretty_log_format": {"unique_id": "macro.dbt_utils.default__pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "name": "default__pretty_log_format", "macro_sql": "{% macro default__pretty_log_format(message) %}\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.6324968, "supported_languages": null}, "macro.dbt_utils._is_relation": {"unique_id": "macro.dbt_utils._is_relation", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/_is_relation.sql", "original_file_path": "macros/jinja_helpers/_is_relation.sql", "name": "_is_relation", "macro_sql": "{% macro _is_relation(obj, macro) %}\n {%- if not (obj is mapping and obj.get('metadata', {}).get('type', '').endswith('Relation')) -%}\n {%- do exceptions.raise_compiler_error(\"Macro \" ~ macro ~ \" expected a Relation but received the value: \" ~ obj) -%}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.63417, "supported_languages": null}, "macro.dbt_utils.pretty_time": {"unique_id": "macro.dbt_utils.pretty_time", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "name": "pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n {{ return(adapter.dispatch('pretty_time', 'dbt_utils')(format)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.635308, "supported_languages": null}, "macro.dbt_utils.default__pretty_time": {"unique_id": "macro.dbt_utils.default__pretty_time", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "name": "default__pretty_time", "macro_sql": "{% macro default__pretty_time(format='%H:%M:%S') %}\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.635956, "supported_languages": null}, "macro.dbt_utils.log_info": {"unique_id": "macro.dbt_utils.log_info", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "name": "log_info", "macro_sql": "{% macro log_info(message) %}\n {{ return(adapter.dispatch('log_info', 'dbt_utils')(message)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__log_info"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.637066, "supported_languages": null}, "macro.dbt_utils.default__log_info": {"unique_id": "macro.dbt_utils.default__log_info", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "name": "default__log_info", "macro_sql": "{% macro default__log_info(message) %}\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.6376488, "supported_languages": null}, "macro.dbt_utils.slugify": {"unique_id": "macro.dbt_utils.slugify", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/slugify.sql", "original_file_path": "macros/jinja_helpers/slugify.sql", "name": "slugify", "macro_sql": "{% macro slugify(string) %}\n\n{#- Lower case the string -#}\n{% set string = string | lower %}\n{#- Replace spaces and dashes with underscores -#}\n{% set string = modules.re.sub('[ -]+', '_', string) %}\n{#- Only take letters, numbers, and underscores -#}\n{% set string = modules.re.sub('[^a-z0-9_]+', '', string) %}\n\n{{ return(string) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.639371, "supported_languages": null}, "macro.dbt_utils._is_ephemeral": {"unique_id": "macro.dbt_utils._is_ephemeral", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/_is_ephemeral.sql", "original_file_path": "macros/jinja_helpers/_is_ephemeral.sql", "name": "_is_ephemeral", "macro_sql": "{% macro _is_ephemeral(obj, macro) %}\n {%- if obj.is_cte -%}\n {% set ephemeral_prefix = api.Relation.add_ephemeral_prefix('') %}\n {% if obj.name.startswith(ephemeral_prefix) %}\n {% set model_name = obj.name[(ephemeral_prefix|length):] %}\n {% else %}\n {% set model_name = obj.name %}\n {%- endif -%}\n {% set error_message %}\nThe `{{ macro }}` macro cannot be used with ephemeral models, as it relies on the information schema.\n\n`{{ model_name }}` is an ephemeral model. Consider making it a view or table instead.\n {% endset %}\n {%- do exceptions.raise_compiler_error(error_message) -%}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.642146, "supported_languages": null}, "macro.dbt_utils.get_intervals_between": {"unique_id": "macro.dbt_utils.get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_utils')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.6442711, "supported_languages": null}, "macro.dbt_utils.default__get_intervals_between": {"unique_id": "macro.dbt_utils.default__get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.646158, "supported_languages": null}, "macro.dbt_utils.date_spine": {"unique_id": "macro.dbt_utils.date_spine", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_utils')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.646942, "supported_languages": null}, "macro.dbt_utils.default__date_spine": {"unique_id": "macro.dbt_utils.default__date_spine", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{dbt_utils.generate_series(\n dbt_utils.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n),\n\nall_periods as (\n\n select (\n {{\n dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.generate_series", "macro.dbt_utils.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.648086, "supported_languages": null}, "macro.dbt_utils.nullcheck_table": {"unique_id": "macro.dbt_utils.nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "name": "nullcheck_table", "macro_sql": "{% macro nullcheck_table(relation) %}\n {{ return(adapter.dispatch('nullcheck_table', 'dbt_utils')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.649293, "supported_languages": null}, "macro.dbt_utils.default__nullcheck_table": {"unique_id": "macro.dbt_utils.default__nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "name": "default__nullcheck_table", "macro_sql": "{% macro default__nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(relation, 'nullcheck_table') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'nullcheck_table') -%}\n {% set cols = adapter.get_columns_in_relation(relation) %}\n\n select {{ dbt_utils.nullcheck(cols) }}\n from {{relation}}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.6504252, "supported_languages": null}, "macro.dbt_utils.get_relations_by_pattern": {"unique_id": "macro.dbt_utils.get_relations_by_pattern", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "name": "get_relations_by_pattern", "macro_sql": "{% macro get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_pattern', 'dbt_utils')(schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.65255, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_pattern": {"unique_id": "macro.dbt_utils.default__get_relations_by_pattern", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "name": "default__get_relations_by_pattern", "macro_sql": "{% macro default__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.655469, "supported_languages": null}, "macro.dbt_utils.get_powers_of_two": {"unique_id": "macro.dbt_utils.get_powers_of_two", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.657888, "supported_languages": null}, "macro.dbt_utils.default__get_powers_of_two": {"unique_id": "macro.dbt_utils.default__get_powers_of_two", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.659244, "supported_languages": null}, "macro.dbt_utils.generate_series": {"unique_id": "macro.dbt_utils.generate_series", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.659884, "supported_languages": null}, "macro.dbt_utils.default__generate_series": {"unique_id": "macro.dbt_utils.default__generate_series", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_utils.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.6615949, "supported_languages": null}, "macro.dbt_utils.get_relations_by_prefix": {"unique_id": "macro.dbt_utils.get_relations_by_prefix", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "name": "get_relations_by_prefix", "macro_sql": "{% macro get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_prefix', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.663729, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_prefix": {"unique_id": "macro.dbt_utils.default__get_relations_by_prefix", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "name": "default__get_relations_by_prefix", "macro_sql": "{% macro default__get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_prefix_sql(schema, prefix, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.666463, "supported_languages": null}, "macro.dbt_utils.get_tables_by_prefix_sql": {"unique_id": "macro.dbt_utils.get_tables_by_prefix_sql", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "name": "get_tables_by_prefix_sql", "macro_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_prefix_sql', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.667965, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_prefix_sql": {"unique_id": "macro.dbt_utils.default__get_tables_by_prefix_sql", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "name": "default__get_tables_by_prefix_sql", "macro_sql": "{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(\n schema_pattern = schema,\n table_pattern = prefix ~ '%',\n exclude = exclude,\n database = database\n ) }}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.668894, "supported_languages": null}, "macro.dbt_utils.star": {"unique_id": "macro.dbt_utils.star", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "name": "star", "macro_sql": "{% macro star(from, relation_alias=False, except=[], prefix='', suffix='') -%}\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, prefix, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.6711, "supported_languages": null}, "macro.dbt_utils.default__star": {"unique_id": "macro.dbt_utils.default__star", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "name": "default__star", "macro_sql": "{% macro default__star(from, relation_alias=False, except=[], prefix='', suffix='') -%}\n {%- do dbt_utils._is_relation(from, 'star') -%}\n {%- do dbt_utils._is_ephemeral(from, 'star') -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return('*') }}\n {%- endif -%}\n\n {% set cols = dbt_utils.get_filtered_columns_in_relation(from, except) %}\n\n {%- if cols|length <= 0 -%}\n {{- return('*') -}}\n {%- else -%}\n {%- for col in cols %}\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}{{ adapter.quote(col)|trim }} {%- if prefix!='' or suffix!='' %} as {{ adapter.quote(prefix ~ col ~ suffix)|trim }} {%- endif -%}\n {%- if not loop.last %},{{ '\\n ' }}{% endif %}\n {%- endfor -%}\n {% endif %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.674282, "supported_languages": null}, "macro.dbt_utils.unpivot": {"unique_id": "macro.dbt_utils.unpivot", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "name": "unpivot", "macro_sql": "{% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value') -%}\n {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.677938, "supported_languages": null}, "macro.dbt_utils.default__unpivot": {"unique_id": "macro.dbt_utils.default__unpivot", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "name": "default__unpivot", "macro_sql": "{% macro default__unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value') -%}\n\n {% if not relation %}\n {{ exceptions.raise_compiler_error(\"Error: argument `relation` is required for `unpivot` macro.\") }}\n {% endif %}\n\n {%- set exclude = exclude if exclude is not none else [] %}\n {%- set remove = remove if remove is not none else [] %}\n\n {%- set include_cols = [] %}\n\n {%- set table_columns = {} %}\n\n {%- do table_columns.update({relation: []}) %}\n\n {%- do dbt_utils._is_relation(relation, 'unpivot') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'unpivot') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) %}\n\n {%- for col in cols -%}\n {%- if col.column.lower() not in remove|map('lower') and col.column.lower() not in exclude|map('lower') -%}\n {% do include_cols.append(col) %}\n {%- endif %}\n {%- endfor %}\n\n\n {%- for col in include_cols -%}\n select\n {%- for exclude_col in exclude %}\n {{ exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ type_string() }}) as {{ field_name }},\n cast( {% if col.data_type == 'boolean' %}\n {{ cast_bool_to_text(col.column) }}\n {% else %}\n {{ col.column }}\n {% endif %}\n as {{ cast_to }}) as {{ value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_string", "macro.dbt.cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.683149, "supported_languages": null}, "macro.dbt_utils.union_relations": {"unique_id": "macro.dbt_utils.union_relations", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "name": "union_relations", "macro_sql": "{%- macro union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n {{ return(adapter.dispatch('union_relations', 'dbt_utils')(relations, column_override, include, exclude, source_column_name, where)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.690839, "supported_languages": null}, "macro.dbt_utils.default__union_relations": {"unique_id": "macro.dbt_utils.default__union_relations", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "name": "default__union_relations", "macro_sql": "\n\n{%- macro default__union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n cast({{ string_literal(relation) }} as {{ type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ relation }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7017658, "supported_languages": null}, "macro.dbt_utils.group_by": {"unique_id": "macro.dbt_utils.group_by", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "name": "group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_utils')(n)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.702932, "supported_languages": null}, "macro.dbt_utils.default__group_by": {"unique_id": "macro.dbt_utils.default__group_by", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "name": "default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }} \n {%- endfor -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7037592, "supported_languages": null}, "macro.dbt_utils.deduplicate": {"unique_id": "macro.dbt_utils.deduplicate", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "deduplicate", "macro_sql": "{%- macro deduplicate(relation, partition_by, order_by) -%}\n {{ return(adapter.dispatch('deduplicate', 'dbt_utils')(relation, partition_by, order_by)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.70595, "supported_languages": null}, "macro.dbt_utils.default__deduplicate": {"unique_id": "macro.dbt_utils.default__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "default__deduplicate", "macro_sql": "\n\n{%- macro default__deduplicate(relation, partition_by, order_by) -%}\n\n with row_numbered as (\n select\n _inner.*,\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) as rn\n from {{ relation }} as _inner\n )\n\n select\n distinct data.*\n from {{ relation }} as data\n {#\n -- Not all DBs will support natural joins but the ones that do include:\n -- Oracle, MySQL, SQLite, Redshift, Teradata, Materialize, Databricks\n -- Apache Spark, SingleStore, Vertica\n -- Those that do not appear to support natural joins include:\n -- SQLServer, Trino, Presto, Rockset, Athena\n #}\n natural join row_numbered\n where row_numbered.rn = 1\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.706662, "supported_languages": null}, "macro.dbt_utils.redshift__deduplicate": {"unique_id": "macro.dbt_utils.redshift__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "redshift__deduplicate", "macro_sql": "{% macro redshift__deduplicate(relation, partition_by, order_by) -%}\n\n {{ return(dbt_utils.default__deduplicate(relation, partition_by, order_by=order_by)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7073228, "supported_languages": null}, "macro.dbt_utils.postgres__deduplicate": {"unique_id": "macro.dbt_utils.postgres__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "postgres__deduplicate", "macro_sql": "\n{%- macro postgres__deduplicate(relation, partition_by, order_by) -%}\n\n select\n distinct on ({{ partition_by }}) *\n from {{ relation }}\n order by {{ partition_by }}{{ ',' ~ order_by }}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.707958, "supported_languages": null}, "macro.dbt_utils.snowflake__deduplicate": {"unique_id": "macro.dbt_utils.snowflake__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "snowflake__deduplicate", "macro_sql": "\n{%- macro snowflake__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7085152, "supported_languages": null}, "macro.dbt_utils.bigquery__deduplicate": {"unique_id": "macro.dbt_utils.bigquery__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "bigquery__deduplicate", "macro_sql": "\n{%- macro bigquery__deduplicate(relation, partition_by, order_by) -%}\n\n select unique.*\n from (\n select\n array_agg (\n original\n order by {{ order_by }}\n limit 1\n )[offset(0)] unique\n from {{ relation }} original\n group by {{ partition_by }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.709086, "supported_languages": null}, "macro.dbt_utils.surrogate_key": {"unique_id": "macro.dbt_utils.surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "name": "surrogate_key", "macro_sql": "{%- macro surrogate_key(field_list) -%}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('surrogate_key', 'dbt_utils')(field_list, *varargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7105029, "supported_languages": null}, "macro.dbt_utils.default__surrogate_key": {"unique_id": "macro.dbt_utils.default__surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "name": "default__surrogate_key", "macro_sql": "\n\n{%- macro default__surrogate_key(field_list) -%}\n\n{%- set error_message = '\nWarning: `dbt_utils.surrogate_key` has been replaced by \\\n`dbt_utils.generate_surrogate_key`. The new macro treats null values \\\ndifferently to empty strings. To restore the behaviour of the original \\\nmacro, add a variable scoped to the dbt_utils package called \\\n`surrogate_key_treat_nulls_as_empty_strings` to your \\\ndbt_project.yml file with a value of True. \\\nThe {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7112808, "supported_languages": null}, "macro.dbt_utils.safe_add": {"unique_id": "macro.dbt_utils.safe_add", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "name": "safe_add", "macro_sql": "{%- macro safe_add(field_list) -%}\n {{ return(adapter.dispatch('safe_add', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__safe_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.712651, "supported_languages": null}, "macro.dbt_utils.default__safe_add": {"unique_id": "macro.dbt_utils.default__safe_add", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "name": "default__safe_add", "macro_sql": "\n\n{%- macro default__safe_add(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_add` macro now takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.warn(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.714404, "supported_languages": null}, "macro.dbt_utils.nullcheck": {"unique_id": "macro.dbt_utils.nullcheck", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "name": "nullcheck", "macro_sql": "{% macro nullcheck(cols) %}\n {{ return(adapter.dispatch('nullcheck', 'dbt_utils')(cols)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.715696, "supported_languages": null}, "macro.dbt_utils.default__nullcheck": {"unique_id": "macro.dbt_utils.default__nullcheck", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "name": "default__nullcheck", "macro_sql": "{% macro default__nullcheck(cols) %}\n{%- for col in cols %}\n\n {% if col.is_string() -%}\n\n nullif({{col.name}},'') as {{col.name}}\n\n {%- else -%}\n\n {{col.name}}\n\n {%- endif -%}\n\n{%- if not loop.last -%} , {%- endif -%}\n\n{%- endfor -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7168078, "supported_languages": null}, "macro.dbt_utils.get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "get_tables_by_pattern_sql", "macro_sql": "{% macro get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_pattern_sql', 'dbt_utils')\n (schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.721193, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.default__get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "default__get_tables_by_pattern_sql", "macro_sql": "{% macro default__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7223868, "supported_languages": null}, "macro.dbt_utils.bigquery__get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.bigquery__get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "bigquery__get_tables_by_pattern_sql", "macro_sql": "{% macro bigquery__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% if '%' in schema_pattern %}\n {% set schemata=dbt_utils._bigquery__get_matching_schemata(schema_pattern, database) %}\n {% else %}\n {% set schemata=[schema_pattern] %}\n {% endif %}\n\n {% set sql %}\n {% for schema in schemata %}\n select distinct\n table_schema,\n table_name,\n {{ dbt_utils.get_table_types_sql() }}\n\n from {{ adapter.quote(database) }}.{{ schema }}.INFORMATION_SCHEMA.TABLES\n where lower(table_name) like lower ('{{ table_pattern }}')\n and lower(table_name) not like lower ('{{ exclude }}')\n\n {% if not loop.last %} union all {% endif %}\n\n {% endfor %}\n {% endset %}\n\n {{ return(sql) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._bigquery__get_matching_schemata", "macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.724874, "supported_languages": null}, "macro.dbt_utils._bigquery__get_matching_schemata": {"unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "_bigquery__get_matching_schemata", "macro_sql": "{% macro _bigquery__get_matching_schemata(schema_pattern, database) %}\n {% if execute %}\n\n {% set sql %}\n select schema_name from {{ adapter.quote(database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like lower('{{ schema_pattern }}')\n {% endset %}\n\n {% set results=run_query(sql) %}\n\n {% set schemata=results.columns['schema_name'].values() %}\n\n {{ return(schemata) }}\n\n {% else %}\n\n {{ return([]) }}\n\n {% endif %}\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.726538, "supported_languages": null}, "macro.dbt_utils.get_column_values": {"unique_id": "macro.dbt_utils.get_column_values", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "name": "get_column_values", "macro_sql": "{% macro get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {{ return(adapter.dispatch('get_column_values', 'dbt_utils')(table, column, order_by, max_records, default, where)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_column_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.729702, "supported_languages": null}, "macro.dbt_utils.default__get_column_values": {"unique_id": "macro.dbt_utils.default__get_column_values", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "name": "default__get_column_values", "macro_sql": "{% macro default__get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {% set default = [] if not default %}\n {{ return(default) }}\n {% endif %}\n\n {%- do dbt_utils._is_ephemeral(table, 'get_column_values') -%}\n\n {# Not all relations are tables. Renaming for internal clarity without breaking functionality for anyone using named arguments #}\n {# TODO: Change the method signature in a future 0.x.0 release #}\n {%- set target_relation = table -%}\n\n {# adapter.load_relation is a convenience wrapper to avoid building a Relation when we already have one #}\n {% set relation_exists = (load_relation(target_relation)) is not none %}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not relation_exists and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ target_relation ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not relation_exists and default is not none -%}\n\n {{ log(\"Relation \" ~ target_relation ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n\n {% if where is not none %}\n where {{ where }}\n {% endif %}\n\n group by {{ column }}\n order by {{ order_by }}\n\n {% if max_records is not none %}\n limit {{ max_records }}\n {% endif %}\n\n {% endif %}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_column_values') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values) }}\n {%- else -%}\n {{ return(default) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_ephemeral", "macro.dbt.load_relation", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.734516, "supported_languages": null}, "macro.dbt_utils.pivot": {"unique_id": "macro.dbt_utils.pivot", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "name": "pivot", "macro_sql": "{% macro pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {{ return(adapter.dispatch('pivot', 'dbt_utils')(column, values, alias, agg, cmp, prefix, suffix, then_value, else_value, quote_identifiers, distinct)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7377112, "supported_languages": null}, "macro.dbt_utils.default__pivot": {"unique_id": "macro.dbt_utils.default__pivot", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "name": "default__pivot", "macro_sql": "{% macro default__pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {% for value in values %}\n {{ agg }}(\n {% if distinct %} distinct {% endif %}\n case\n when {{ column }} {{ cmp }} '{{ escape_single_quotes(value) }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ value ~ suffix) }}\n {% else %}\n as {{ dbt_utils.slugify(prefix ~ value ~ suffix) }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.escape_single_quotes", "macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.740417, "supported_languages": null}, "macro.dbt_utils.get_filtered_columns_in_relation": {"unique_id": "macro.dbt_utils.get_filtered_columns_in_relation", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "name": "get_filtered_columns_in_relation", "macro_sql": "{% macro get_filtered_columns_in_relation(from, except=[]) -%}\n {{ return(adapter.dispatch('get_filtered_columns_in_relation', 'dbt_utils')(from, except)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.742027, "supported_languages": null}, "macro.dbt_utils.default__get_filtered_columns_in_relation": {"unique_id": "macro.dbt_utils.default__get_filtered_columns_in_relation", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "name": "default__get_filtered_columns_in_relation", "macro_sql": "{% macro default__get_filtered_columns_in_relation(from, except=[]) -%}\n {%- do dbt_utils._is_relation(from, 'get_filtered_columns_in_relation') -%}\n {%- do dbt_utils._is_ephemeral(from, 'get_filtered_columns_in_relation') -%}\n\n {# -- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return('') }}\n {% endif %}\n\n {%- set include_cols = [] %}\n {%- set cols = adapter.get_columns_in_relation(from) -%}\n {%- set except = except | map(\"lower\") | list %}\n {%- for col in cols -%}\n {%- if col.column|lower not in except -%}\n {% do include_cols.append(col.column) %}\n {%- endif %}\n {%- endfor %}\n\n {{ return(include_cols) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.744384, "supported_languages": null}, "macro.dbt_utils.width_bucket": {"unique_id": "macro.dbt_utils.width_bucket", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "name": "width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ return(adapter.dispatch('width_bucket', 'dbt_utils') (expr, min_value, max_value, num_buckets)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__width_bucket"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7481441, "supported_languages": null}, "macro.dbt_utils.default__width_bucket": {"unique_id": "macro.dbt_utils.default__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "name": "default__width_bucket", "macro_sql": "{% macro default__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is eaxtly at the bucket egde\n case\n when\n mod(\n {{ dbt.safe_cast(expr, type_numeric() ) }},\n {{ dbt.safe_cast(bin_size, type_numeric() ) }}\n ) = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.749609, "supported_languages": null}, "macro.dbt_utils.redshift__width_bucket": {"unique_id": "macro.dbt_utils.redshift__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "name": "redshift__width_bucket", "macro_sql": "{% macro redshift__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is exactly at the bucket edge\n case\n when\n {{ dbt.safe_cast(expr, type_numeric() ) }} %\n {{ dbt.safe_cast(bin_size, type_numeric() ) }}\n = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.751059, "supported_languages": null}, "macro.dbt_utils.snowflake__width_bucket": {"unique_id": "macro.dbt_utils.snowflake__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "name": "snowflake__width_bucket", "macro_sql": "{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.751702, "supported_languages": null}, "macro.dbt_utils.get_query_results_as_dict": {"unique_id": "macro.dbt_utils.get_query_results_as_dict", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "name": "get_query_results_as_dict", "macro_sql": "{% macro get_query_results_as_dict(query) %}\n {{ return(adapter.dispatch('get_query_results_as_dict', 'dbt_utils')(query)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_query_results_as_dict"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7531068, "supported_languages": null}, "macro.dbt_utils.default__get_query_results_as_dict": {"unique_id": "macro.dbt_utils.default__get_query_results_as_dict", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "name": "default__get_query_results_as_dict", "macro_sql": "{% macro default__get_query_results_as_dict(query) %}\n\n{# This macro returns a dictionary of the form {column_name: (tuple_of_results)} #}\n\n {%- call statement('get_query_results', fetch_result=True,auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {% set sql_results={} %}\n\n {%- if execute -%}\n {% set sql_results_table = load_result('get_query_results').table.columns %}\n {% for column_name, column in sql_results_table.items() %}\n {% do sql_results.update({column_name: column.values()}) %}\n {% endfor %}\n {%- endif -%}\n\n {{ return(sql_results) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7550411, "supported_languages": null}, "macro.dbt_utils.generate_surrogate_key": {"unique_id": "macro.dbt_utils.generate_surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "name": "generate_surrogate_key", "macro_sql": "{%- macro generate_surrogate_key(field_list) -%}\n {{ return(adapter.dispatch('generate_surrogate_key', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__generate_surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.756604, "supported_languages": null}, "macro.dbt_utils.default__generate_surrogate_key": {"unique_id": "macro.dbt_utils.default__generate_surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "name": "default__generate_surrogate_key", "macro_sql": "\n\n{%- macro default__generate_surrogate_key(field_list) -%}\n\n{% if var('surrogate_key_treat_nulls_as_empty_strings', False) %}\n {% set default_null_value = \"\" %}\n{% else %}\n {% set default_null_value = '_dbt_utils_surrogate_key_null_'%}\n{% endif %}\n\n{%- set fields = [] -%}\n\n{%- for field in field_list -%}\n\n {%- do fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ type_string() ~ \"), '\" ~ default_null_value ~\"')\"\n ) -%}\n\n {%- if not loop.last %}\n {%- do fields.append(\"'-'\") -%}\n {%- endif -%}\n\n{%- endfor -%}\n\n{{ hash(concat(fields)) }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.hash", "macro.dbt.concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.758677, "supported_languages": null}, "macro.dbt_utils.get_table_types_sql": {"unique_id": "macro.dbt_utils.get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "name": "get_table_types_sql", "macro_sql": "{%- macro get_table_types_sql() -%}\n {{ return(adapter.dispatch('get_table_types_sql', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7600489, "supported_languages": null}, "macro.dbt_utils.default__get_table_types_sql": {"unique_id": "macro.dbt_utils.default__get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "name": "default__get_table_types_sql", "macro_sql": "{% macro default__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7605271, "supported_languages": null}, "macro.dbt_utils.postgres__get_table_types_sql": {"unique_id": "macro.dbt_utils.postgres__get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "name": "postgres__get_table_types_sql", "macro_sql": "{% macro postgres__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'FOREIGN' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.761009, "supported_languages": null}, "macro.dbt_utils.degrees_to_radians": {"unique_id": "macro.dbt_utils.degrees_to_radians", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "degrees_to_radians", "macro_sql": "{% macro degrees_to_radians(degrees) -%}\n acos(-1) * {{degrees}} / 180\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.763941, "supported_languages": null}, "macro.dbt_utils.haversine_distance": {"unique_id": "macro.dbt_utils.haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "haversine_distance", "macro_sql": "{% macro haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n {{ return(adapter.dispatch('haversine_distance', 'dbt_utils')(lat1,lon1,lat2,lon2,unit)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.bigquery__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.765026, "supported_languages": null}, "macro.dbt_utils.default__haversine_distance": {"unique_id": "macro.dbt_utils.default__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n\n 2 * 3961 * asin(sqrt(power((sin(radians(({{ lat2 }} - {{ lat1 }}) / 2))), 2) +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n power((sin(radians(({{ lon2 }} - {{ lon1 }}) / 2))), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7676318, "supported_languages": null}, "macro.dbt_utils.bigquery__haversine_distance": {"unique_id": "macro.dbt_utils.bigquery__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "bigquery__haversine_distance", "macro_sql": "{% macro bigquery__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{% set radians_lat1 = dbt_utils.degrees_to_radians(lat1) %}\n{% set radians_lat2 = dbt_utils.degrees_to_radians(lat2) %}\n{% set radians_lon1 = dbt_utils.degrees_to_radians(lon1) %}\n{% set radians_lon2 = dbt_utils.degrees_to_radians(lon2) %}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n 2 * 3961 * asin(sqrt(power(sin(({{ radians_lat2 }} - {{ radians_lat1 }}) / 2), 2) +\n cos({{ radians_lat1 }}) * cos({{ radians_lat2 }}) *\n power(sin(({{ radians_lon2 }} - {{ radians_lon1 }}) / 2), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.degrees_to_radians"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7702882, "supported_languages": null}, "macro.fivetran_utils.enabled_vars": {"unique_id": "macro.fivetran_utils.enabled_vars", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/enabled_vars.sql", "original_file_path": "macros/enabled_vars.sql", "name": "enabled_vars", "macro_sql": "{% macro enabled_vars(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, True) == False %}\n {{ return(False) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(True) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.771927, "supported_languages": null}, "macro.fivetran_utils.percentile": {"unique_id": "macro.fivetran_utils.percentile", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "percentile", "macro_sql": "{% macro percentile(percentile_field, partition_field, percent) -%}\n\n{{ adapter.dispatch('percentile', 'fivetran_utils') (percentile_field, partition_field, percent) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__percentile"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.774545, "supported_languages": null}, "macro.fivetran_utils.default__percentile": {"unique_id": "macro.fivetran_utils.default__percentile", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "default__percentile", "macro_sql": "{% macro default__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.775103, "supported_languages": null}, "macro.fivetran_utils.redshift__percentile": {"unique_id": "macro.fivetran_utils.redshift__percentile", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "redshift__percentile", "macro_sql": "{% macro redshift__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.775661, "supported_languages": null}, "macro.fivetran_utils.bigquery__percentile": {"unique_id": "macro.fivetran_utils.bigquery__percentile", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "bigquery__percentile", "macro_sql": "{% macro bigquery__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.776212, "supported_languages": null}, "macro.fivetran_utils.postgres__percentile": {"unique_id": "macro.fivetran_utils.postgres__percentile", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "postgres__percentile", "macro_sql": "{% macro postgres__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n /* have to group by partition field */\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.776709, "supported_languages": null}, "macro.fivetran_utils.spark__percentile": {"unique_id": "macro.fivetran_utils.spark__percentile", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "spark__percentile", "macro_sql": "{% macro spark__percentile(percentile_field, partition_field, percent) %}\n\n percentile( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7772522, "supported_languages": null}, "macro.fivetran_utils.pivot_json_extract": {"unique_id": "macro.fivetran_utils.pivot_json_extract", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/pivot_json_extract.sql", "original_file_path": "macros/pivot_json_extract.sql", "name": "pivot_json_extract", "macro_sql": "{% macro pivot_json_extract(string, list_of_properties) %}\n\n{%- for property in list_of_properties -%}\n\nreplace( {{ fivetran_utils.json_extract(string, property) }}, '\"', '') as {{ property | replace(' ', '_') | lower }}\n\n{%- if not loop.last -%},{%- endif %}\n{% endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7788339, "supported_languages": null}, "macro.fivetran_utils.persist_pass_through_columns": {"unique_id": "macro.fivetran_utils.persist_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/persist_pass_through_columns.sql", "original_file_path": "macros/persist_pass_through_columns.sql", "name": "persist_pass_through_columns", "macro_sql": "{% macro persist_pass_through_columns(pass_through_variable, identifier=none, transform='') %}\n\n{% if var(pass_through_variable, none) %}\n {% for field in var(pass_through_variable) %}\n , {{ transform ~ '(' ~ (identifier ~ '.' if identifier else '') ~ (field.alias if field.alias else field.name) ~ ')' }} as {{ field.alias if field.alias else field.name }}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.781069, "supported_languages": null}, "macro.fivetran_utils.json_parse": {"unique_id": "macro.fivetran_utils.json_parse", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "json_parse", "macro_sql": "{% macro json_parse(string, string_path) -%}\n\n{{ adapter.dispatch('json_parse', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__json_parse"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.784142, "supported_languages": null}, "macro.fivetran_utils.default__json_parse": {"unique_id": "macro.fivetran_utils.default__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "default__json_parse", "macro_sql": "{% macro default__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.784975, "supported_languages": null}, "macro.fivetran_utils.redshift__json_parse": {"unique_id": "macro.fivetran_utils.redshift__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "redshift__json_parse", "macro_sql": "{% macro redshift__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.785814, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_parse": {"unique_id": "macro.fivetran_utils.bigquery__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "bigquery__json_parse", "macro_sql": "{% macro bigquery__json_parse(string, string_path) %}\n\n \n json_extract_scalar({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.78662, "supported_languages": null}, "macro.fivetran_utils.postgres__json_parse": {"unique_id": "macro.fivetran_utils.postgres__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "postgres__json_parse", "macro_sql": "{% macro postgres__json_parse(string, string_path) %}\n\n {{string}}::json #>> '{ {%- for s in string_path -%}{{ s }}{%- if not loop.last -%},{%- endif -%}{%- endfor -%} }'\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7874188, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_parse": {"unique_id": "macro.fivetran_utils.snowflake__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "snowflake__json_parse", "macro_sql": "{% macro snowflake__json_parse(string, string_path) %}\n\n parse_json( {{string}} ) {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7883039, "supported_languages": null}, "macro.fivetran_utils.spark__json_parse": {"unique_id": "macro.fivetran_utils.spark__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "spark__json_parse", "macro_sql": "{% macro spark__json_parse(string, string_path) %}\n\n {{string}} : {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.789184, "supported_languages": null}, "macro.fivetran_utils.max_bool": {"unique_id": "macro.fivetran_utils.max_bool", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "max_bool", "macro_sql": "{% macro max_bool(boolean_field) -%}\n\n{{ adapter.dispatch('max_bool', 'fivetran_utils') (boolean_field) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__max_bool"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7903922, "supported_languages": null}, "macro.fivetran_utils.default__max_bool": {"unique_id": "macro.fivetran_utils.default__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "default__max_bool", "macro_sql": "{% macro default__max_bool(boolean_field) %}\n\n bool_or( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.790764, "supported_languages": null}, "macro.fivetran_utils.snowflake__max_bool": {"unique_id": "macro.fivetran_utils.snowflake__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "snowflake__max_bool", "macro_sql": "{% macro snowflake__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.791307, "supported_languages": null}, "macro.fivetran_utils.bigquery__max_bool": {"unique_id": "macro.fivetran_utils.bigquery__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "bigquery__max_bool", "macro_sql": "{% macro bigquery__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.791667, "supported_languages": null}, "macro.fivetran_utils.calculated_fields": {"unique_id": "macro.fivetran_utils.calculated_fields", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/calculated_fields.sql", "original_file_path": "macros/calculated_fields.sql", "name": "calculated_fields", "macro_sql": "{% macro calculated_fields(variable) -%}\n\n{% if var(variable, none) %}\n {% for field in var(variable) %}\n , {{ field.transform_sql }} as {{ field.name }} \n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.79309, "supported_languages": null}, "macro.fivetran_utils.seed_data_helper": {"unique_id": "macro.fivetran_utils.seed_data_helper", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/seed_data_helper.sql", "original_file_path": "macros/seed_data_helper.sql", "name": "seed_data_helper", "macro_sql": "{% macro seed_data_helper(seed_name, warehouses) %}\n\n{% if target.type in warehouses %}\n {% for w in warehouses %}\n {% if target.type == w %}\n {{ return(ref(seed_name ~ \"_\" ~ w ~ \"\")) }}\n {% endif %}\n {% endfor %}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.795137, "supported_languages": null}, "macro.fivetran_utils.fill_pass_through_columns": {"unique_id": "macro.fivetran_utils.fill_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/fill_pass_through_columns.sql", "original_file_path": "macros/fill_pass_through_columns.sql", "name": "fill_pass_through_columns", "macro_sql": "{% macro fill_pass_through_columns(pass_through_variable) %}\n\n{% if var(pass_through_variable) %}\n {% for field in var(pass_through_variable) %}\n {% if field.transform_sql %}\n , {{ field.transform_sql }} as {{ field.alias if field.alias else field.name }}\n {% else %}\n , {{ field.alias if field.alias else field.name }}\n {% endif %}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7972639, "supported_languages": null}, "macro.fivetran_utils.string_agg": {"unique_id": "macro.fivetran_utils.string_agg", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "string_agg", "macro_sql": "{% macro string_agg(field_to_agg, delimiter) -%}\n\n{{ adapter.dispatch('string_agg', 'fivetran_utils') (field_to_agg, delimiter) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__string_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.79883, "supported_languages": null}, "macro.fivetran_utils.default__string_agg": {"unique_id": "macro.fivetran_utils.default__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "default__string_agg", "macro_sql": "{% macro default__string_agg(field_to_agg, delimiter) %}\n string_agg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.799284, "supported_languages": null}, "macro.fivetran_utils.snowflake__string_agg": {"unique_id": "macro.fivetran_utils.snowflake__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "snowflake__string_agg", "macro_sql": "{% macro snowflake__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.7997298, "supported_languages": null}, "macro.fivetran_utils.redshift__string_agg": {"unique_id": "macro.fivetran_utils.redshift__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "redshift__string_agg", "macro_sql": "{% macro redshift__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.800171, "supported_languages": null}, "macro.fivetran_utils.spark__string_agg": {"unique_id": "macro.fivetran_utils.spark__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "spark__string_agg", "macro_sql": "{% macro spark__string_agg(field_to_agg, delimiter) %}\n -- collect set will remove duplicates\n replace(replace(replace(cast( collect_set({{ field_to_agg }}) as string), '[', ''), ']', ''), ', ', {{ delimiter }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.80063, "supported_languages": null}, "macro.fivetran_utils.timestamp_diff": {"unique_id": "macro.fivetran_utils.timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "timestamp_diff", "macro_sql": "{% macro timestamp_diff(first_date, second_date, datepart) %}\n {{ adapter.dispatch('timestamp_diff', 'fivetran_utils')(first_date, second_date, datepart) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__timestamp_diff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.807853, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_diff": {"unique_id": "macro.fivetran_utils.default__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "default__timestamp_diff", "macro_sql": "{% macro default__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.8084202, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_diff": {"unique_id": "macro.fivetran_utils.redshift__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "redshift__timestamp_diff", "macro_sql": "{% macro redshift__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.808964, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_diff": {"unique_id": "macro.fivetran_utils.bigquery__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "bigquery__timestamp_diff", "macro_sql": "{% macro bigquery__timestamp_diff(first_date, second_date, datepart) %}\n\n timestamp_diff(\n {{second_date}},\n {{first_date}},\n {{datepart}}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.809485, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_diff": {"unique_id": "macro.fivetran_utils.postgres__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "postgres__timestamp_diff", "macro_sql": "{% macro postgres__timestamp_diff(first_date, second_date, datepart) %}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ dbt.datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.815081, "supported_languages": null}, "macro.fivetran_utils.try_cast": {"unique_id": "macro.fivetran_utils.try_cast", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "try_cast", "macro_sql": "{% macro try_cast(field, type) %}\n {{ adapter.dispatch('try_cast', 'fivetran_utils') (field, type) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__try_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.8175519, "supported_languages": null}, "macro.fivetran_utils.default__safe_cast": {"unique_id": "macro.fivetran_utils.default__safe_cast", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.818024, "supported_languages": null}, "macro.fivetran_utils.redshift__try_cast": {"unique_id": "macro.fivetran_utils.redshift__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "redshift__try_cast", "macro_sql": "{% macro redshift__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when trim({{field}}) ~ '^(0|[1-9][0-9]*)$' then trim({{field}})\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.8189352, "supported_languages": null}, "macro.fivetran_utils.postgres__try_cast": {"unique_id": "macro.fivetran_utils.postgres__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "postgres__try_cast", "macro_sql": "{% macro postgres__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar)) ~ '^(0|[1-9][0-9]*)$' \n then replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar))\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.8198771, "supported_languages": null}, "macro.fivetran_utils.snowflake__try_cast": {"unique_id": "macro.fivetran_utils.snowflake__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "snowflake__try_cast", "macro_sql": "{% macro snowflake__try_cast(field, type) %}\n try_cast(cast({{field}} as varchar) as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.820322, "supported_languages": null}, "macro.fivetran_utils.bigquery__try_cast": {"unique_id": "macro.fivetran_utils.bigquery__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "bigquery__try_cast", "macro_sql": "{% macro bigquery__try_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.8207529, "supported_languages": null}, "macro.fivetran_utils.spark__try_cast": {"unique_id": "macro.fivetran_utils.spark__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "spark__try_cast", "macro_sql": "{% macro spark__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.821179, "supported_languages": null}, "macro.fivetran_utils.source_relation": {"unique_id": "macro.fivetran_utils.source_relation", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "name": "source_relation", "macro_sql": "{% macro source_relation(union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('source_relation', 'fivetran_utils') (union_schema_variable, union_database_variable) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.822816, "supported_languages": null}, "macro.fivetran_utils.default__source_relation": {"unique_id": "macro.fivetran_utils.default__source_relation", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "name": "default__source_relation", "macro_sql": "{% macro default__source_relation(union_schema_variable, union_database_variable) %}\n\n{% if var(union_schema_variable, none) %}\n, case\n {% for schema in var(union_schema_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%.{{ schema|lower }}.%' then '{{ schema|lower }}'\n {% endfor %}\n end as source_relation\n{% elif var(union_database_variable, none) %}\n, case\n {% for database in var(union_database_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%{{ database|lower }}.%' then '{{ database|lower }}'\n {% endfor %}\n end as source_relation\n{% else %}\n, cast('' as {{ dbt.type_string() }}) as source_relation\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.824681, "supported_languages": null}, "macro.fivetran_utils.first_value": {"unique_id": "macro.fivetran_utils.first_value", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "first_value", "macro_sql": "{% macro first_value(first_value_field, partition_field, order_by_field, order=\"asc\") -%}\n\n{{ adapter.dispatch('first_value', 'fivetran_utils') (first_value_field, partition_field, order_by_field, order) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__first_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.826349, "supported_languages": null}, "macro.fivetran_utils.default__first_value": {"unique_id": "macro.fivetran_utils.default__first_value", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "default__first_value", "macro_sql": "{% macro default__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.827039, "supported_languages": null}, "macro.fivetran_utils.redshift__first_value": {"unique_id": "macro.fivetran_utils.redshift__first_value", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "redshift__first_value", "macro_sql": "{% macro redshift__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} , {{ partition_field }} rows unbounded preceding )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.827771, "supported_languages": null}, "macro.fivetran_utils.add_dbt_source_relation": {"unique_id": "macro.fivetran_utils.add_dbt_source_relation", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/add_dbt_source_relation.sql", "original_file_path": "macros/add_dbt_source_relation.sql", "name": "add_dbt_source_relation", "macro_sql": "{% macro add_dbt_source_relation() %}\n\n{% if var('union_schemas', none) or var('union_databases', none) %}\n, _dbt_source_relation\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.82885, "supported_languages": null}, "macro.fivetran_utils.add_pass_through_columns": {"unique_id": "macro.fivetran_utils.add_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/add_pass_through_columns.sql", "original_file_path": "macros/add_pass_through_columns.sql", "name": "add_pass_through_columns", "macro_sql": "{% macro add_pass_through_columns(base_columns, pass_through_var) %}\n\n {% if pass_through_var %}\n\n {% for column in pass_through_var %}\n\n {% if column.alias %}\n\n {% do base_columns.append({ \"name\": column.name, \"alias\": column.alias, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column.name, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n \n {% endif %}\n\n {% endfor %}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.831614, "supported_languages": null}, "macro.fivetran_utils.union_relations": {"unique_id": "macro.fivetran_utils.union_relations", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "name": "union_relations", "macro_sql": "{%- macro union_relations(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n {%- set source_column_name = source_column_name if source_column_name is not none else '_dbt_source_relation' -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt_utils.string_literal(relation) }} as {{ dbt_utils.type_string() }}) as {{ source_column_name }},\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ aliases[loop.index0] if aliases else relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.843192, "supported_languages": null}, "macro.fivetran_utils.union_tables": {"unique_id": "macro.fivetran_utils.union_tables", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "name": "union_tables", "macro_sql": "{%- macro union_tables(tables, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_table') -%}\n\n {%- do exceptions.warn(\"Warning: the `union_tables` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use the `union_relations` macro instead\") -%}\n\n {{ return(dbt_utils.union_relations(tables, column_override, include, exclude, source_column_name)) }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.844327, "supported_languages": null}, "macro.fivetran_utils.snowflake_seed_data": {"unique_id": "macro.fivetran_utils.snowflake_seed_data", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/snowflake_seed_data.sql", "original_file_path": "macros/snowflake_seed_data.sql", "name": "snowflake_seed_data", "macro_sql": "{% macro snowflake_seed_data(seed_name) %}\n\n{% if target.type == 'snowflake' %}\n{{ return(ref(seed_name ~ '_snowflake')) }}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.845765, "supported_languages": null}, "macro.fivetran_utils.fill_staging_columns": {"unique_id": "macro.fivetran_utils.fill_staging_columns", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "name": "fill_staging_columns", "macro_sql": "{% macro fill_staging_columns(source_columns, staging_columns) -%}\n\n{%- set source_column_names = source_columns|map(attribute='name')|map('lower')|list -%}\n\n{%- for column in staging_columns %}\n {% if column.name|lower in source_column_names -%}\n {{ fivetran_utils.quote_column(column) }} as \n {%- if 'alias' in column %} {{ column.alias }} {% else %} {{ fivetran_utils.quote_column(column) }} {%- endif -%}\n {%- else -%}\n cast(null as {{ column.datatype }})\n {%- if 'alias' in column %} as {{ column.alias }} {% else %} as {{ fivetran_utils.quote_column(column) }} {% endif -%}\n {%- endif -%}\n {%- if not loop.last -%} , {% endif -%}\n{% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.quote_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.850337, "supported_languages": null}, "macro.fivetran_utils.quote_column": {"unique_id": "macro.fivetran_utils.quote_column", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "name": "quote_column", "macro_sql": "{% macro quote_column(column) %}\n {% if 'quote' in column %}\n {% if column.quote %}\n {% if target.type in ('bigquery', 'spark') %}\n `{{ column.name }}`\n {% elif target.type == 'snowflake' %}\n \"{{ column.name | upper }}\"\n {% else %}\n \"{{ column.name }}\"\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.852114, "supported_languages": null}, "macro.fivetran_utils.json_extract": {"unique_id": "macro.fivetran_utils.json_extract", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "json_extract", "macro_sql": "{% macro json_extract(string, string_path) -%}\n\n{{ adapter.dispatch('json_extract', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.8539038, "supported_languages": null}, "macro.fivetran_utils.default__json_extract": {"unique_id": "macro.fivetran_utils.default__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "default__json_extract", "macro_sql": "{% macro default__json_extract(string, string_path) %}\n\n json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} )\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.8544278, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_extract": {"unique_id": "macro.fivetran_utils.snowflake__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "snowflake__json_extract", "macro_sql": "{% macro snowflake__json_extract(string, string_path) %}\n\n json_extract_path_text(try_parse_json( {{string}} ), {{ \"'\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.8549492, "supported_languages": null}, "macro.fivetran_utils.redshift__json_extract": {"unique_id": "macro.fivetran_utils.redshift__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "redshift__json_extract", "macro_sql": "{% macro redshift__json_extract(string, string_path) %}\n\n case when is_valid_json( {{string}} ) then json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} ) else null end\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.855529, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_extract": {"unique_id": "macro.fivetran_utils.bigquery__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "bigquery__json_extract", "macro_sql": "{% macro bigquery__json_extract(string, string_path) %}\n\n json_extract_scalar({{string}}, {{ \"'$.\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.8560472, "supported_languages": null}, "macro.fivetran_utils.postgres__json_extract": {"unique_id": "macro.fivetran_utils.postgres__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "postgres__json_extract", "macro_sql": "{% macro postgres__json_extract(string, string_path) %}\n\n {{string}}::json->>{{\"'\" ~ string_path ~ \"'\" }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.856565, "supported_languages": null}, "macro.fivetran_utils.collect_freshness": {"unique_id": "macro.fivetran_utils.collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "name": "collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness')(source, loaded_at_field, filter))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.858701, "supported_languages": null}, "macro.fivetran_utils.default__collect_freshness": {"unique_id": "macro.fivetran_utils.default__collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "name": "default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n\n {%- set enabled_array = [] -%}\n {% for node in graph.sources.values() %}\n {% if node.identifier == source.identifier %}\n {% if (node.meta['is_enabled'] | default(true)) %}\n {%- do enabled_array.append(1) -%}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% set is_enabled = (enabled_array != []) %}\n\n select\n {% if is_enabled %}\n max({{ loaded_at_field }})\n {% else %} \n {{ current_timestamp() }} {% endif %} as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n\n {% if is_enabled %}\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endif %}\n\n {% endcall %}\n {{ return(load_result('collect_freshness').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.861823, "supported_languages": null}, "macro.fivetran_utils.timestamp_add": {"unique_id": "macro.fivetran_utils.timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "timestamp_add", "macro_sql": "{% macro timestamp_add(datepart, interval, from_timestamp) -%}\n\n{{ adapter.dispatch('timestamp_add', 'fivetran_utils') (datepart, interval, from_timestamp) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.bigquery__timestamp_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.863909, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_add": {"unique_id": "macro.fivetran_utils.default__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "default__timestamp_add", "macro_sql": "{% macro default__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestampadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.864463, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_add": {"unique_id": "macro.fivetran_utils.bigquery__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "bigquery__timestamp_add", "macro_sql": "{% macro bigquery__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestamp_add({{ from_timestamp }}, interval {{ interval }} {{ datepart }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.865, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_add": {"unique_id": "macro.fivetran_utils.redshift__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "redshift__timestamp_add", "macro_sql": "{% macro redshift__timestamp_add(datepart, interval, from_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.865556, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_add": {"unique_id": "macro.fivetran_utils.postgres__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "postgres__timestamp_add", "macro_sql": "{% macro postgres__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ from_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.866095, "supported_languages": null}, "macro.fivetran_utils.spark__timestamp_add": {"unique_id": "macro.fivetran_utils.spark__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "spark__timestamp_add", "macro_sql": "{% macro spark__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ dbt.dateadd(datepart, interval, from_timestamp) }}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.8666828, "supported_languages": null}, "macro.fivetran_utils.ceiling": {"unique_id": "macro.fivetran_utils.ceiling", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "ceiling", "macro_sql": "{% macro ceiling(num) -%}\n\n{{ adapter.dispatch('ceiling', 'fivetran_utils') (num) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__ceiling"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.867723, "supported_languages": null}, "macro.fivetran_utils.default__ceiling": {"unique_id": "macro.fivetran_utils.default__ceiling", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "default__ceiling", "macro_sql": "{% macro default__ceiling(num) %}\n ceiling({{ num }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.868098, "supported_languages": null}, "macro.fivetran_utils.snowflake__ceiling": {"unique_id": "macro.fivetran_utils.snowflake__ceiling", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "snowflake__ceiling", "macro_sql": "{% macro snowflake__ceiling(num) %}\n ceil({{ num }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.868958, "supported_languages": null}, "macro.fivetran_utils.remove_prefix_from_columns": {"unique_id": "macro.fivetran_utils.remove_prefix_from_columns", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/remove_prefix_from_columns.sql", "original_file_path": "macros/remove_prefix_from_columns.sql", "name": "remove_prefix_from_columns", "macro_sql": "{% macro remove_prefix_from_columns(columns, prefix='', exclude=[]) %}\n\n {%- for col in columns if col.name not in exclude -%}\n {%- if col.name[:prefix|length]|lower == prefix -%}\n {{ col.name }} as {{ col.name[prefix|length:] }}\n {%- else -%}\n {{ col.name }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {% endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.871159, "supported_languages": null}, "macro.fivetran_utils.union_data": {"unique_id": "macro.fivetran_utils.union_data", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "name": "union_data", "macro_sql": "{% macro union_data(table_identifier, database_variable, schema_variable, default_database, default_schema, default_variable, union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('union_data', 'fivetran_utils') (\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__union_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.874975, "supported_languages": null}, "macro.fivetran_utils.default__union_data": {"unique_id": "macro.fivetran_utils.default__union_data", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "name": "default__union_data", "macro_sql": "{% macro default__union_data(\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) %}\n\n{% if var(union_schema_variable, none) %}\n\n {% set relations = [] %}\n \n {% if var(union_schema_variable) is string %}\n {% set trimmed = var(union_schema_variable)|trim('[')|trim(']') %}\n {% set schemas = trimmed.split(',')|map('trim',\" \")|map('trim','\"')|map('trim',\"'\") %}\n {% else %}\n {% set schemas = var(union_schema_variable) %}\n {% endif %}\n\n {% for schema in var(union_schema_variable) %}\n {% set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else var(database_variable, default_database),\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else schema,\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n \n {% set relation_exists=relation is not none %}\n\n {% if relation_exists %}\n\n {% do relations.append(relation) %}\n \n {% endif %}\n\n {% endfor %}\n\n {{ dbt_utils.union_relations(relations) }}\n\n{% elif var(union_database_variable, none) %}\n\n {% set relations = [] %}\n\n {% for database in var(union_database_variable) %}\n\n {% set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else database,\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else var(schema_variable, default_schema),\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n\n {% set relation_exists=relation is not none %}\n\n {% if relation_exists %}\n\n {% do relations.append(relation) %}\n \n {% endif %}\n\n {% endfor %}\n\n {{ dbt_utils.union_relations(relations) }}\n\n{% else %}\n\n select * \n from {{ var(default_variable) }}\n\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.882499, "supported_languages": null}, "macro.fivetran_utils.dummy_coalesce_value": {"unique_id": "macro.fivetran_utils.dummy_coalesce_value", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/dummy_coalesce_value.sql", "original_file_path": "macros/dummy_coalesce_value.sql", "name": "dummy_coalesce_value", "macro_sql": "{% macro dummy_coalesce_value(column) %}\n\n{% set coalesce_value = {\n 'STRING': \"'DUMMY_STRING'\",\n 'BOOLEAN': 'null',\n 'INT': 999999999,\n 'FLOAT': 999999999.99,\n 'TIMESTAMP': 'cast(\"2099-12-31\" as timestamp)',\n 'DATE': 'cast(\"2099-12-31\" as date)',\n} %}\n\n{% if column.is_float() %}\n{{ return(coalesce_value['FLOAT']) }}\n\n{% elif column.is_numeric() %}\n{{ return(coalesce_value['INT']) }}\n\n{% elif column.is_string() %}\n{{ return(coalesce_value['STRING']) }}\n\n{% elif column.data_type|lower == 'boolean' %}\n{{ return(coalesce_value['BOOLEAN']) }}\n\n{% elif 'timestamp' in column.data_type|lower %}\n{{ return(coalesce_value['TIMESTAMP']) }}\n\n{% elif 'date' in column.data_type|lower %}\n{{ return(coalesce_value['DATE']) }}\n\n{% elif 'int' in column.data_type|lower %}\n{{ return(coalesce_value['INT']) }}\n\n{% endif %}\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.887088, "supported_languages": null}, "macro.fivetran_utils.array_agg": {"unique_id": "macro.fivetran_utils.array_agg", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "array_agg", "macro_sql": "{% macro array_agg(field_to_agg) -%}\n\n{{ adapter.dispatch('array_agg', 'fivetran_utils') (field_to_agg) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__array_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.88818, "supported_languages": null}, "macro.fivetran_utils.default__array_agg": {"unique_id": "macro.fivetran_utils.default__array_agg", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "default__array_agg", "macro_sql": "{% macro default__array_agg(field_to_agg) %}\n array_agg({{ field_to_agg }})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.888541, "supported_languages": null}, "macro.fivetran_utils.redshift__array_agg": {"unique_id": "macro.fivetran_utils.redshift__array_agg", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "redshift__array_agg", "macro_sql": "{% macro redshift__array_agg(field_to_agg) %}\n listagg({{ field_to_agg }}, ',')\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.888895, "supported_languages": null}, "macro.fivetran_utils.empty_variable_warning": {"unique_id": "macro.fivetran_utils.empty_variable_warning", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/empty_variable_warning.sql", "original_file_path": "macros/empty_variable_warning.sql", "name": "empty_variable_warning", "macro_sql": "{% macro empty_variable_warning(variable, downstream_model) %}\n\n{% if not var(variable) %}\n{{ log(\n \"\"\"\n Warning: You have passed an empty list to the \"\"\" ~ variable ~ \"\"\".\n As a result, you won't see the history of any columns in the \"\"\" ~ downstream_model ~ \"\"\" model.\n \"\"\",\n info=True\n) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.890385, "supported_languages": null}, "macro.fivetran_utils.enabled_vars_one_true": {"unique_id": "macro.fivetran_utils.enabled_vars_one_true", "package_name": "fivetran_utils", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/enabled_vars_one_true.sql", "original_file_path": "macros/enabled_vars_one_true.sql", "name": "enabled_vars_one_true", "macro_sql": "{% macro enabled_vars_one_true(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, False) == True %}\n {{ return(True) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(False) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.891885, "supported_languages": null}, "macro.github_source.get_issue_columns": {"unique_id": "macro.github_source.get_issue_columns", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_columns.sql", "original_file_path": "macros/get_issue_columns.sql", "name": "get_issue_columns", "macro_sql": "{% macro get_issue_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"body\", \"datatype\": dbt.type_string()},\n {\"name\": \"closed_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"locked\", \"datatype\": \"boolean\"},\n {\"name\": \"milestone_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"number\", \"datatype\": dbt.type_int()},\n {\"name\": \"pull_request\", \"datatype\": \"boolean\"},\n {\"name\": \"repository_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"state\", \"datatype\": dbt.type_string()},\n {\"name\": \"title\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"user_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.896749, "supported_languages": null}, "macro.github_source.get_issue_comment_columns": {"unique_id": "macro.github_source.get_issue_comment_columns", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_comment_columns.sql", "original_file_path": "macros/get_issue_comment_columns.sql", "name": "get_issue_comment_columns", "macro_sql": "{% macro get_issue_comment_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"body\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"user_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.899654, "supported_languages": null}, "macro.github_source.get_repository_columns": {"unique_id": "macro.github_source.get_repository_columns", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_repository_columns.sql", "original_file_path": "macros/get_repository_columns.sql", "name": "get_repository_columns", "macro_sql": "{% macro get_repository_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"archived\", \"datatype\": \"boolean\"},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"default_branch\", \"datatype\": dbt.type_string()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"fork\", \"datatype\": \"boolean\"},\n {\"name\": \"full_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"homepage\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"language\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"owner_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"private\", \"datatype\": \"boolean\"}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.904137, "supported_languages": null}, "macro.github_source.get_issue_merged_columns": {"unique_id": "macro.github_source.get_issue_merged_columns", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_merged_columns.sql", "original_file_path": "macros/get_issue_merged_columns.sql", "name": "get_issue_merged_columns", "macro_sql": "{% macro get_issue_merged_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"actor_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"commit_sha\", \"datatype\": dbt.type_string()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"merged_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.9064882, "supported_languages": null}, "macro.github_source.get_pull_request_review_columns": {"unique_id": "macro.github_source.get_pull_request_review_columns", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_pull_request_review_columns.sql", "original_file_path": "macros/get_pull_request_review_columns.sql", "name": "get_pull_request_review_columns", "macro_sql": "{% macro get_pull_request_review_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"body\", \"datatype\": dbt.type_string()},\n {\"name\": \"commit_sha\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"pull_request_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"state\", \"datatype\": dbt.type_string()},\n {\"name\": \"submitted_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"user_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.909672, "supported_languages": null}, "macro.github_source.get_team_columns": {"unique_id": "macro.github_source.get_team_columns", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_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_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"org_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"parent_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"privacy\", \"datatype\": dbt.type_string()},\n {\"name\": \"slug\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.912838, "supported_languages": null}, "macro.github_source.get_issue_assignee_columns": {"unique_id": "macro.github_source.get_issue_assignee_columns", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_assignee_columns.sql", "original_file_path": "macros/get_issue_assignee_columns.sql", "name": "get_issue_assignee_columns", "macro_sql": "{% macro get_issue_assignee_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"user_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.914619, "supported_languages": null}, "macro.github_source.get_user_columns": {"unique_id": "macro.github_source.get_user_columns", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_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\": \"company\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"login\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.916675, "supported_languages": null}, "macro.github_source.get_label_columns": {"unique_id": "macro.github_source.get_label_columns", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_label_columns.sql", "original_file_path": "macros/get_label_columns.sql", "name": "get_label_columns", "macro_sql": "{% macro get_label_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"color\", \"datatype\": dbt.type_string()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"is_default\", \"datatype\": \"boolean\"},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"url\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.919534, "supported_languages": null}, "macro.github_source.get_pull_request_columns": {"unique_id": "macro.github_source.get_pull_request_columns", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_pull_request_columns.sql", "original_file_path": "macros/get_pull_request_columns.sql", "name": "get_pull_request_columns", "macro_sql": "{% macro get_pull_request_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"base_label\", \"datatype\": dbt.type_string()},\n {\"name\": \"base_ref\", \"datatype\": dbt.type_string()},\n {\"name\": \"base_repo_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"base_sha\", \"datatype\": dbt.type_string()},\n {\"name\": \"base_user_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"head_label\", \"datatype\": dbt.type_string()},\n {\"name\": \"head_ref\", \"datatype\": dbt.type_string()},\n {\"name\": \"head_repo_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"head_sha\", \"datatype\": dbt.type_string()},\n {\"name\": \"head_user_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"merge_commit_sha\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.924618, "supported_languages": null}, "macro.github_source.get_requested_reviewer_history_columns": {"unique_id": "macro.github_source.get_requested_reviewer_history_columns", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_requested_reviewer_history_columns.sql", "original_file_path": "macros/get_requested_reviewer_history_columns.sql", "name": "get_requested_reviewer_history_columns", "macro_sql": "{% macro get_requested_reviewer_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"actor_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"pull_request_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"removed\", \"datatype\": \"boolean\"},\n {\"name\": \"requested_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.9272199, "supported_languages": null}, "macro.github_source.get_issue_closed_history_columns": {"unique_id": "macro.github_source.get_issue_closed_history_columns", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_closed_history_columns.sql", "original_file_path": "macros/get_issue_closed_history_columns.sql", "name": "get_issue_closed_history_columns", "macro_sql": "{% macro get_issue_closed_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"actor_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"closed\", \"datatype\": \"boolean\"},\n {\"name\": \"commit_sha\", \"datatype\": dbt.type_string()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.929792, "supported_languages": null}, "macro.github_source.get_repo_team_columns": {"unique_id": "macro.github_source.get_repo_team_columns", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_repo_team_columns.sql", "original_file_path": "macros/get_repo_team_columns.sql", "name": "get_repo_team_columns", "macro_sql": "{% macro get_repo_team_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"permission\", \"datatype\": dbt.type_string()},\n {\"name\": \"repository_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"team_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.931854, "supported_languages": null}, "macro.github_source.get_issue_label_columns": {"unique_id": "macro.github_source.get_issue_label_columns", "package_name": "github_source", "root_path": "/Users/sheri.nguyen/dbt-packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_label_columns.sql", "original_file_path": "macros/get_issue_label_columns.sql", "name": "get_issue_label_columns", "macro_sql": "{% macro get_issue_label_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"label_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1667849267.933633, "supported_languages": null}}, "docs": {"dbt.__overview__": {"unique_id": "dbt.__overview__", "package_name": "dbt", "root_path": "/usr/local/lib/python3.9/site-packages/dbt/include/global_project", "path": "overview.md", "original_file_path": "docs/overview.md", "name": "__overview__", "block_contents": "### Welcome!\n\nWelcome to the auto-generated documentation for your dbt project!\n\n### Navigation\n\nYou can use the `Project` and `Database` navigation tabs on the left side of the window to explore the models\nin your project.\n\n#### Project Tab\nThe `Project` tab mirrors the directory structure of your dbt project. In this tab, you can see all of the\nmodels defined in your dbt project, as well as models imported from dbt packages.\n\n#### Database Tab\nThe `Database` tab also exposes your models, but in a format that looks more like a database explorer. This view\nshows relations (tables and views) grouped into database schemas. Note that ephemeral models are _not_ shown\nin this interface, as they do not exist in the database.\n\n### Graph Exploration\nYou can click the blue icon on the bottom-right corner of the page to view the lineage graph of your models.\n\nOn model pages, you'll see the immediate parents and children of the model you're exploring. By clicking the `Expand`\nbutton at the top-right of this lineage pane, you'll be able to see all of the models that are used to build,\nor are built from, the model you're exploring.\n\nOnce expanded, you'll be able to use the `--select` and `--exclude` model selection syntax to filter the\nmodels in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax).\n\nNote that you can also right-click on models to interactively filter and explore the graph.\n\n---\n\n### More information\n\n- [What is dbt](https://docs.getdbt.com/docs/introduction)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [dbt Community](https://www.getdbt.com/community/) for questions and discussion"}}, "exposures": {}, "metrics": {}, "selectors": {}, "disabled": {}, "parent_map": {"seed.github_integration_tests.github_pull_request_review_data": [], "seed.github_integration_tests.github_label_data": [], "seed.github_integration_tests.github_repository_data": [], "seed.github_integration_tests.github_issue_merged_data": [], "seed.github_integration_tests.github_issue_data": [], "seed.github_integration_tests.github_repo_team_data": [], "seed.github_integration_tests.github_requested_reviewer_history_data": [], "seed.github_integration_tests.github_issue_label_data": [], "seed.github_integration_tests.github_issue_comment_data": [], "seed.github_integration_tests.github_issue_assignee_data": [], "seed.github_integration_tests.github_issue_closed_history_data": [], "seed.github_integration_tests.github_pull_request_data": [], "seed.github_integration_tests.github_team_data": [], "seed.github_integration_tests.github_user_data": [], "model.github.github__weekly_metrics": ["model.github.github__daily_metrics"], "model.github.github__monthly_metrics": ["model.github.github__daily_metrics"], "model.github.github__quarterly_metrics": ["model.github.github__daily_metrics"], "model.github.github__pull_requests": ["model.github.int_github__issue_joined"], "model.github.github__daily_metrics": ["model.github.github__issues", "model.github.github__pull_requests"], "model.github.github__issues": ["model.github.int_github__issue_joined"], "model.github.int_github__pull_request_times": ["model.github_source.stg_github__issue", "model.github_source.stg_github__issue_merged", "model.github_source.stg_github__pull_request", "model.github_source.stg_github__pull_request_review", "model.github_source.stg_github__requested_reviewer_history"], "model.github.int_github__pull_request_reviewers": ["model.github_source.stg_github__pull_request_review", "model.github_source.stg_github__user"], "model.github.int_github__issue_label_joined": ["model.github_source.stg_github__issue_label", "model.github_source.stg_github__label"], "model.github.int_github__issue_joined": ["model.github.int_github__issue_assignees", "model.github.int_github__issue_comments", "model.github.int_github__issue_labels", "model.github.int_github__issue_open_length", "model.github.int_github__pull_request_reviewers", "model.github.int_github__pull_request_times", "model.github.int_github__repository_teams", "model.github_source.stg_github__issue", "model.github_source.stg_github__pull_request", "model.github_source.stg_github__user"], "model.github.int_github__issue_labels": ["model.github.int_github__issue_label_joined"], "model.github.int_github__issue_assignees": ["model.github_source.stg_github__issue_assignee", "model.github_source.stg_github__user"], "model.github.int_github__issue_comments": ["model.github_source.stg_github__issue_comment"], "model.github.int_github__issue_open_length": ["model.github_source.stg_github__issue", "model.github_source.stg_github__issue_closed_history"], "model.github.int_github__repository_teams": ["model.github_source.stg_github__repo_team", "model.github_source.stg_github__repository", "model.github_source.stg_github__team"], "model.github_source.stg_github__issue_comment": ["model.github_source.stg_github__issue_comment_tmp", "model.github_source.stg_github__issue_comment_tmp"], "model.github_source.stg_github__requested_reviewer_history": ["model.github_source.stg_github__requested_reviewer_history_tmp", "model.github_source.stg_github__requested_reviewer_history_tmp"], "model.github_source.stg_github__issue_label": ["model.github_source.stg_github__issue_label_tmp", "model.github_source.stg_github__issue_label_tmp"], "model.github_source.stg_github__issue_merged": ["model.github_source.stg_github__issue_merged_tmp", "model.github_source.stg_github__issue_merged_tmp"], "model.github_source.stg_github__issue_closed_history": ["model.github_source.stg_github__issue_closed_history_tmp", "model.github_source.stg_github__issue_closed_history_tmp"], "model.github_source.stg_github__issue_assignee": ["model.github_source.stg_github__issue_assignee_tmp", "model.github_source.stg_github__issue_assignee_tmp"], "model.github_source.stg_github__repository": ["model.github_source.stg_github__repository_tmp", "model.github_source.stg_github__repository_tmp"], "model.github_source.stg_github__user": ["model.github_source.stg_github__user_tmp", "model.github_source.stg_github__user_tmp"], "model.github_source.stg_github__pull_request_review": ["model.github_source.stg_github__pull_request_review_tmp", "model.github_source.stg_github__pull_request_review_tmp"], "model.github_source.stg_github__repo_team": ["model.github_source.stg_github__repo_team_tmp", "model.github_source.stg_github__repo_team_tmp"], "model.github_source.stg_github__label": ["model.github_source.stg_github__label_tmp", "model.github_source.stg_github__label_tmp"], "model.github_source.stg_github__issue": ["model.github_source.stg_github__issue_tmp", "model.github_source.stg_github__issue_tmp"], "model.github_source.stg_github__team": ["model.github_source.stg_github__team_tmp", "model.github_source.stg_github__team_tmp"], "model.github_source.stg_github__pull_request": ["model.github_source.stg_github__pull_request_tmp", "model.github_source.stg_github__pull_request_tmp"], "model.github_source.stg_github__repository_tmp": ["source.github_source.github.repository"], "model.github_source.stg_github__label_tmp": ["source.github_source.github.label"], "model.github_source.stg_github__requested_reviewer_history_tmp": ["source.github_source.github.requested_reviewer_history"], "model.github_source.stg_github__issue_comment_tmp": ["source.github_source.github.issue_comment"], "model.github_source.stg_github__pull_request_review_tmp": ["source.github_source.github.pull_request_review"], "model.github_source.stg_github__issue_label_tmp": ["source.github_source.github.issue_label"], "model.github_source.stg_github__team_tmp": ["source.github_source.github.team"], "model.github_source.stg_github__pull_request_tmp": ["source.github_source.github.pull_request"], "model.github_source.stg_github__issue_merged_tmp": ["source.github_source.github.issue_merged"], "model.github_source.stg_github__user_tmp": ["source.github_source.github.user"], "model.github_source.stg_github__issue_closed_history_tmp": ["source.github_source.github.issue_closed_history"], "model.github_source.stg_github__issue_assignee_tmp": ["source.github_source.github.issue_assignee"], "model.github_source.stg_github__issue_tmp": ["source.github_source.github.issue"], "model.github_source.stg_github__repo_team_tmp": ["source.github_source.github.repo_team"], "test.github.unique_github__issues_issue_id.6723b9b1db": ["model.github.github__issues"], "test.github.not_null_github__issues_issue_id.fed0631e25": ["model.github.github__issues"], "test.github.unique_github__pull_requests_issue_id.ce23997907": ["model.github.github__pull_requests"], "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f": ["model.github.github__pull_requests"], "test.github.unique_github__daily_metrics_day.f98cab9456": ["model.github.github__daily_metrics"], "test.github.not_null_github__daily_metrics_day.647e494434": ["model.github.github__daily_metrics"], "test.github.unique_github__weekly_metrics_week.6794858a8e": ["model.github.github__weekly_metrics"], "test.github.not_null_github__weekly_metrics_week.4b0b928243": ["model.github.github__weekly_metrics"], "test.github.unique_github__monthly_metrics_month.3076284fbb": ["model.github.github__monthly_metrics"], "test.github.not_null_github__monthly_metrics_month.9e4fba84df": ["model.github.github__monthly_metrics"], "test.github.unique_github__quarterly_metrics_quarter.9165a921c1": ["model.github.github__quarterly_metrics"], "test.github.not_null_github__quarterly_metrics_quarter.92394d46dc": ["model.github.github__quarterly_metrics"], "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4": ["model.github_source.stg_github__issue_assignee"], "test.github_source.not_null_stg_github__label_label_id.9f07379974": ["model.github_source.stg_github__label"], "test.github_source.unique_stg_github__label_label_id.74d3c21466": ["model.github_source.stg_github__label"], "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d": ["model.github_source.stg_github__issue_closed_history"], "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a": ["model.github_source.stg_github__issue_comment"], "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f": ["model.github_source.stg_github__issue_comment"], "test.github_source.unique_stg_github__issue_issue_id.84891aeece": ["model.github_source.stg_github__issue"], "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7": ["model.github_source.stg_github__issue"], "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508": ["model.github_source.stg_github__pull_request_review"], "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790": ["model.github_source.stg_github__pull_request_review"], "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa": ["model.github_source.stg_github__pull_request"], "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71": ["model.github_source.stg_github__pull_request"], "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503": ["model.github_source.stg_github__repo_team"], "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c": ["model.github_source.stg_github__repo_team"], "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d": ["model.github_source.stg_github__repository"], "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f": ["model.github_source.stg_github__repository"], "test.github_source.unique_stg_github__team_team_id.94e9716ab4": ["model.github_source.stg_github__team"], "test.github_source.not_null_stg_github__team_team_id.440aefe7a7": ["model.github_source.stg_github__team"], "test.github_source.unique_stg_github__user_user_id.5c1a00cd90": ["model.github_source.stg_github__user"], "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b": ["model.github_source.stg_github__user"], "source.github_source.github.issue_assignee": [], "source.github_source.github.label": [], "source.github_source.github.issue_closed_history": [], "source.github_source.github.issue_label": [], "source.github_source.github.issue_comment": [], "source.github_source.github.issue_merged": [], "source.github_source.github.issue": [], "source.github_source.github.pull_request_review": [], "source.github_source.github.pull_request": [], "source.github_source.github.repo_team": [], "source.github_source.github.repository": [], "source.github_source.github.requested_reviewer_history": [], "source.github_source.github.team": [], "source.github_source.github.user": []}, "child_map": {"seed.github_integration_tests.github_pull_request_review_data": [], "seed.github_integration_tests.github_label_data": [], "seed.github_integration_tests.github_repository_data": [], "seed.github_integration_tests.github_issue_merged_data": [], "seed.github_integration_tests.github_issue_data": [], "seed.github_integration_tests.github_repo_team_data": [], "seed.github_integration_tests.github_requested_reviewer_history_data": [], "seed.github_integration_tests.github_issue_label_data": [], "seed.github_integration_tests.github_issue_comment_data": [], "seed.github_integration_tests.github_issue_assignee_data": [], "seed.github_integration_tests.github_issue_closed_history_data": [], "seed.github_integration_tests.github_pull_request_data": [], "seed.github_integration_tests.github_team_data": [], "seed.github_integration_tests.github_user_data": [], "model.github.github__weekly_metrics": ["test.github.not_null_github__weekly_metrics_week.4b0b928243", "test.github.unique_github__weekly_metrics_week.6794858a8e"], "model.github.github__monthly_metrics": ["test.github.not_null_github__monthly_metrics_month.9e4fba84df", "test.github.unique_github__monthly_metrics_month.3076284fbb"], "model.github.github__quarterly_metrics": ["test.github.not_null_github__quarterly_metrics_quarter.92394d46dc", "test.github.unique_github__quarterly_metrics_quarter.9165a921c1"], "model.github.github__pull_requests": ["model.github.github__daily_metrics", "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f", "test.github.unique_github__pull_requests_issue_id.ce23997907"], "model.github.github__daily_metrics": ["model.github.github__monthly_metrics", "model.github.github__quarterly_metrics", "model.github.github__weekly_metrics", "test.github.not_null_github__daily_metrics_day.647e494434", "test.github.unique_github__daily_metrics_day.f98cab9456"], "model.github.github__issues": ["model.github.github__daily_metrics", "test.github.not_null_github__issues_issue_id.fed0631e25", "test.github.unique_github__issues_issue_id.6723b9b1db"], "model.github.int_github__pull_request_times": ["model.github.int_github__issue_joined"], "model.github.int_github__pull_request_reviewers": ["model.github.int_github__issue_joined"], "model.github.int_github__issue_label_joined": ["model.github.int_github__issue_labels"], "model.github.int_github__issue_joined": ["model.github.github__issues", "model.github.github__pull_requests"], "model.github.int_github__issue_labels": ["model.github.int_github__issue_joined"], "model.github.int_github__issue_assignees": ["model.github.int_github__issue_joined"], "model.github.int_github__issue_comments": ["model.github.int_github__issue_joined"], "model.github.int_github__issue_open_length": ["model.github.int_github__issue_joined"], "model.github.int_github__repository_teams": ["model.github.int_github__issue_joined"], "model.github_source.stg_github__issue_comment": ["model.github.int_github__issue_comments", "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f", "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a"], "model.github_source.stg_github__requested_reviewer_history": ["model.github.int_github__pull_request_times"], "model.github_source.stg_github__issue_label": ["model.github.int_github__issue_label_joined"], "model.github_source.stg_github__issue_merged": ["model.github.int_github__pull_request_times"], "model.github_source.stg_github__issue_closed_history": ["model.github.int_github__issue_open_length", "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d"], "model.github_source.stg_github__issue_assignee": ["model.github.int_github__issue_assignees", "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4"], "model.github_source.stg_github__repository": ["model.github.int_github__repository_teams", "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f", "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d"], "model.github_source.stg_github__user": ["model.github.int_github__issue_assignees", "model.github.int_github__issue_joined", "model.github.int_github__pull_request_reviewers", "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b", "test.github_source.unique_stg_github__user_user_id.5c1a00cd90"], "model.github_source.stg_github__pull_request_review": ["model.github.int_github__pull_request_reviewers", "model.github.int_github__pull_request_times", "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790", "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508"], "model.github_source.stg_github__repo_team": ["model.github.int_github__repository_teams", "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503", "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c"], "model.github_source.stg_github__label": ["model.github.int_github__issue_label_joined", "test.github_source.not_null_stg_github__label_label_id.9f07379974", "test.github_source.unique_stg_github__label_label_id.74d3c21466"], "model.github_source.stg_github__issue": ["model.github.int_github__issue_joined", "model.github.int_github__issue_open_length", "model.github.int_github__pull_request_times", "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7", "test.github_source.unique_stg_github__issue_issue_id.84891aeece"], "model.github_source.stg_github__team": ["model.github.int_github__repository_teams", "test.github_source.not_null_stg_github__team_team_id.440aefe7a7", "test.github_source.unique_stg_github__team_team_id.94e9716ab4"], "model.github_source.stg_github__pull_request": ["model.github.int_github__issue_joined", "model.github.int_github__pull_request_times", "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71", "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa"], "model.github_source.stg_github__repository_tmp": ["model.github_source.stg_github__repository", "model.github_source.stg_github__repository"], "model.github_source.stg_github__label_tmp": ["model.github_source.stg_github__label", "model.github_source.stg_github__label"], "model.github_source.stg_github__requested_reviewer_history_tmp": ["model.github_source.stg_github__requested_reviewer_history", "model.github_source.stg_github__requested_reviewer_history"], "model.github_source.stg_github__issue_comment_tmp": ["model.github_source.stg_github__issue_comment", "model.github_source.stg_github__issue_comment"], "model.github_source.stg_github__pull_request_review_tmp": ["model.github_source.stg_github__pull_request_review", "model.github_source.stg_github__pull_request_review"], "model.github_source.stg_github__issue_label_tmp": ["model.github_source.stg_github__issue_label", "model.github_source.stg_github__issue_label"], "model.github_source.stg_github__team_tmp": ["model.github_source.stg_github__team", "model.github_source.stg_github__team"], "model.github_source.stg_github__pull_request_tmp": ["model.github_source.stg_github__pull_request", "model.github_source.stg_github__pull_request"], "model.github_source.stg_github__issue_merged_tmp": ["model.github_source.stg_github__issue_merged", "model.github_source.stg_github__issue_merged"], "model.github_source.stg_github__user_tmp": ["model.github_source.stg_github__user", "model.github_source.stg_github__user"], "model.github_source.stg_github__issue_closed_history_tmp": ["model.github_source.stg_github__issue_closed_history", "model.github_source.stg_github__issue_closed_history"], "model.github_source.stg_github__issue_assignee_tmp": ["model.github_source.stg_github__issue_assignee", "model.github_source.stg_github__issue_assignee"], "model.github_source.stg_github__issue_tmp": ["model.github_source.stg_github__issue", "model.github_source.stg_github__issue"], "model.github_source.stg_github__repo_team_tmp": ["model.github_source.stg_github__repo_team", "model.github_source.stg_github__repo_team"], "test.github.unique_github__issues_issue_id.6723b9b1db": [], "test.github.not_null_github__issues_issue_id.fed0631e25": [], "test.github.unique_github__pull_requests_issue_id.ce23997907": [], "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f": [], "test.github.unique_github__daily_metrics_day.f98cab9456": [], "test.github.not_null_github__daily_metrics_day.647e494434": [], "test.github.unique_github__weekly_metrics_week.6794858a8e": [], "test.github.not_null_github__weekly_metrics_week.4b0b928243": [], "test.github.unique_github__monthly_metrics_month.3076284fbb": [], "test.github.not_null_github__monthly_metrics_month.9e4fba84df": [], "test.github.unique_github__quarterly_metrics_quarter.9165a921c1": [], "test.github.not_null_github__quarterly_metrics_quarter.92394d46dc": [], "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4": [], "test.github_source.not_null_stg_github__label_label_id.9f07379974": [], "test.github_source.unique_stg_github__label_label_id.74d3c21466": [], "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d": [], "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a": [], "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f": [], "test.github_source.unique_stg_github__issue_issue_id.84891aeece": [], "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7": [], "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508": [], "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790": [], "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa": [], "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71": [], "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503": [], "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c": [], "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d": [], "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f": [], "test.github_source.unique_stg_github__team_team_id.94e9716ab4": [], "test.github_source.not_null_stg_github__team_team_id.440aefe7a7": [], "test.github_source.unique_stg_github__user_user_id.5c1a00cd90": [], "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b": [], "source.github_source.github.issue_assignee": ["model.github_source.stg_github__issue_assignee_tmp"], "source.github_source.github.label": ["model.github_source.stg_github__label_tmp"], "source.github_source.github.issue_closed_history": ["model.github_source.stg_github__issue_closed_history_tmp"], "source.github_source.github.issue_label": ["model.github_source.stg_github__issue_label_tmp"], "source.github_source.github.issue_comment": ["model.github_source.stg_github__issue_comment_tmp"], "source.github_source.github.issue_merged": ["model.github_source.stg_github__issue_merged_tmp"], "source.github_source.github.issue": ["model.github_source.stg_github__issue_tmp"], "source.github_source.github.pull_request_review": ["model.github_source.stg_github__pull_request_review_tmp"], "source.github_source.github.pull_request": ["model.github_source.stg_github__pull_request_tmp"], "source.github_source.github.repo_team": ["model.github_source.stg_github__repo_team_tmp"], "source.github_source.github.repository": ["model.github_source.stg_github__repository_tmp"], "source.github_source.github.requested_reviewer_history": ["model.github_source.stg_github__requested_reviewer_history_tmp"], "source.github_source.github.team": ["model.github_source.stg_github__team_tmp"], "source.github_source.github.user": ["model.github_source.stg_github__user_tmp"]}} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v7.json", "dbt_version": "1.3.0", "generated_at": "2022-12-19T20:25:26.416822Z", "invocation_id": "a5b4f899-7713-4d70-b134-5ae04769f65c", "env": {}, "project_id": "b4ed7eda1f97e936d48d60e52edb4717", "user_id": "8929baf0-9bc1-477e-9a57-eb8b0db4da62", "send_anonymous_usage_stats": true, "adapter_type": "postgres"}, "nodes": {"seed.github_integration_tests.github_pull_request_review_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "bigint", "submitted_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_pull_request_review_data"], "unique_id": "seed.github_integration_tests.github_pull_request_review_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_pull_request_review_data.csv", "original_file_path": "seeds/github_pull_request_review_data.csv", "name": "github_pull_request_review_data", "alias": "github_pull_request_review_data", "checksum": {"name": "sha256", "checksum": "4bdebf989d5e5d1bf41df343300be0a7e2a12f74b8148de6a97e75118edf0efa"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "submitted_at": "timestamp"}}, "created_at": 1671481511.693275, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"github_pull_request_review_data\""}, "seed.github_integration_tests.github_label_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "bigint"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_label_data"], "unique_id": "seed.github_integration_tests.github_label_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_label_data.csv", "original_file_path": "seeds/github_label_data.csv", "name": "github_label_data", "alias": "github_label_data", "checksum": {"name": "sha256", "checksum": "f47357ad7761ae8e671c889ce5e385f6916b78cb669dfc65f09bacea1ecafb1f"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "created_at": 1671481511.699039, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"github_label_data\""}, "seed.github_integration_tests.github_repository_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "created_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_repository_data"], "unique_id": "seed.github_integration_tests.github_repository_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_repository_data.csv", "original_file_path": "seeds/github_repository_data.csv", "name": "github_repository_data", "alias": "github_repository_data", "checksum": {"name": "sha256", "checksum": "78cd55c70468340db27d24a3fc299fc8c191129ca26ea80620a0d796a608a1a4"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"created_at": "timestamp"}}, "created_at": 1671481511.700276, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"github_repository_data\""}, "seed.github_integration_tests.github_issue_merged_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "merged_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_issue_merged_data"], "unique_id": "seed.github_integration_tests.github_issue_merged_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_issue_merged_data.csv", "original_file_path": "seeds/github_issue_merged_data.csv", "name": "github_issue_merged_data", "alias": "github_issue_merged_data", "checksum": {"name": "sha256", "checksum": "397efa928dca45bafbdc11219b3335265bd9a6cce1447c02e07c0bf53ddaba31"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"merged_at": "timestamp"}}, "created_at": 1671481511.7017899, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"github_issue_merged_data\""}, "seed.github_integration_tests.github_issue_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "closed_at": "timestamp", "created_at": "timestamp", "updated_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_issue_data"], "unique_id": "seed.github_integration_tests.github_issue_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_issue_data.csv", "original_file_path": "seeds/github_issue_data.csv", "name": "github_issue_data", "alias": "github_issue_data", "checksum": {"name": "sha256", "checksum": "6eabcc9bc0920d64775f8058446b279e803384a2205f18a07d7a2f1ebcf89286"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"closed_at": "timestamp", "created_at": "timestamp", "updated_at": "timestamp"}}, "created_at": 1671481511.703299, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"github_issue_data\""}, "seed.github_integration_tests.github_repo_team_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_repo_team_data"], "unique_id": "seed.github_integration_tests.github_repo_team_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_repo_team_data.csv", "original_file_path": "seeds/github_repo_team_data.csv", "name": "github_repo_team_data", "alias": "github_repo_team_data", "checksum": {"name": "sha256", "checksum": "3a16bf772f5f15231f0d7e26c116041543fad5a9dbdabbdfec30ddd063058722"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1671481511.704549, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"github_repo_team_data\""}, "seed.github_integration_tests.github_requested_reviewer_history_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "created_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_requested_reviewer_history_data"], "unique_id": "seed.github_integration_tests.github_requested_reviewer_history_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_requested_reviewer_history_data.csv", "original_file_path": "seeds/github_requested_reviewer_history_data.csv", "name": "github_requested_reviewer_history_data", "alias": "github_requested_reviewer_history_data", "checksum": {"name": "sha256", "checksum": "91225ac95874fc314f772530dfcb6ece74f35c292ea5bba53ff86b599b902743"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"created_at": "timestamp"}}, "created_at": 1671481511.705796, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"github_requested_reviewer_history_data\""}, "seed.github_integration_tests.github_issue_label_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "issue_id": "bigint", "label_id": "bigint"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_issue_label_data"], "unique_id": "seed.github_integration_tests.github_issue_label_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_issue_label_data.csv", "original_file_path": "seeds/github_issue_label_data.csv", "name": "github_issue_label_data", "alias": "github_issue_label_data", "checksum": {"name": "sha256", "checksum": "847ef3245b5610a81f3d8e91b4787d24829b2b0d3d064c529a61d430e90f0585"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"issue_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}", "label_id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "created_at": 1671481511.7070122, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"github_issue_label_data\""}, "seed.github_integration_tests.github_issue_comment_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "id": "bigint"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_issue_comment_data"], "unique_id": "seed.github_integration_tests.github_issue_comment_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_issue_comment_data.csv", "original_file_path": "seeds/github_issue_comment_data.csv", "name": "github_issue_comment_data", "alias": "github_issue_comment_data", "checksum": {"name": "sha256", "checksum": "6cc173c061308bc4de703c7c5d0fc30228b2c86117ed7db1daf9decf1a4238cd"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"id": "{%- if target.type == 'bigquery' -%} INT64 {%- else -%} bigint {%- endif -%}"}}, "created_at": 1671481511.7083259, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"github_issue_comment_data\""}, "seed.github_integration_tests.github_issue_assignee_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_issue_assignee_data"], "unique_id": "seed.github_integration_tests.github_issue_assignee_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_issue_assignee_data.csv", "original_file_path": "seeds/github_issue_assignee_data.csv", "name": "github_issue_assignee_data", "alias": "github_issue_assignee_data", "checksum": {"name": "sha256", "checksum": "fe25fadc4593349b873b50da5e2e2fbf436cbb3c1bcfe325c3340c64a7d8972b"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1671481511.7095082, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"github_issue_assignee_data\""}, "seed.github_integration_tests.github_issue_closed_history_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "updated_at": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_issue_closed_history_data"], "unique_id": "seed.github_integration_tests.github_issue_closed_history_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_issue_closed_history_data.csv", "original_file_path": "seeds/github_issue_closed_history_data.csv", "name": "github_issue_closed_history_data", "alias": "github_issue_closed_history_data", "checksum": {"name": "sha256", "checksum": "5f281ce9e29e69280633dc6aae2e9f8028c86815442821a608bb793c82aab3f1"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"updated_at": "timestamp"}}, "created_at": 1671481511.710711, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"github_issue_closed_history_data\""}, "seed.github_integration_tests.github_pull_request_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_pull_request_data"], "unique_id": "seed.github_integration_tests.github_pull_request_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_pull_request_data.csv", "original_file_path": "seeds/github_pull_request_data.csv", "name": "github_pull_request_data", "alias": "github_pull_request_data", "checksum": {"name": "sha256", "checksum": "1e27d3e9b6881a3fda6402b048071032411d81612ff4b2009d852a194b137006"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1671481511.712058, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"github_pull_request_data\""}, "seed.github_integration_tests.github_team_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_team_data"], "unique_id": "seed.github_integration_tests.github_team_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_team_data.csv", "original_file_path": "seeds/github_team_data.csv", "name": "github_team_data", "alias": "github_team_data", "checksum": {"name": "sha256", "checksum": "a3916608387192c2bcec219067bd19e3280a23a3d4f546390e5d7e9aa16420bd"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1671481511.713238, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"github_team_data\""}, "seed.github_integration_tests.github_user_data": {"compiled": true, "resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"_fivetran_synced": "timestamp"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": false, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_integration_tests", "github_user_data"], "unique_id": "seed.github_integration_tests.github_user_data", "raw_code": "", "language": "sql", "package_name": "github_integration_tests", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests", "path": "github_user_data.csv", "original_file_path": "seeds/github_user_data.csv", "name": "github_user_data", "alias": "github_user_data", "checksum": {"name": "sha256", "checksum": "5d101839c6a685fac17231a071c6516f3ac668b133d7a96a83d97ede20f16e46"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"quote_columns": "{{ true if target.type == 'redshift' else false }}", "column_types": {"_fivetran_synced": "timestamp"}}, "created_at": 1671481511.7143931, "compiled_code": "", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"github_user_data\""}, "model.github.github__weekly_metrics": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.date_trunc"], "nodes": ["model.github.github__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github", "github__weekly_metrics"], "unique_id": "model.github.github__weekly_metrics", "raw_code": "with daily_metrics as (\n select *\n from {{ ref('github__daily_metrics') }}\n)\n\nselect \n {{ dbt.date_trunc('week', 'day') }} as week, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "language": "sql", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__weekly_metrics.sql", "original_file_path": "models/github__weekly_metrics.sql", "name": "github__weekly_metrics", "alias": "github__weekly_metrics", "checksum": {"name": "sha256", "checksum": "0c23e13d9ae5aa9256b832965069a021826131bbcf8c23be244b660d1a513870"}, "tags": [], "refs": [["github__daily_metrics"]], "sources": [], "metrics": [], "description": "Summary numbers for issues and pull requests by week\n", "columns": {"week": {"name": "week", "description": "The reporting week", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_opened": {"name": "number_issues_opened", "description": "The total number of issues created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_closed": {"name": "number_issues_closed", "description": "The total number of issues closed during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_issue_open": {"name": "avg_days_issue_open", "description": "The average number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_issue_open": {"name": "longest_days_issue_open", "description": "The longest number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_opened": {"name": "number_prs_opened", "description": "The total number of pull requests created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_merged": {"name": "number_prs_merged", "description": "The total number of pull requests merged during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_closed_without_merge": {"name": "number_prs_closed_without_merge", "description": "The total number of pull requests closed without a merge during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_pr_open": {"name": "avg_days_pr_open", "description": "The average number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_pr_open": {"name": "longest_days_pr_open", "description": "The longest number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__weekly_metrics.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1671481512.0312262, "compiled_code": "with daily_metrics as (\n select *\n from \"postgres\".\"github_integration_tests\".\"github__daily_metrics\"\n)\n\nselect \n date_trunc('week', day) as week, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"github__weekly_metrics\""}, "model.github.github__monthly_metrics": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.date_trunc"], "nodes": ["model.github.github__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github", "github__monthly_metrics"], "unique_id": "model.github.github__monthly_metrics", "raw_code": "with daily_metrics as (\n select *\n from {{ ref('github__daily_metrics') }}\n)\n\nselect \n {{ dbt.date_trunc('month', 'day') }} as month, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "language": "sql", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__monthly_metrics.sql", "original_file_path": "models/github__monthly_metrics.sql", "name": "github__monthly_metrics", "alias": "github__monthly_metrics", "checksum": {"name": "sha256", "checksum": "13125ad4966c9d1caa3cd74e6174cc3845a7ceb7929836e849e70628af2b0d0d"}, "tags": [], "refs": [["github__daily_metrics"]], "sources": [], "metrics": [], "description": "Summary numbers for issues and pull requests by month\n", "columns": {"month": {"name": "month", "description": "The reporting month", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_opened": {"name": "number_issues_opened", "description": "The total number of issues created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_closed": {"name": "number_issues_closed", "description": "The total number of issues closed during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_issue_open": {"name": "avg_days_issue_open", "description": "The average number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_issue_open": {"name": "longest_days_issue_open", "description": "The longest number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_opened": {"name": "number_prs_opened", "description": "The total number of pull requests created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_merged": {"name": "number_prs_merged", "description": "The total number of pull requests merged during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_closed_without_merge": {"name": "number_prs_closed_without_merge", "description": "The total number of pull requests closed without a merge during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_pr_open": {"name": "avg_days_pr_open", "description": "The average number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_pr_open": {"name": "longest_days_pr_open", "description": "The longest number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__monthly_metrics.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1671481512.033462, "compiled_code": "with daily_metrics as (\n select *\n from \"postgres\".\"github_integration_tests\".\"github__daily_metrics\"\n)\n\nselect \n date_trunc('month', day) as month, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"github__monthly_metrics\""}, "model.github.github__quarterly_metrics": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.date_trunc"], "nodes": ["model.github.github__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github", "github__quarterly_metrics"], "unique_id": "model.github.github__quarterly_metrics", "raw_code": "with daily_metrics as (\n select *\n from {{ ref('github__daily_metrics') }}\n)\n\nselect \n {{ dbt.date_trunc('quarter', 'day') }} as quarter, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\n\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "language": "sql", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__quarterly_metrics.sql", "original_file_path": "models/github__quarterly_metrics.sql", "name": "github__quarterly_metrics", "alias": "github__quarterly_metrics", "checksum": {"name": "sha256", "checksum": "482a40e9b5ae8283bec98905910cc35747f7f98accd058453d69064844533c50"}, "tags": [], "refs": [["github__daily_metrics"]], "sources": [], "metrics": [], "description": "Summary numbers for issues and pull requests by quarter\n", "columns": {"quarter": {"name": "quarter", "description": "The reporting quarter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_opened": {"name": "number_issues_opened", "description": "The total number of issues created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_closed": {"name": "number_issues_closed", "description": "The total number of issues closed during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_issue_open": {"name": "avg_days_issue_open", "description": "The average number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_issue_open": {"name": "longest_days_issue_open", "description": "The longest number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_opened": {"name": "number_prs_opened", "description": "The total number of pull requests created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_merged": {"name": "number_prs_merged", "description": "The total number of pull requests merged during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_closed_without_merge": {"name": "number_prs_closed_without_merge", "description": "The total number of pull requests closed without a merge during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "avg_days_pr_open": {"name": "avg_days_pr_open", "description": "The average number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_pr_open": {"name": "longest_days_pr_open", "description": "The longest number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__quarterly_metrics.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1671481512.0350988, "compiled_code": "with daily_metrics as (\n select *\n from \"postgres\".\"github_integration_tests\".\"github__daily_metrics\"\n)\n\nselect \n date_trunc('quarter', day) as quarter, \n sum(number_issues_opened) as number_issues_opened,\n sum(number_issues_closed) as number_issues_closed,\n sum(sum_days_issue_open) / sum(number_issues_opened) as avg_days_issue_open,\n max(longest_days_issue_open) as longest_days_issue_open,\n sum(number_prs_opened) as number_prs_opened,\n sum(number_prs_merged) as number_prs_merged,\n sum(number_prs_closed_without_merge) as number_prs_closed_without_merge,\n sum(sum_days_pr_open) / sum(number_prs_opened) as avg_days_pr_open,\n max(longest_days_pr_open) as longest_days_pr_open\n\nfrom daily_metrics \ngroup by 1\norder by 1 desc", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"github__quarterly_metrics\""}, "model.github.github__pull_requests": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.github.int_github__issue_joined"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github", "github__pull_requests"], "unique_id": "model.github.github__pull_requests", "raw_code": "with issue_joined as (\n select *\n from {{ ref('int_github__issue_joined') }} \n)\n\nselect\n *\nfrom issue_joined\nwhere is_pull_request", "language": "sql", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__pull_requests.sql", "original_file_path": "models/github__pull_requests.sql", "name": "github__pull_requests", "alias": "github__pull_requests", "checksum": {"name": "sha256", "checksum": "ab4761ae05c0aabc7585d92ed7c68e12b53317a47a4278810e1777a051f43350"}, "tags": [], "refs": [["int_github__issue_joined"]], "sources": [], "metrics": [], "description": "Basic information about pull_requests as well as additional fields about reviews and time between actions\n", "columns": {"issue_id": {"name": "issue_id", "description": "The unique ID of an issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "body": {"name": "body", "description": "the text body of the description of the pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed_at": {"name": "closed_at", "description": "Timestamp of when the pull request was closed. NULL for pull requests that are still open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the pull request was created", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_locked": {"name": "is_locked", "description": "Boolean indicating whether the issue is locked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "milestone_id": {"name": "milestone_id", "description": "Foreign key that references the milestone.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_pull_request": {"name": "is_pull_request", "description": "Boolean indiciating whether the issue is a pull request.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_number": {"name": "issue_number", "description": "The number of the pull request. Unique within a repository, but not accross.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_id": {"name": "repository_id", "description": "Foreign key that references the repository table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the issue was last updated", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "days_issue_open": {"name": "days_issue_open", "description": "The number of days an issue has been open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_times_reopened": {"name": "number_of_times_reopened", "description": "Total number of times the issue was reopened", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_comments": {"name": "number_of_comments", "description": "The total number of comments included in the issue", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_login_name": {"name": "creator_login_name", "description": "User that created the issue login name", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_name": {"name": "creator_name", "description": "User that created the issue name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_company": {"name": "creator_company", "description": "User that created the issue company name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the pull request is open or closed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url_link": {"name": "url_link", "description": "A link to the pull request on github.com", "meta": {}, "data_type": null, "quote": null, "tags": []}, "labels": {"name": "labels", "description": "The labels currently applied to the pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository": {"name": "repository", "description": "The repository that the pull request applies to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_team_names": {"name": "repository_team_names", "description": "An aggreate of the teams associated with the repository", "meta": {}, "data_type": null, "quote": null, "tags": []}, "assignees": {"name": "assignees", "description": "Users who have been assigned to the pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hours_request_review_to_first_review": {"name": "hours_request_review_to_first_review", "description": "Number of hours between the first request for review and a review", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hours_request_review_to_first_action": {"name": "hours_request_review_to_first_action", "description": "Number of hours between the first request for review and any action besides dismissing the request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hours_request_review_to_merge": {"name": "hours_request_review_to_merge", "description": "Number of hours between the first request for review and the pull request being merged", "meta": {}, "data_type": null, "quote": null, "tags": []}, "merged_at": {"name": "merged_at", "description": "Timestamp of when the pull request was merged", "meta": {}, "data_type": null, "quote": null, "tags": []}, "reviewers": {"name": "reviewers", "description": "List of Users who reviewed the pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_reviews": {"name": "number_of_reviews", "description": "Number of times a pull request was reviewed", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__pull_requests.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1671481512.0272708, "compiled_code": "with __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_label\"\n\n), label as (\n\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__label\"\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n), __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n), __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__repository\"\n),\n\nrepo_teams as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__repo_team\"\n),\n\nteams as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__team\"\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n), __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_assignee\"\n), \n\ngithub_user as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__user\"\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n), __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue\"\n), \n\nissue_closed_history as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_closed_history\"\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), \n current_timestamp::TIMESTAMP\n) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n (\n (\n (\n ((valid_until)::date - (valid_starting)::date)\n * 24 + date_part('hour', (valid_until)::timestamp) - date_part('hour', (valid_starting)::timestamp))\n * 60 + date_part('minute', (valid_until)::timestamp) - date_part('minute', (valid_starting)::timestamp))\n * 60 + floor(date_part('second', (valid_until)::timestamp)) - floor(date_part('second', (valid_starting)::timestamp)))\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n), __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_comment\"\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n), __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__pull_request_review\"\n), \n\npull_request as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__pull_request\"\n), \n\nrequested_reviewer_history as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__requested_reviewer_history\"\n where not removed\n), \n\nissue as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue\"\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_merged\"\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n (\n (\n (\n ((coalesce(time_of_first_review_post_request, \n current_timestamp::TIMESTAMP\n))::date - (time_of_first_request)::date)\n * 24 + date_part('hour', (coalesce(time_of_first_review_post_request, \n current_timestamp::TIMESTAMP\n))::timestamp) - date_part('hour', (time_of_first_request)::timestamp))\n * 60 + date_part('minute', (coalesce(time_of_first_review_post_request, \n current_timestamp::TIMESTAMP\n))::timestamp) - date_part('minute', (time_of_first_request)::timestamp))\n * 60 + floor(date_part('second', (coalesce(time_of_first_review_post_request, \n current_timestamp::TIMESTAMP\n))::timestamp)) - floor(date_part('second', (time_of_first_request)::timestamp)))\n / 60/60 as hours_request_review_to_first_review,\n \n (\n (\n (\n ((least(\n coalesce(time_of_first_requested_reviewer_review, \n current_timestamp::TIMESTAMP\n),\n coalesce(issue.closed_at, \n current_timestamp::TIMESTAMP\n)))::date - (time_of_first_request)::date)\n * 24 + date_part('hour', (least(\n coalesce(time_of_first_requested_reviewer_review, \n current_timestamp::TIMESTAMP\n),\n coalesce(issue.closed_at, \n current_timestamp::TIMESTAMP\n)))::timestamp) - date_part('hour', (time_of_first_request)::timestamp))\n * 60 + date_part('minute', (least(\n coalesce(time_of_first_requested_reviewer_review, \n current_timestamp::TIMESTAMP\n),\n coalesce(issue.closed_at, \n current_timestamp::TIMESTAMP\n)))::timestamp) - date_part('minute', (time_of_first_request)::timestamp))\n * 60 + floor(date_part('second', (least(\n coalesce(time_of_first_requested_reviewer_review, \n current_timestamp::TIMESTAMP\n),\n coalesce(issue.closed_at, \n current_timestamp::TIMESTAMP\n)))::timestamp)) - floor(date_part('second', (time_of_first_request)::timestamp)))\n / 60/60 as hours_request_review_to_first_action,\n \n (\n (\n (\n ((merged_at)::date - (time_of_first_request)::date)\n * 24 + date_part('hour', (merged_at)::timestamp) - date_part('hour', (time_of_first_request)::timestamp))\n * 60 + date_part('minute', (merged_at)::timestamp) - date_part('minute', (time_of_first_request)::timestamp))\n * 60 + floor(date_part('second', (merged_at)::timestamp)) - floor(date_part('second', (time_of_first_request)::timestamp)))\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n), __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__pull_request_review\"\n), \n\ngithub_user as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__user\"\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n), __dbt__cte__int_github__issue_joined as (\nwith issue as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue\"\n), \n\nissue_labels as (\n select *\n from __dbt__cte__int_github__issue_labels\n), \n\nrepository_teams as (\n select \n \n *\n from __dbt__cte__int_github__repository_teams\n\n \n), \n\nissue_assignees as (\n select *\n from __dbt__cte__int_github__issue_assignees\n), \n\nissue_open_length as (\n select *\n from __dbt__cte__int_github__issue_open_length\n), \n\nissue_comments as (\n select *\n from __dbt__cte__int_github__issue_comments\n), \n\ncreator as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__user\"\n), \n\npull_request_times as (\n select *\n from __dbt__cte__int_github__pull_request_times\n), \n\npull_request_reviewers as (\n select *\n from __dbt__cte__int_github__pull_request_reviewers\n), \n\npull_request as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__pull_request\"\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then 'https://github.com/' || repository_teams.repository || '/pull/' || issue.issue_number\n else 'https://github.com/' || repository_teams.repository || '/issues/' || issue.issue_number\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n \n repository_teams.repository_team_names,\n \n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id\n),issue_joined as (\n select *\n from __dbt__cte__int_github__issue_joined \n)\n\nselect\n *\nfrom issue_joined\nwhere is_pull_request", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.github.int_github__issue_label_joined", "sql": " __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_label\"\n\n), label as (\n\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__label\"\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n)"}, {"id": "model.github.int_github__issue_labels", "sql": " __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n)"}, {"id": "model.github.int_github__repository_teams", "sql": " __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__repository\"\n),\n\nrepo_teams as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__repo_team\"\n),\n\nteams as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__team\"\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n)"}, {"id": "model.github.int_github__issue_assignees", "sql": " __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_assignee\"\n), \n\ngithub_user as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__user\"\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n)"}, {"id": "model.github.int_github__issue_open_length", "sql": " __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue\"\n), \n\nissue_closed_history as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_closed_history\"\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), \n current_timestamp::TIMESTAMP\n) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n (\n (\n (\n ((valid_until)::date - (valid_starting)::date)\n * 24 + date_part('hour', (valid_until)::timestamp) - date_part('hour', (valid_starting)::timestamp))\n * 60 + date_part('minute', (valid_until)::timestamp) - date_part('minute', (valid_starting)::timestamp))\n * 60 + floor(date_part('second', (valid_until)::timestamp)) - floor(date_part('second', (valid_starting)::timestamp)))\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n)"}, {"id": "model.github.int_github__issue_comments", "sql": " __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_comment\"\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n)"}, {"id": "model.github.int_github__pull_request_times", "sql": " __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__pull_request_review\"\n), \n\npull_request as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__pull_request\"\n), \n\nrequested_reviewer_history as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__requested_reviewer_history\"\n where not removed\n), \n\nissue as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue\"\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_merged\"\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n (\n (\n (\n ((coalesce(time_of_first_review_post_request, \n current_timestamp::TIMESTAMP\n))::date - (time_of_first_request)::date)\n * 24 + date_part('hour', (coalesce(time_of_first_review_post_request, \n current_timestamp::TIMESTAMP\n))::timestamp) - date_part('hour', (time_of_first_request)::timestamp))\n * 60 + date_part('minute', (coalesce(time_of_first_review_post_request, \n current_timestamp::TIMESTAMP\n))::timestamp) - date_part('minute', (time_of_first_request)::timestamp))\n * 60 + floor(date_part('second', (coalesce(time_of_first_review_post_request, \n current_timestamp::TIMESTAMP\n))::timestamp)) - floor(date_part('second', (time_of_first_request)::timestamp)))\n / 60/60 as hours_request_review_to_first_review,\n \n (\n (\n (\n ((least(\n coalesce(time_of_first_requested_reviewer_review, \n current_timestamp::TIMESTAMP\n),\n coalesce(issue.closed_at, \n current_timestamp::TIMESTAMP\n)))::date - (time_of_first_request)::date)\n * 24 + date_part('hour', (least(\n coalesce(time_of_first_requested_reviewer_review, \n current_timestamp::TIMESTAMP\n),\n coalesce(issue.closed_at, \n current_timestamp::TIMESTAMP\n)))::timestamp) - date_part('hour', (time_of_first_request)::timestamp))\n * 60 + date_part('minute', (least(\n coalesce(time_of_first_requested_reviewer_review, \n current_timestamp::TIMESTAMP\n),\n coalesce(issue.closed_at, \n current_timestamp::TIMESTAMP\n)))::timestamp) - date_part('minute', (time_of_first_request)::timestamp))\n * 60 + floor(date_part('second', (least(\n coalesce(time_of_first_requested_reviewer_review, \n current_timestamp::TIMESTAMP\n),\n coalesce(issue.closed_at, \n current_timestamp::TIMESTAMP\n)))::timestamp)) - floor(date_part('second', (time_of_first_request)::timestamp)))\n / 60/60 as hours_request_review_to_first_action,\n \n (\n (\n (\n ((merged_at)::date - (time_of_first_request)::date)\n * 24 + date_part('hour', (merged_at)::timestamp) - date_part('hour', (time_of_first_request)::timestamp))\n * 60 + date_part('minute', (merged_at)::timestamp) - date_part('minute', (time_of_first_request)::timestamp))\n * 60 + floor(date_part('second', (merged_at)::timestamp)) - floor(date_part('second', (time_of_first_request)::timestamp)))\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n)"}, {"id": "model.github.int_github__pull_request_reviewers", "sql": " __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__pull_request_review\"\n), \n\ngithub_user as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__user\"\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n)"}, {"id": "model.github.int_github__issue_joined", "sql": " __dbt__cte__int_github__issue_joined as (\nwith issue as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue\"\n), \n\nissue_labels as (\n select *\n from __dbt__cte__int_github__issue_labels\n), \n\nrepository_teams as (\n select \n \n *\n from __dbt__cte__int_github__repository_teams\n\n \n), \n\nissue_assignees as (\n select *\n from __dbt__cte__int_github__issue_assignees\n), \n\nissue_open_length as (\n select *\n from __dbt__cte__int_github__issue_open_length\n), \n\nissue_comments as (\n select *\n from __dbt__cte__int_github__issue_comments\n), \n\ncreator as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__user\"\n), \n\npull_request_times as (\n select *\n from __dbt__cte__int_github__pull_request_times\n), \n\npull_request_reviewers as (\n select *\n from __dbt__cte__int_github__pull_request_reviewers\n), \n\npull_request as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__pull_request\"\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then 'https://github.com/' || repository_teams.repository || '/pull/' || issue.issue_number\n else 'https://github.com/' || repository_teams.repository || '/issues/' || issue.issue_number\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n \n repository_teams.repository_team_names,\n \n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id\n)"}], "relation_name": "\"postgres\".\"github_integration_tests\".\"github__pull_requests\""}, "model.github.github__daily_metrics": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.date_trunc"], "nodes": ["model.github.github__issues", "model.github.github__pull_requests"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github", "github__daily_metrics"], "unique_id": "model.github.github__daily_metrics", "raw_code": "with github_issues as (\n select *\n from {{ ref('github__issues') }}\n), \n\npull_requests as (\n select *\n from {{ ref('github__pull_requests') }}\n), \n\nissues_opened_per_day as (\n select \n {{ dbt.date_trunc('day', 'created_at') }} as day, \n count(*) as number_issues_opened,\n sum(days_issue_open) as sum_days_issue_open,\n max(days_issue_open) as longest_days_issue_open\n from github_issues\n group by 1\n), \n\nissues_closed_per_day as (\n select \n {{ dbt.date_trunc('day', 'closed_at') }} as day, \n count(*) as number_issues_closed\n from github_issues\n where closed_at is not null\n group by 1\n), \n\nprs_opened_per_day as (\n select \n {{ dbt.date_trunc('day', 'created_at') }} as day, \n count(*) as number_prs_opened,\n sum(days_issue_open) as sum_days_pr_open,\n max(days_issue_open) as longest_days_pr_open\n from pull_requests\n group by 1\n), \n\nprs_merged_per_day as (\n select \n {{ dbt.date_trunc('day', 'merged_at') }} as day, \n count(*) as number_prs_merged\n from pull_requests\n where merged_at is not null\n group by 1\n), \n\nprs_closed_without_merge_per_day as (\n select \n {{ dbt.date_trunc('day', 'closed_at') }} as day, \n count(*) as number_prs_closed_without_merge\n from pull_requests\n where closed_at is not null\n and merged_at is null\n group by 1\n), \n\nissues_per_day as (\n select \n coalesce(issues_opened_per_day.day, \n issues_closed_per_day.day\n ) as day,\n number_issues_opened,\n number_issues_closed, \n sum_days_issue_open,\n longest_days_issue_open\n from issues_opened_per_day\n full outer join issues_closed_per_day on issues_opened_per_day.day = issues_closed_per_day.day\n), \n\nprs_per_day as (\n select \n coalesce(prs_opened_per_day.day, \n prs_merged_per_day.day,\n prs_closed_without_merge_per_day.day\n ) as day,\n number_prs_opened,\n number_prs_merged,\n number_prs_closed_without_merge,\n sum_days_pr_open,\n longest_days_pr_open\n from prs_opened_per_day\n full outer join prs_merged_per_day on prs_opened_per_day.day = prs_merged_per_day.day\n full outer join prs_closed_without_merge_per_day on coalesce(prs_opened_per_day.day, prs_merged_per_day.day) = prs_closed_without_merge_per_day.day\n)\n\nselect \n coalesce(issues_per_day.day, prs_per_day.day) as day,\n coalesce(number_issues_opened, 0) as number_issues_opened,\n coalesce(number_issues_closed, 0) as number_issues_closed,\n sum_days_issue_open,\n longest_days_issue_open,\n coalesce(number_prs_opened, 0) as number_prs_opened,\n coalesce(number_prs_merged, 0) as number_prs_merged,\n coalesce(number_prs_closed_without_merge, 0) as number_prs_closed_without_merge,\n sum_days_pr_open,\n longest_days_pr_open\nfrom issues_per_day \nfull outer join prs_per_day on issues_per_day.day = prs_per_day.day\norder by day desc", "language": "sql", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__daily_metrics.sql", "original_file_path": "models/github__daily_metrics.sql", "name": "github__daily_metrics", "alias": "github__daily_metrics", "checksum": {"name": "sha256", "checksum": "a6ee3eb9c8198f8b11e48b8e0206e90860a02af8a20f748985a58499dde4f476"}, "tags": [], "refs": [["github__issues"], ["github__pull_requests"]], "sources": [], "metrics": [], "description": "Summary numbers for issues and pull requests by day\n", "columns": {"day": {"name": "day", "description": "The reporting day", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_opened": {"name": "number_issues_opened", "description": "The total number of issues created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_issues_closed": {"name": "number_issues_closed", "description": "The total number of issues closed during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sum_days_issue_open": {"name": "sum_days_issue_open", "description": "The total number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_issue_open": {"name": "longest_days_issue_open", "description": "The longest number of days an issue opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_opened": {"name": "number_prs_opened", "description": "The total number of pull requests created during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_merged": {"name": "number_prs_merged", "description": "The total number of pull requests merged during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_prs_closed_without_merge": {"name": "number_prs_closed_without_merge", "description": "The total number of pull requests closed without a merge during this time period", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sum_days_pr_open": {"name": "sum_days_pr_open", "description": "The total number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longest_days_pr_open": {"name": "longest_days_pr_open", "description": "The longest number of days a pull request opened during this time period was open", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__daily_metrics.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1671481512.0292459, "compiled_code": "with github_issues as (\n select *\n from \"postgres\".\"github_integration_tests\".\"github__issues\"\n), \n\npull_requests as (\n select *\n from \"postgres\".\"github_integration_tests\".\"github__pull_requests\"\n), \n\nissues_opened_per_day as (\n select \n date_trunc('day', created_at) as day, \n count(*) as number_issues_opened,\n sum(days_issue_open) as sum_days_issue_open,\n max(days_issue_open) as longest_days_issue_open\n from github_issues\n group by 1\n), \n\nissues_closed_per_day as (\n select \n date_trunc('day', closed_at) as day, \n count(*) as number_issues_closed\n from github_issues\n where closed_at is not null\n group by 1\n), \n\nprs_opened_per_day as (\n select \n date_trunc('day', created_at) as day, \n count(*) as number_prs_opened,\n sum(days_issue_open) as sum_days_pr_open,\n max(days_issue_open) as longest_days_pr_open\n from pull_requests\n group by 1\n), \n\nprs_merged_per_day as (\n select \n date_trunc('day', merged_at) as day, \n count(*) as number_prs_merged\n from pull_requests\n where merged_at is not null\n group by 1\n), \n\nprs_closed_without_merge_per_day as (\n select \n date_trunc('day', closed_at) as day, \n count(*) as number_prs_closed_without_merge\n from pull_requests\n where closed_at is not null\n and merged_at is null\n group by 1\n), \n\nissues_per_day as (\n select \n coalesce(issues_opened_per_day.day, \n issues_closed_per_day.day\n ) as day,\n number_issues_opened,\n number_issues_closed, \n sum_days_issue_open,\n longest_days_issue_open\n from issues_opened_per_day\n full outer join issues_closed_per_day on issues_opened_per_day.day = issues_closed_per_day.day\n), \n\nprs_per_day as (\n select \n coalesce(prs_opened_per_day.day, \n prs_merged_per_day.day,\n prs_closed_without_merge_per_day.day\n ) as day,\n number_prs_opened,\n number_prs_merged,\n number_prs_closed_without_merge,\n sum_days_pr_open,\n longest_days_pr_open\n from prs_opened_per_day\n full outer join prs_merged_per_day on prs_opened_per_day.day = prs_merged_per_day.day\n full outer join prs_closed_without_merge_per_day on coalesce(prs_opened_per_day.day, prs_merged_per_day.day) = prs_closed_without_merge_per_day.day\n)\n\nselect \n coalesce(issues_per_day.day, prs_per_day.day) as day,\n coalesce(number_issues_opened, 0) as number_issues_opened,\n coalesce(number_issues_closed, 0) as number_issues_closed,\n sum_days_issue_open,\n longest_days_issue_open,\n coalesce(number_prs_opened, 0) as number_prs_opened,\n coalesce(number_prs_merged, 0) as number_prs_merged,\n coalesce(number_prs_closed_without_merge, 0) as number_prs_closed_without_merge,\n sum_days_pr_open,\n longest_days_pr_open\nfrom issues_per_day \nfull outer join prs_per_day on issues_per_day.day = prs_per_day.day\norder by day desc", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"github__daily_metrics\""}, "model.github.github__issues": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.github.int_github__issue_joined"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github", "github__issues"], "unique_id": "model.github.github__issues", "raw_code": "with issue_joined as (\n select *\n from {{ ref('int_github__issue_joined') }} \n)\n\nselect\n issue_id,\n body,\n closed_at,\n created_at,\n is_locked,\n milestone_id,\n issue_number,\n is_pull_request,\n repository_id,\n state,\n title,\n updated_at,\n user_id,\n url_link,\n days_issue_open,\n number_of_times_reopened,\n labels,\n number_of_comments,\n repository,\n {% if var('github__using_repo_team', true) %}\n repository_team_names,\n {% endif %}\n assignees,\n creator_login_name,\n creator_name,\n creator_company\nfrom issue_joined\nwhere not is_pull_request", "language": "sql", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "github__issues.sql", "original_file_path": "models/github__issues.sql", "name": "github__issues", "alias": "github__issues", "checksum": {"name": "sha256", "checksum": "382d94f82ea63be958d53cc7353d6e3e792844f45ab9c48609e03355eb68a133"}, "tags": [], "refs": [["int_github__issue_joined"]], "sources": [], "metrics": [], "description": "Basic information about issues as well as additional fields for things like assignees, projects, labels and open time\n", "columns": {"issue_id": {"name": "issue_id", "description": "The unique ID of an issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "body": {"name": "body", "description": "The text body of the issue's main description", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed_at": {"name": "closed_at", "description": "The timestamp for when an issue was last closed. \"null\" for issues that are open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "The timestamp for when an issue was created", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_locked": {"name": "is_locked", "description": "Boolean indicating if the issue is locked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "milestone_id": {"name": "milestone_id", "description": "Foreign key that references the milestone table representing the current milestone the issue is in", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_number": {"name": "issue_number", "description": "The number of the issue. Is unique within a repository, but not accross", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_pull_request": {"name": "is_pull_request", "description": "Boolean indicating whether the issue is a pull request", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_id": {"name": "repository_id", "description": "Foreign key that references the repository table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the issue is open or closed", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "The title of the issue", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the issue was last updated", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url_link": {"name": "url_link", "description": "a link to the issue on github.com", "meta": {}, "data_type": null, "quote": null, "tags": []}, "days_issue_open": {"name": "days_issue_open", "description": "The number of days an issue has been open", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_times_reopened": {"name": "number_of_times_reopened", "description": "Total number of times the issue was reopened", "meta": {}, "data_type": null, "quote": null, "tags": []}, "labels": {"name": "labels", "description": "A list of the labels that are currently applied to the issue", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number_of_comments": {"name": "number_of_comments", "description": "The total number of comments included in the issue", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_login_name": {"name": "creator_login_name", "description": "User that created the issue login name", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_name": {"name": "creator_name", "description": "User that created the issue name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "creator_company": {"name": "creator_company", "description": "User that created the issue company name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository": {"name": "repository", "description": "The repository that the issue is applicable to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_team_names": {"name": "repository_team_names", "description": "An aggreate of the teams associated with the repository", "meta": {}, "data_type": null, "quote": null, "tags": []}, "assignees": {"name": "assignees", "description": "The current list of users assigned to the issue", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github://models/github.yml", "compiled_path": "target/compiled/github/models/github__issues.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1671481512.022203, "compiled_code": "with __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_label\"\n\n), label as (\n\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__label\"\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n), __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n), __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__repository\"\n),\n\nrepo_teams as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__repo_team\"\n),\n\nteams as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__team\"\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n), __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_assignee\"\n), \n\ngithub_user as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__user\"\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n), __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue\"\n), \n\nissue_closed_history as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_closed_history\"\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), \n current_timestamp::TIMESTAMP\n) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n (\n (\n (\n ((valid_until)::date - (valid_starting)::date)\n * 24 + date_part('hour', (valid_until)::timestamp) - date_part('hour', (valid_starting)::timestamp))\n * 60 + date_part('minute', (valid_until)::timestamp) - date_part('minute', (valid_starting)::timestamp))\n * 60 + floor(date_part('second', (valid_until)::timestamp)) - floor(date_part('second', (valid_starting)::timestamp)))\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n), __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_comment\"\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n), __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__pull_request_review\"\n), \n\npull_request as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__pull_request\"\n), \n\nrequested_reviewer_history as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__requested_reviewer_history\"\n where not removed\n), \n\nissue as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue\"\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_merged\"\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n (\n (\n (\n ((coalesce(time_of_first_review_post_request, \n current_timestamp::TIMESTAMP\n))::date - (time_of_first_request)::date)\n * 24 + date_part('hour', (coalesce(time_of_first_review_post_request, \n current_timestamp::TIMESTAMP\n))::timestamp) - date_part('hour', (time_of_first_request)::timestamp))\n * 60 + date_part('minute', (coalesce(time_of_first_review_post_request, \n current_timestamp::TIMESTAMP\n))::timestamp) - date_part('minute', (time_of_first_request)::timestamp))\n * 60 + floor(date_part('second', (coalesce(time_of_first_review_post_request, \n current_timestamp::TIMESTAMP\n))::timestamp)) - floor(date_part('second', (time_of_first_request)::timestamp)))\n / 60/60 as hours_request_review_to_first_review,\n \n (\n (\n (\n ((least(\n coalesce(time_of_first_requested_reviewer_review, \n current_timestamp::TIMESTAMP\n),\n coalesce(issue.closed_at, \n current_timestamp::TIMESTAMP\n)))::date - (time_of_first_request)::date)\n * 24 + date_part('hour', (least(\n coalesce(time_of_first_requested_reviewer_review, \n current_timestamp::TIMESTAMP\n),\n coalesce(issue.closed_at, \n current_timestamp::TIMESTAMP\n)))::timestamp) - date_part('hour', (time_of_first_request)::timestamp))\n * 60 + date_part('minute', (least(\n coalesce(time_of_first_requested_reviewer_review, \n current_timestamp::TIMESTAMP\n),\n coalesce(issue.closed_at, \n current_timestamp::TIMESTAMP\n)))::timestamp) - date_part('minute', (time_of_first_request)::timestamp))\n * 60 + floor(date_part('second', (least(\n coalesce(time_of_first_requested_reviewer_review, \n current_timestamp::TIMESTAMP\n),\n coalesce(issue.closed_at, \n current_timestamp::TIMESTAMP\n)))::timestamp)) - floor(date_part('second', (time_of_first_request)::timestamp)))\n / 60/60 as hours_request_review_to_first_action,\n \n (\n (\n (\n ((merged_at)::date - (time_of_first_request)::date)\n * 24 + date_part('hour', (merged_at)::timestamp) - date_part('hour', (time_of_first_request)::timestamp))\n * 60 + date_part('minute', (merged_at)::timestamp) - date_part('minute', (time_of_first_request)::timestamp))\n * 60 + floor(date_part('second', (merged_at)::timestamp)) - floor(date_part('second', (time_of_first_request)::timestamp)))\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n), __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__pull_request_review\"\n), \n\ngithub_user as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__user\"\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n), __dbt__cte__int_github__issue_joined as (\nwith issue as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue\"\n), \n\nissue_labels as (\n select *\n from __dbt__cte__int_github__issue_labels\n), \n\nrepository_teams as (\n select \n \n *\n from __dbt__cte__int_github__repository_teams\n\n \n), \n\nissue_assignees as (\n select *\n from __dbt__cte__int_github__issue_assignees\n), \n\nissue_open_length as (\n select *\n from __dbt__cte__int_github__issue_open_length\n), \n\nissue_comments as (\n select *\n from __dbt__cte__int_github__issue_comments\n), \n\ncreator as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__user\"\n), \n\npull_request_times as (\n select *\n from __dbt__cte__int_github__pull_request_times\n), \n\npull_request_reviewers as (\n select *\n from __dbt__cte__int_github__pull_request_reviewers\n), \n\npull_request as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__pull_request\"\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then 'https://github.com/' || repository_teams.repository || '/pull/' || issue.issue_number\n else 'https://github.com/' || repository_teams.repository || '/issues/' || issue.issue_number\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n \n repository_teams.repository_team_names,\n \n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id\n),issue_joined as (\n select *\n from __dbt__cte__int_github__issue_joined \n)\n\nselect\n issue_id,\n body,\n closed_at,\n created_at,\n is_locked,\n milestone_id,\n issue_number,\n is_pull_request,\n repository_id,\n state,\n title,\n updated_at,\n user_id,\n url_link,\n days_issue_open,\n number_of_times_reopened,\n labels,\n number_of_comments,\n repository,\n \n repository_team_names,\n \n assignees,\n creator_login_name,\n creator_name,\n creator_company\nfrom issue_joined\nwhere not is_pull_request", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.github.int_github__issue_label_joined", "sql": " __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_label\"\n\n), label as (\n\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__label\"\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n)"}, {"id": "model.github.int_github__issue_labels", "sql": " __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n)"}, {"id": "model.github.int_github__repository_teams", "sql": " __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__repository\"\n),\n\nrepo_teams as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__repo_team\"\n),\n\nteams as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__team\"\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n)"}, {"id": "model.github.int_github__issue_assignees", "sql": " __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_assignee\"\n), \n\ngithub_user as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__user\"\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n)"}, {"id": "model.github.int_github__issue_open_length", "sql": " __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue\"\n), \n\nissue_closed_history as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_closed_history\"\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), \n current_timestamp::TIMESTAMP\n) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n (\n (\n (\n ((valid_until)::date - (valid_starting)::date)\n * 24 + date_part('hour', (valid_until)::timestamp) - date_part('hour', (valid_starting)::timestamp))\n * 60 + date_part('minute', (valid_until)::timestamp) - date_part('minute', (valid_starting)::timestamp))\n * 60 + floor(date_part('second', (valid_until)::timestamp)) - floor(date_part('second', (valid_starting)::timestamp)))\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n)"}, {"id": "model.github.int_github__issue_comments", "sql": " __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_comment\"\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n)"}, {"id": "model.github.int_github__pull_request_times", "sql": " __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__pull_request_review\"\n), \n\npull_request as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__pull_request\"\n), \n\nrequested_reviewer_history as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__requested_reviewer_history\"\n where not removed\n), \n\nissue as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue\"\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_merged\"\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n (\n (\n (\n ((coalesce(time_of_first_review_post_request, \n current_timestamp::TIMESTAMP\n))::date - (time_of_first_request)::date)\n * 24 + date_part('hour', (coalesce(time_of_first_review_post_request, \n current_timestamp::TIMESTAMP\n))::timestamp) - date_part('hour', (time_of_first_request)::timestamp))\n * 60 + date_part('minute', (coalesce(time_of_first_review_post_request, \n current_timestamp::TIMESTAMP\n))::timestamp) - date_part('minute', (time_of_first_request)::timestamp))\n * 60 + floor(date_part('second', (coalesce(time_of_first_review_post_request, \n current_timestamp::TIMESTAMP\n))::timestamp)) - floor(date_part('second', (time_of_first_request)::timestamp)))\n / 60/60 as hours_request_review_to_first_review,\n \n (\n (\n (\n ((least(\n coalesce(time_of_first_requested_reviewer_review, \n current_timestamp::TIMESTAMP\n),\n coalesce(issue.closed_at, \n current_timestamp::TIMESTAMP\n)))::date - (time_of_first_request)::date)\n * 24 + date_part('hour', (least(\n coalesce(time_of_first_requested_reviewer_review, \n current_timestamp::TIMESTAMP\n),\n coalesce(issue.closed_at, \n current_timestamp::TIMESTAMP\n)))::timestamp) - date_part('hour', (time_of_first_request)::timestamp))\n * 60 + date_part('minute', (least(\n coalesce(time_of_first_requested_reviewer_review, \n current_timestamp::TIMESTAMP\n),\n coalesce(issue.closed_at, \n current_timestamp::TIMESTAMP\n)))::timestamp) - date_part('minute', (time_of_first_request)::timestamp))\n * 60 + floor(date_part('second', (least(\n coalesce(time_of_first_requested_reviewer_review, \n current_timestamp::TIMESTAMP\n),\n coalesce(issue.closed_at, \n current_timestamp::TIMESTAMP\n)))::timestamp)) - floor(date_part('second', (time_of_first_request)::timestamp)))\n / 60/60 as hours_request_review_to_first_action,\n \n (\n (\n (\n ((merged_at)::date - (time_of_first_request)::date)\n * 24 + date_part('hour', (merged_at)::timestamp) - date_part('hour', (time_of_first_request)::timestamp))\n * 60 + date_part('minute', (merged_at)::timestamp) - date_part('minute', (time_of_first_request)::timestamp))\n * 60 + floor(date_part('second', (merged_at)::timestamp)) - floor(date_part('second', (time_of_first_request)::timestamp)))\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n)"}, {"id": "model.github.int_github__pull_request_reviewers", "sql": " __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__pull_request_review\"\n), \n\ngithub_user as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__user\"\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n)"}, {"id": "model.github.int_github__issue_joined", "sql": " __dbt__cte__int_github__issue_joined as (\nwith issue as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue\"\n), \n\nissue_labels as (\n select *\n from __dbt__cte__int_github__issue_labels\n), \n\nrepository_teams as (\n select \n \n *\n from __dbt__cte__int_github__repository_teams\n\n \n), \n\nissue_assignees as (\n select *\n from __dbt__cte__int_github__issue_assignees\n), \n\nissue_open_length as (\n select *\n from __dbt__cte__int_github__issue_open_length\n), \n\nissue_comments as (\n select *\n from __dbt__cte__int_github__issue_comments\n), \n\ncreator as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__user\"\n), \n\npull_request_times as (\n select *\n from __dbt__cte__int_github__pull_request_times\n), \n\npull_request_reviewers as (\n select *\n from __dbt__cte__int_github__pull_request_reviewers\n), \n\npull_request as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__pull_request\"\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then 'https://github.com/' || repository_teams.repository || '/pull/' || issue.issue_number\n else 'https://github.com/' || repository_teams.repository || '/issues/' || issue.issue_number\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n \n repository_teams.repository_team_names,\n \n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id\n)"}], "relation_name": "\"postgres\".\"github_integration_tests\".\"github__issues\""}, "model.github.int_github__pull_request_times": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt.datediff"], "nodes": ["model.github_source.stg_github__pull_request_review", "model.github_source.stg_github__pull_request", "model.github_source.stg_github__requested_reviewer_history", "model.github_source.stg_github__issue", "model.github_source.stg_github__issue_merged"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__pull_request_times"], "unique_id": "model.github.int_github__pull_request_times", "raw_code": "with pull_request_review as (\n select *\n from {{ var('pull_request_review') }}\n), \n\npull_request as (\n select *\n from {{ var('pull_request')}}\n), \n\nrequested_reviewer_history as (\n select *\n from {{ var('requested_reviewer_history')}}\n where not removed\n), \n\nissue as (\n select *\n from {{ var('issue') }}\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from {{ var('issue_merged')}}\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n {{ dbt.datediff(\n 'time_of_first_request', \n \"coalesce(time_of_first_review_post_request, \" ~ dbt.current_timestamp_backcompat() ~ \")\", \n 'second') \n }}/ 60/60 as hours_request_review_to_first_review,\n {{ dbt.datediff(\n 'time_of_first_request', \n \"least(\n coalesce(time_of_first_requested_reviewer_review, \" ~ dbt.current_timestamp_backcompat() ~ \"),\n coalesce(issue.closed_at, \" ~ dbt.current_timestamp_backcompat() ~ \"))\", \n 'second') \n }} / 60/60 as hours_request_review_to_first_action,\n {{ dbt.datediff('time_of_first_request', 'merged_at', 'second') }}/ 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id", "language": "sql", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__pull_request_times.sql", "original_file_path": "models/intermediate/int_github__pull_request_times.sql", "name": "int_github__pull_request_times", "alias": "int_github__pull_request_times", "checksum": {"name": "sha256", "checksum": "35a197fef6ef12f2b408564be9d54b15ba8ff1eee0cf8514abedef9f7818422c"}, "tags": [], "refs": [["stg_github__pull_request_review"], ["stg_github__pull_request"], ["stg_github__requested_reviewer_history"], ["stg_github__issue"], ["stg_github__issue_merged"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__pull_request_times.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1671481511.7621608, "compiled_code": "with pull_request_review as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__pull_request_review\"\n), \n\npull_request as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__pull_request\"\n), \n\nrequested_reviewer_history as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__requested_reviewer_history\"\n where not removed\n), \n\nissue as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue\"\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_merged\"\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n (\n (\n (\n ((coalesce(time_of_first_review_post_request, \n current_timestamp::TIMESTAMP\n))::date - (time_of_first_request)::date)\n * 24 + date_part('hour', (coalesce(time_of_first_review_post_request, \n current_timestamp::TIMESTAMP\n))::timestamp) - date_part('hour', (time_of_first_request)::timestamp))\n * 60 + date_part('minute', (coalesce(time_of_first_review_post_request, \n current_timestamp::TIMESTAMP\n))::timestamp) - date_part('minute', (time_of_first_request)::timestamp))\n * 60 + floor(date_part('second', (coalesce(time_of_first_review_post_request, \n current_timestamp::TIMESTAMP\n))::timestamp)) - floor(date_part('second', (time_of_first_request)::timestamp)))\n / 60/60 as hours_request_review_to_first_review,\n \n (\n (\n (\n ((least(\n coalesce(time_of_first_requested_reviewer_review, \n current_timestamp::TIMESTAMP\n),\n coalesce(issue.closed_at, \n current_timestamp::TIMESTAMP\n)))::date - (time_of_first_request)::date)\n * 24 + date_part('hour', (least(\n coalesce(time_of_first_requested_reviewer_review, \n current_timestamp::TIMESTAMP\n),\n coalesce(issue.closed_at, \n current_timestamp::TIMESTAMP\n)))::timestamp) - date_part('hour', (time_of_first_request)::timestamp))\n * 60 + date_part('minute', (least(\n coalesce(time_of_first_requested_reviewer_review, \n current_timestamp::TIMESTAMP\n),\n coalesce(issue.closed_at, \n current_timestamp::TIMESTAMP\n)))::timestamp) - date_part('minute', (time_of_first_request)::timestamp))\n * 60 + floor(date_part('second', (least(\n coalesce(time_of_first_requested_reviewer_review, \n current_timestamp::TIMESTAMP\n),\n coalesce(issue.closed_at, \n current_timestamp::TIMESTAMP\n)))::timestamp)) - floor(date_part('second', (time_of_first_request)::timestamp)))\n / 60/60 as hours_request_review_to_first_action,\n \n (\n (\n (\n ((merged_at)::date - (time_of_first_request)::date)\n * 24 + date_part('hour', (merged_at)::timestamp) - date_part('hour', (time_of_first_request)::timestamp))\n * 60 + date_part('minute', (merged_at)::timestamp) - date_part('minute', (time_of_first_request)::timestamp))\n * 60 + floor(date_part('second', (merged_at)::timestamp)) - floor(date_part('second', (time_of_first_request)::timestamp)))\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__pull_request_reviewers": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.github_source.stg_github__pull_request_review", "model.github_source.stg_github__user"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__pull_request_reviewers"], "unique_id": "model.github.int_github__pull_request_reviewers", "raw_code": "with pull_request_review as (\n select *\n from {{ var('pull_request_review') }}\n), \n\ngithub_user as (\n select *\n from {{ var('user')}}\n)\n\nselect\n pull_request_review.pull_request_id,\n {{ fivetran_utils.string_agg( 'github_user.login_name', \"', '\" )}} as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1", "language": "sql", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__pull_request_reviewers.sql", "original_file_path": "models/intermediate/int_github__pull_request_reviewers.sql", "name": "int_github__pull_request_reviewers", "alias": "int_github__pull_request_reviewers", "checksum": {"name": "sha256", "checksum": "fd5518273ce75ae9066be686308ee078ce9a3df73f3799620f8eb6e611655cd7"}, "tags": [], "refs": [["stg_github__pull_request_review"], ["stg_github__user"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__pull_request_reviewers.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1671481511.778933, "compiled_code": "with pull_request_review as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__pull_request_review\"\n), \n\ngithub_user as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__user\"\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__issue_label_joined": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.github_source.stg_github__issue_label", "model.github_source.stg_github__label"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_label_joined"], "unique_id": "model.github.int_github__issue_label_joined", "raw_code": "with issue_label as (\n\n select *\n from {{ var('issue_label') }}\n\n), label as (\n\n select *\n from {{ var('label') }}\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined", "language": "sql", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_label_joined.sql", "original_file_path": "models/intermediate/int_github__issue_label_joined.sql", "name": "int_github__issue_label_joined", "alias": "int_github__issue_label_joined", "checksum": {"name": "sha256", "checksum": "6f1b225ff9958e67fae4ea1ba0be10ebb9426da364c758c37d0b83305d575d98"}, "tags": [], "refs": [["stg_github__issue_label"], ["stg_github__label"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_label_joined.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1671481511.784307, "compiled_code": "with issue_label as (\n\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_label\"\n\n), label as (\n\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__label\"\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__issue_joined": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.concat"], "nodes": ["model.github_source.stg_github__issue", "model.github.int_github__issue_labels", "model.github.int_github__repository_teams", "model.github.int_github__issue_assignees", "model.github.int_github__issue_open_length", "model.github.int_github__issue_comments", "model.github_source.stg_github__user", "model.github.int_github__pull_request_times", "model.github.int_github__pull_request_reviewers", "model.github_source.stg_github__pull_request"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_joined"], "unique_id": "model.github.int_github__issue_joined", "raw_code": "with issue as (\n select *\n from {{ var('issue') }}\n), \n\nissue_labels as (\n select *\n from {{ ref('int_github__issue_labels')}}\n), \n\nrepository_teams as (\n select \n {% if var('github__using_repo_team', true) %}\n *\n from {{ ref('int_github__repository_teams') }}\n\n {% else %}\n repository_id,\n full_name as repository\n from {{ var('repository') }}\n\n {% endif %}\n), \n\nissue_assignees as (\n select *\n from {{ ref('int_github__issue_assignees')}}\n), \n\nissue_open_length as (\n select *\n from {{ ref('int_github__issue_open_length')}}\n), \n\nissue_comments as (\n select *\n from {{ ref('int_github__issue_comments')}}\n), \n\ncreator as (\n select *\n from {{ var('user')}}\n), \n\npull_request_times as (\n select *\n from {{ ref('int_github__pull_request_times')}}\n), \n\npull_request_reviewers as (\n select *\n from {{ ref('int_github__pull_request_reviewers')}}\n), \n\npull_request as (\n select *\n from {{ var('pull_request')}}\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then {{ dbt.concat([\"'https://github.com/'\",'repository_teams.repository',\"'/pull/'\", 'issue.issue_number']) }}\n else {{ dbt.concat([\"'https://github.com/'\",'repository_teams.repository',\"'/issues/'\", 'issue.issue_number']) }}\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n {% if var('github__using_repo_team', true) %}\n repository_teams.repository_team_names,\n {% endif %}\n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id", "language": "sql", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_joined.sql", "original_file_path": "models/intermediate/int_github__issue_joined.sql", "name": "int_github__issue_joined", "alias": "int_github__issue_joined", "checksum": {"name": "sha256", "checksum": "75658855b696a3744360bbbf58433d6155e44d35128236e08da3df93b87ead16"}, "tags": [], "refs": [["stg_github__issue"], ["int_github__issue_labels"], ["int_github__repository_teams"], ["int_github__issue_assignees"], ["int_github__issue_open_length"], ["int_github__issue_comments"], ["stg_github__user"], ["int_github__pull_request_times"], ["int_github__pull_request_reviewers"], ["stg_github__pull_request"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_joined.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1671481511.788688, "compiled_code": "with __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_label\"\n\n), label as (\n\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__label\"\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n), __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n), __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__repository\"\n),\n\nrepo_teams as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__repo_team\"\n),\n\nteams as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__team\"\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n), __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_assignee\"\n), \n\ngithub_user as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__user\"\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n), __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue\"\n), \n\nissue_closed_history as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_closed_history\"\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), \n current_timestamp::TIMESTAMP\n) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n (\n (\n (\n ((valid_until)::date - (valid_starting)::date)\n * 24 + date_part('hour', (valid_until)::timestamp) - date_part('hour', (valid_starting)::timestamp))\n * 60 + date_part('minute', (valid_until)::timestamp) - date_part('minute', (valid_starting)::timestamp))\n * 60 + floor(date_part('second', (valid_until)::timestamp)) - floor(date_part('second', (valid_starting)::timestamp)))\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n), __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_comment\"\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n), __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__pull_request_review\"\n), \n\npull_request as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__pull_request\"\n), \n\nrequested_reviewer_history as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__requested_reviewer_history\"\n where not removed\n), \n\nissue as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue\"\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_merged\"\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n (\n (\n (\n ((coalesce(time_of_first_review_post_request, \n current_timestamp::TIMESTAMP\n))::date - (time_of_first_request)::date)\n * 24 + date_part('hour', (coalesce(time_of_first_review_post_request, \n current_timestamp::TIMESTAMP\n))::timestamp) - date_part('hour', (time_of_first_request)::timestamp))\n * 60 + date_part('minute', (coalesce(time_of_first_review_post_request, \n current_timestamp::TIMESTAMP\n))::timestamp) - date_part('minute', (time_of_first_request)::timestamp))\n * 60 + floor(date_part('second', (coalesce(time_of_first_review_post_request, \n current_timestamp::TIMESTAMP\n))::timestamp)) - floor(date_part('second', (time_of_first_request)::timestamp)))\n / 60/60 as hours_request_review_to_first_review,\n \n (\n (\n (\n ((least(\n coalesce(time_of_first_requested_reviewer_review, \n current_timestamp::TIMESTAMP\n),\n coalesce(issue.closed_at, \n current_timestamp::TIMESTAMP\n)))::date - (time_of_first_request)::date)\n * 24 + date_part('hour', (least(\n coalesce(time_of_first_requested_reviewer_review, \n current_timestamp::TIMESTAMP\n),\n coalesce(issue.closed_at, \n current_timestamp::TIMESTAMP\n)))::timestamp) - date_part('hour', (time_of_first_request)::timestamp))\n * 60 + date_part('minute', (least(\n coalesce(time_of_first_requested_reviewer_review, \n current_timestamp::TIMESTAMP\n),\n coalesce(issue.closed_at, \n current_timestamp::TIMESTAMP\n)))::timestamp) - date_part('minute', (time_of_first_request)::timestamp))\n * 60 + floor(date_part('second', (least(\n coalesce(time_of_first_requested_reviewer_review, \n current_timestamp::TIMESTAMP\n),\n coalesce(issue.closed_at, \n current_timestamp::TIMESTAMP\n)))::timestamp)) - floor(date_part('second', (time_of_first_request)::timestamp)))\n / 60/60 as hours_request_review_to_first_action,\n \n (\n (\n (\n ((merged_at)::date - (time_of_first_request)::date)\n * 24 + date_part('hour', (merged_at)::timestamp) - date_part('hour', (time_of_first_request)::timestamp))\n * 60 + date_part('minute', (merged_at)::timestamp) - date_part('minute', (time_of_first_request)::timestamp))\n * 60 + floor(date_part('second', (merged_at)::timestamp)) - floor(date_part('second', (time_of_first_request)::timestamp)))\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n), __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__pull_request_review\"\n), \n\ngithub_user as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__user\"\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n),issue as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue\"\n), \n\nissue_labels as (\n select *\n from __dbt__cte__int_github__issue_labels\n), \n\nrepository_teams as (\n select \n \n *\n from __dbt__cte__int_github__repository_teams\n\n \n), \n\nissue_assignees as (\n select *\n from __dbt__cte__int_github__issue_assignees\n), \n\nissue_open_length as (\n select *\n from __dbt__cte__int_github__issue_open_length\n), \n\nissue_comments as (\n select *\n from __dbt__cte__int_github__issue_comments\n), \n\ncreator as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__user\"\n), \n\npull_request_times as (\n select *\n from __dbt__cte__int_github__pull_request_times\n), \n\npull_request_reviewers as (\n select *\n from __dbt__cte__int_github__pull_request_reviewers\n), \n\npull_request as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__pull_request\"\n)\n\nselect\n issue.*,\n case \n when issue.is_pull_request then 'https://github.com/' || repository_teams.repository || '/pull/' || issue.issue_number\n else 'https://github.com/' || repository_teams.repository || '/issues/' || issue.issue_number\n end as url_link,\n issue_open_length.days_issue_open,\n issue_open_length.number_of_times_reopened,\n labels.labels,\n issue_comments.number_of_comments,\n repository_teams.repository,\n \n repository_teams.repository_team_names,\n \n issue_assignees.assignees,\n creator.login_name as creator_login_name,\n creator.name as creator_name,\n creator.company as creator_company,\n hours_request_review_to_first_review,\n hours_request_review_to_first_action,\n hours_request_review_to_merge,\n merged_at,\n reviewers,\n number_of_reviews\nfrom issue\nleft join issue_labels as labels\n on issue.issue_id = labels.issue_id\njoin repository_teams\n on issue.repository_id = repository_teams.repository_id\nleft join issue_assignees\n on issue.issue_id = issue_assignees.issue_id\nleft join issue_open_length\n on issue.issue_id = issue_open_length.issue_id\nleft join issue_comments \n on issue.issue_id = issue_comments.issue_id\nleft join creator \n on issue.user_id = creator.user_id\nleft join pull_request\n on issue.issue_id = pull_request.issue_id\nleft join pull_request_times\n on issue.issue_id = pull_request_times.issue_id\nleft join pull_request_reviewers\n on pull_request.pull_request_id = pull_request_reviewers.pull_request_id", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.github.int_github__issue_label_joined", "sql": " __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_label\"\n\n), label as (\n\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__label\"\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n)"}, {"id": "model.github.int_github__issue_labels", "sql": " __dbt__cte__int_github__issue_labels as (\nwith issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id\n)"}, {"id": "model.github.int_github__repository_teams", "sql": " __dbt__cte__int_github__repository_teams as (\n\n\nwith repository as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__repository\"\n),\n\nrepo_teams as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__repo_team\"\n),\n\nteams as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__team\"\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final\n)"}, {"id": "model.github.int_github__issue_assignees", "sql": " __dbt__cte__int_github__issue_assignees as (\nwith issue_assignee as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_assignee\"\n), \n\ngithub_user as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__user\"\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1\n)"}, {"id": "model.github.int_github__issue_open_length", "sql": " __dbt__cte__int_github__issue_open_length as (\nwith issue as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue\"\n), \n\nissue_closed_history as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_closed_history\"\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), \n current_timestamp::TIMESTAMP\n) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n (\n (\n (\n ((valid_until)::date - (valid_starting)::date)\n * 24 + date_part('hour', (valid_until)::timestamp) - date_part('hour', (valid_starting)::timestamp))\n * 60 + date_part('minute', (valid_until)::timestamp) - date_part('minute', (valid_starting)::timestamp))\n * 60 + floor(date_part('second', (valid_until)::timestamp)) - floor(date_part('second', (valid_starting)::timestamp)))\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id\n)"}, {"id": "model.github.int_github__issue_comments", "sql": " __dbt__cte__int_github__issue_comments as (\nwith issue_comment as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_comment\"\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id\n)"}, {"id": "model.github.int_github__pull_request_times", "sql": " __dbt__cte__int_github__pull_request_times as (\nwith pull_request_review as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__pull_request_review\"\n), \n\npull_request as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__pull_request\"\n), \n\nrequested_reviewer_history as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__requested_reviewer_history\"\n where not removed\n), \n\nissue as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue\"\n), \n\nissue_merged as (\n select\n issue_id,\n min(merged_at) as merged_at\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_merged\"\n group by 1\n), \n\nfirst_request_time as (\n select\n pull_request.issue_id,\n pull_request.pull_request_id,\n -- Finds the first review that is by the requested reviewer and is not a dismissal\n min(case when requested_reviewer_history.requested_id = pull_request_review.user_id then\n case when lower(pull_request_review.state) in ('commented', 'approved', 'changes_requested') \n then pull_request_review.submitted_at end \n else null end) as time_of_first_requested_reviewer_review,\n min(requested_reviewer_history.created_at) as time_of_first_request,\n min(pull_request_review.submitted_at) as time_of_first_review_post_request\n from pull_request\n join requested_reviewer_history on requested_reviewer_history.pull_request_id = pull_request.pull_request_id\n left join pull_request_review on pull_request_review.pull_request_id = pull_request.pull_request_id\n and pull_request_review.submitted_at > requested_reviewer_history.created_at\n group by 1, 2\n)\n\nselect\n first_request_time.issue_id,\n issue_merged.merged_at,\n \n (\n (\n (\n ((coalesce(time_of_first_review_post_request, \n current_timestamp::TIMESTAMP\n))::date - (time_of_first_request)::date)\n * 24 + date_part('hour', (coalesce(time_of_first_review_post_request, \n current_timestamp::TIMESTAMP\n))::timestamp) - date_part('hour', (time_of_first_request)::timestamp))\n * 60 + date_part('minute', (coalesce(time_of_first_review_post_request, \n current_timestamp::TIMESTAMP\n))::timestamp) - date_part('minute', (time_of_first_request)::timestamp))\n * 60 + floor(date_part('second', (coalesce(time_of_first_review_post_request, \n current_timestamp::TIMESTAMP\n))::timestamp)) - floor(date_part('second', (time_of_first_request)::timestamp)))\n / 60/60 as hours_request_review_to_first_review,\n \n (\n (\n (\n ((least(\n coalesce(time_of_first_requested_reviewer_review, \n current_timestamp::TIMESTAMP\n),\n coalesce(issue.closed_at, \n current_timestamp::TIMESTAMP\n)))::date - (time_of_first_request)::date)\n * 24 + date_part('hour', (least(\n coalesce(time_of_first_requested_reviewer_review, \n current_timestamp::TIMESTAMP\n),\n coalesce(issue.closed_at, \n current_timestamp::TIMESTAMP\n)))::timestamp) - date_part('hour', (time_of_first_request)::timestamp))\n * 60 + date_part('minute', (least(\n coalesce(time_of_first_requested_reviewer_review, \n current_timestamp::TIMESTAMP\n),\n coalesce(issue.closed_at, \n current_timestamp::TIMESTAMP\n)))::timestamp) - date_part('minute', (time_of_first_request)::timestamp))\n * 60 + floor(date_part('second', (least(\n coalesce(time_of_first_requested_reviewer_review, \n current_timestamp::TIMESTAMP\n),\n coalesce(issue.closed_at, \n current_timestamp::TIMESTAMP\n)))::timestamp)) - floor(date_part('second', (time_of_first_request)::timestamp)))\n / 60/60 as hours_request_review_to_first_action,\n \n (\n (\n (\n ((merged_at)::date - (time_of_first_request)::date)\n * 24 + date_part('hour', (merged_at)::timestamp) - date_part('hour', (time_of_first_request)::timestamp))\n * 60 + date_part('minute', (merged_at)::timestamp) - date_part('minute', (time_of_first_request)::timestamp))\n * 60 + floor(date_part('second', (merged_at)::timestamp)) - floor(date_part('second', (time_of_first_request)::timestamp)))\n / 60/60 as hours_request_review_to_merge\nfrom first_request_time\njoin issue on first_request_time.issue_id = issue.issue_id\nleft join issue_merged on first_request_time.issue_id = issue_merged.issue_id\n)"}, {"id": "model.github.int_github__pull_request_reviewers", "sql": " __dbt__cte__int_github__pull_request_reviewers as (\nwith pull_request_review as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__pull_request_review\"\n), \n\ngithub_user as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__user\"\n)\n\nselect\n pull_request_review.pull_request_id,\n \n string_agg(github_user.login_name, ', ')\n\n as reviewers,\n count(*) as number_of_reviews\nfrom pull_request_review\nleft join github_user on pull_request_review.user_id = github_user.user_id\ngroup by 1\n)"}], "relation_name": null}, "model.github.int_github__issue_labels": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.github.int_github__issue_label_joined"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_labels"], "unique_id": "model.github.int_github__issue_labels", "raw_code": "with issue_label as (\n select *\n from {{ ref('int_github__issue_label_joined') }}\n)\n\nselect\n issue_id,\n {{ fivetran_utils.string_agg( 'label', \"', '\" )}} as labels\nfrom issue_label\ngroup by issue_id", "language": "sql", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_labels.sql", "original_file_path": "models/intermediate/int_github__issue_labels.sql", "name": "int_github__issue_labels", "alias": "int_github__issue_labels", "checksum": {"name": "sha256", "checksum": "126b7de5034d8b9e5067e9d0a346ea3d93132574cc3ae85d4d711270404f4064"}, "tags": [], "refs": [["int_github__issue_label_joined"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_labels.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1671481511.796152, "compiled_code": "with __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_label\"\n\n), label as (\n\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__label\"\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n),issue_label as (\n select *\n from __dbt__cte__int_github__issue_label_joined\n)\n\nselect\n issue_id,\n \n string_agg(label, ', ')\n\n as labels\nfrom issue_label\ngroup by issue_id", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.github.int_github__issue_label_joined", "sql": " __dbt__cte__int_github__issue_label_joined as (\nwith issue_label as (\n\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_label\"\n\n), label as (\n\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__label\"\n\n), joined as (\n\n select \n issue_label.issue_id,\n label.label\n from issue_label\n left join label \n on issue_label.label_id = label.label_id\n\n)\n\nselect *\nfrom joined\n)"}], "relation_name": null}, "model.github.int_github__issue_assignees": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.github_source.stg_github__issue_assignee", "model.github_source.stg_github__user"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_assignees"], "unique_id": "model.github.int_github__issue_assignees", "raw_code": "with issue_assignee as (\n select *\n from {{ var('issue_assignee') }}\n), \n\ngithub_user as (\n select *\n from {{ var('user')}}\n)\n\nselect\n issue_assignee.issue_id,\n {{ fivetran_utils.string_agg( 'github_user.login_name', \"', '\" )}} as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1", "language": "sql", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_assignees.sql", "original_file_path": "models/intermediate/int_github__issue_assignees.sql", "name": "int_github__issue_assignees", "alias": "int_github__issue_assignees", "checksum": {"name": "sha256", "checksum": "837310bb78ff6f1460babc622037227dbc0c5776aae3ce3f5e9de48cb2ffac9c"}, "tags": [], "refs": [["stg_github__issue_assignee"], ["stg_github__user"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_assignees.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1671481511.799384, "compiled_code": "with issue_assignee as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_assignee\"\n), \n\ngithub_user as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__user\"\n)\n\nselect\n issue_assignee.issue_id,\n \n string_agg(github_user.login_name, ', ')\n\n as assignees\nfrom issue_assignee\njoin github_user on issue_assignee.user_id = github_user.user_id\ngroup by 1", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__issue_comments": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.github_source.stg_github__issue_comment"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_comments"], "unique_id": "model.github.int_github__issue_comments", "raw_code": "with issue_comment as (\n select *\n from {{ var('issue_comment') }}\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id", "language": "sql", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_comments.sql", "original_file_path": "models/intermediate/int_github__issue_comments.sql", "name": "int_github__issue_comments", "alias": "int_github__issue_comments", "checksum": {"name": "sha256", "checksum": "b56ffccc19ec39a1d1bc4137557c8e1971167f97e673ea30d0f713bd34bc111a"}, "tags": [], "refs": [["stg_github__issue_comment"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_comments.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1671481511.803621, "compiled_code": "with issue_comment as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_comment\"\n)\n\nselect\n issue_id,\n count(*) as number_of_comments\nfrom issue_comment\ngroup by issue_id", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__issue_open_length": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt.datediff"], "nodes": ["model.github_source.stg_github__issue", "model.github_source.stg_github__issue_closed_history"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__issue_open_length"], "unique_id": "model.github.int_github__issue_open_length", "raw_code": "with issue as (\n select *\n from {{ var('issue') }}\n), \n\nissue_closed_history as (\n select *\n from {{ var('issue_closed_history') }}\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), {{ dbt.current_timestamp_backcompat() }}) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum({{ dbt.datediff('valid_starting', 'valid_until', 'second') }}) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id", "language": "sql", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__issue_open_length.sql", "original_file_path": "models/intermediate/int_github__issue_open_length.sql", "name": "int_github__issue_open_length", "alias": "int_github__issue_open_length", "checksum": {"name": "sha256", "checksum": "58de864860664b785e8000ef983dcb006d60af6cbba301e72e9e4c45aa1d8d5a"}, "tags": [], "refs": [["stg_github__issue"], ["stg_github__issue_closed_history"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__issue_open_length.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral"}, "created_at": 1671481511.806783, "compiled_code": "with issue as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue\"\n), \n\nissue_closed_history as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_closed_history\"\n), \n\nclose_events_stacked as (\n select \n issue_id,\n created_at as updated_at,\n false as is_closed\n from issue -- required because issue_closed_history table does not have a line item for when the issue was opened\n union all\n select\n issue_id,\n updated_at,\n is_closed\n from issue_closed_history\n), \n\nclose_events_with_timestamps as (\n select\n issue_id,\n updated_at as valid_starting,\n coalesce(lead(updated_at) over (partition by issue_id order by updated_at), \n current_timestamp::TIMESTAMP\n) as valid_until,\n is_closed\n from close_events_stacked\n)\n\nselect\n issue_id,\n sum(\n (\n (\n (\n ((valid_until)::date - (valid_starting)::date)\n * 24 + date_part('hour', (valid_until)::timestamp) - date_part('hour', (valid_starting)::timestamp))\n * 60 + date_part('minute', (valid_until)::timestamp) - date_part('minute', (valid_starting)::timestamp))\n * 60 + floor(date_part('second', (valid_until)::timestamp)) - floor(date_part('second', (valid_starting)::timestamp)))\n ) /60/60/24 as days_issue_open,\n count(*) - 1 as number_of_times_reopened\nfrom close_events_with_timestamps\n where not is_closed\ngroup by issue_id", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github.int_github__repository_teams": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.fivetran_utils.string_agg"], "nodes": ["model.github_source.stg_github__repository", "model.github_source.stg_github__repo_team", "model.github_source.stg_github__team"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github", "intermediate", "int_github__repository_teams"], "unique_id": "model.github.int_github__repository_teams", "raw_code": "{{ config(enabled=var('github__using_repo_team', True)) }}\n\nwith repository as (\n select *\n from {{ var('repository')}}\n),\n\nrepo_teams as (\n select *\n from {{ var('repo_team')}}\n),\n\nteams as (\n select *\n from {{ var('team')}}\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n {{ fivetran_utils.string_agg('team_name', \"', '\" ) }} as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final", "language": "sql", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "intermediate/int_github__repository_teams.sql", "original_file_path": "models/intermediate/int_github__repository_teams.sql", "name": "int_github__repository_teams", "alias": "int_github__repository_teams", "checksum": {"name": "sha256", "checksum": "aa75375faa9f533b0c9c935f80ed6e9c7b90f20249089e7d64b7b47194f9044e"}, "tags": [], "refs": [["stg_github__repository"], ["stg_github__repo_team"], ["stg_github__team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/intermediate/int_github__repository_teams.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "enabled": true}, "created_at": 1671481511.812175, "compiled_code": "\n\nwith repository as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__repository\"\n),\n\nrepo_teams as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__repo_team\"\n),\n\nteams as (\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__team\"\n),\n\nteam_repo as (\n select \n repository.repository_id,\n repository.full_name as repository,\n teams.name as team_name\n from repository\n\n left join repo_teams\n on repository.repository_id = repo_teams.repository_id\n\n left join teams\n on repo_teams.team_id = teams.team_id\n),\n\nfinal as (\n select\n repository_id,\n repository,\n \n string_agg(team_name, ', ')\n\n as repository_team_names\n from team_repo\n\n group by 1, 2\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null}, "model.github_source.stg_github__issue_comment": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_comment_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__issue_comment_tmp", "model.github_source.stg_github__issue_comment_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__issue_comment"], "unique_id": "model.github_source.stg_github__issue_comment", "raw_code": "with issue_comment as (\n\n select *\n from {{ ref('stg_github__issue_comment_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_comment_tmp')),\n staging_columns=get_issue_comment_columns()\n )\n }}\n\n from issue_comment\n\n), fields as (\n\n select \n id as issue_comment_id,\n issue_id,\n user_id\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue_comment.sql", "original_file_path": "models/stg_github__issue_comment.sql", "name": "stg_github__issue_comment", "alias": "stg_github__issue_comment", "checksum": {"name": "sha256", "checksum": "2f96156ac9d0de0afe220888eb6912117a7d04b1680b8fb1f5890dfbbcdb2994"}, "tags": [], "refs": [["stg_github__issue_comment_tmp"], ["stg_github__issue_comment_tmp"]], "sources": [], "metrics": [], "description": "Table that contains comments made on issues", "columns": {"issue_comment_id": {"name": "issue_comment_id", "description": "System generated unique id for the issue comment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue_comment.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1671481512.083301, "compiled_code": "with issue_comment as (\n\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_comment_tmp\"\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n body\n \n as \n \n body\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 issue_id\n \n as \n \n issue_id\n \n, \n \n \n updated_at\n \n as \n \n updated_at\n \n, \n \n \n user_id\n \n as \n \n user_id\n \n\n\n\n\n from issue_comment\n\n), fields as (\n\n select \n id as issue_comment_id,\n issue_id,\n user_id\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"stg_github__issue_comment\""}, "model.github_source.stg_github__requested_reviewer_history": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_requested_reviewer_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.github_source.stg_github__requested_reviewer_history_tmp", "model.github_source.stg_github__requested_reviewer_history_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__requested_reviewer_history"], "unique_id": "model.github_source.stg_github__requested_reviewer_history", "raw_code": "with requested_reviewer_history as (\n\n select *\n from {{ ref('stg_github__requested_reviewer_history_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__requested_reviewer_history_tmp')),\n staging_columns=get_requested_reviewer_history_columns()\n )\n }}\n\n from requested_reviewer_history\n\n), fields as (\n\n select \n pull_request_id,\n cast(created_at as {{ dbt.type_timestamp() }}) as created_at,\n requested_id,\n removed\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__requested_reviewer_history.sql", "original_file_path": "models/stg_github__requested_reviewer_history.sql", "name": "stg_github__requested_reviewer_history", "alias": "stg_github__requested_reviewer_history", "checksum": {"name": "sha256", "checksum": "40abf6ac94bece080abe8e8a45ed43030166df171697acf3c59c5958ffe68eba"}, "tags": [], "refs": [["stg_github__requested_reviewer_history_tmp"], ["stg_github__requested_reviewer_history_tmp"]], "sources": [], "metrics": [], "description": "Table containing when a user requests another user to review a pull request", "columns": {"pull_request_id": {"name": "pull_request_id", "description": "Foreign key that references the pull request table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the review was submitted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "requested_id": {"name": "requested_id", "description": "Foreign key that references the user table, representing the user that was requested to review a PR.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "removed": {"name": "removed", "description": "Boolean variable indicating if the requester was removed from the PR (true) or added to the PR (false).", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__requested_reviewer_history.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1671481512.0908911, "compiled_code": "with requested_reviewer_history as (\n\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__requested_reviewer_history_tmp\"\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n actor_id\n \n as \n \n actor_id\n \n, \n \n \n created_at\n \n as \n \n created_at\n \n, \n \n \n pull_request_id\n \n as \n \n pull_request_id\n \n, \n \n \n removed\n \n as \n \n removed\n \n, \n \n \n requested_id\n \n as \n \n requested_id\n \n\n\n\n\n from requested_reviewer_history\n\n), fields as (\n\n select \n pull_request_id,\n cast(created_at as TIMESTAMP) as created_at,\n requested_id,\n removed\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"stg_github__requested_reviewer_history\""}, "model.github_source.stg_github__issue_label": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_label_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__issue_label_tmp", "model.github_source.stg_github__issue_label_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__issue_label"], "unique_id": "model.github_source.stg_github__issue_label", "raw_code": "with issue_label as (\n\n select *\n from {{ ref('stg_github__issue_label_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_label_tmp')),\n staging_columns=get_issue_label_columns()\n )\n }}\n\n from issue_label\n\n), fields as (\n\n select \n issue_id,\n label_id\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue_label.sql", "original_file_path": "models/stg_github__issue_label.sql", "name": "stg_github__issue_label", "alias": "stg_github__issue_label", "checksum": {"name": "sha256", "checksum": "bbc4b8e82ab26b7cb753ead2165a6d483171b6def78a34c8ab6b2c9d1dc1357c"}, "tags": [], "refs": [["stg_github__issue_label_tmp"], ["stg_github__issue_label_tmp"]], "sources": [], "metrics": [], "description": "The current labels attached to an issue", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "label_id": {"name": "label_id", "description": "Unique identifier of the used label", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue_label.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1671481512.08251, "compiled_code": "with issue_label as (\n\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_label_tmp\"\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n label_id\n \n as \n \n label_id\n \n, \n \n \n issue_id\n \n as \n \n issue_id\n \n\n\n\n\n from issue_label\n\n), fields as (\n\n select \n issue_id,\n label_id\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"stg_github__issue_label\""}, "model.github_source.stg_github__issue_merged": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_merged_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.github_source.stg_github__issue_merged_tmp", "model.github_source.stg_github__issue_merged_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__issue_merged"], "unique_id": "model.github_source.stg_github__issue_merged", "raw_code": "with issue_merged as (\n\n select *\n from {{ ref('stg_github__issue_merged_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_merged_tmp')),\n staging_columns=get_issue_merged_columns()\n )\n }}\n\n from issue_merged\n\n), fields as (\n\n select \n issue_id,\n cast(merged_at as {{ dbt.type_timestamp() }}) as merged_at\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue_merged.sql", "original_file_path": "models/stg_github__issue_merged.sql", "name": "stg_github__issue_merged", "alias": "stg_github__issue_merged", "checksum": {"name": "sha256", "checksum": "d0ffc63496f8a12ccde9c115909db85d5f2fbd7c2ca8a7761cd96abcf31f532c"}, "tags": [], "refs": [["stg_github__issue_merged_tmp"], ["stg_github__issue_merged_tmp"]], "sources": [], "metrics": [], "description": "Table that tracks when an issue (always a pull request) is merged", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table. This table will only reference issues that are pull requests", "meta": {}, "data_type": null, "quote": null, "tags": []}, "merged_at": {"name": "merged_at", "description": "Timestamp of when the code merge took place", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue_merged.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1671481512.083895, "compiled_code": "with issue_merged as (\n\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_merged_tmp\"\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n actor_id\n \n as \n \n actor_id\n \n, \n \n \n commit_sha\n \n as \n \n commit_sha\n \n, \n \n \n issue_id\n \n as \n \n issue_id\n \n, \n \n \n merged_at\n \n as \n \n merged_at\n \n\n\n\n\n from issue_merged\n\n), fields as (\n\n select \n issue_id,\n cast(merged_at as TIMESTAMP) as merged_at\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"stg_github__issue_merged\""}, "model.github_source.stg_github__issue_closed_history": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_closed_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.github_source.stg_github__issue_closed_history_tmp", "model.github_source.stg_github__issue_closed_history_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__issue_closed_history"], "unique_id": "model.github_source.stg_github__issue_closed_history", "raw_code": "with issue_closed_history as (\n\n select *\n from {{ ref('stg_github__issue_closed_history_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_closed_history_tmp')),\n staging_columns=get_issue_closed_history_columns()\n )\n }}\n\n from issue_closed_history\n\n), fields as (\n\n select \n issue_id,\n cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at,\n closed as is_closed\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue_closed_history.sql", "original_file_path": "models/stg_github__issue_closed_history.sql", "name": "stg_github__issue_closed_history", "alias": "stg_github__issue_closed_history", "checksum": {"name": "sha256", "checksum": "8820baed7a5b47177c8e57576741ab5d3763026682f66c52429092e655e07408"}, "tags": [], "refs": [["stg_github__issue_closed_history_tmp"], ["stg_github__issue_closed_history_tmp"]], "sources": [], "metrics": [], "description": "Table to track when an issue is closed or re-opened", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the action took place", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_closed": {"name": "is_closed", "description": "Boolean variable for if the issue was closed (true) or re-opened (false)", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue_closed_history.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1671481512.081959, "compiled_code": "with issue_closed_history as (\n\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_closed_history_tmp\"\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n actor_id\n \n as \n \n actor_id\n \n, \n \n \n closed\n \n as \n \n closed\n \n, \n \n \n commit_sha\n \n as \n \n commit_sha\n \n, \n \n \n issue_id\n \n as \n \n issue_id\n \n, \n \n \n updated_at\n \n as \n \n updated_at\n \n\n\n\n\n from issue_closed_history\n\n), fields as (\n\n select \n issue_id,\n cast(updated_at as TIMESTAMP) as updated_at,\n closed as is_closed\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"stg_github__issue_closed_history\""}, "model.github_source.stg_github__issue_assignee": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_assignee_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__issue_assignee_tmp", "model.github_source.stg_github__issue_assignee_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__issue_assignee"], "unique_id": "model.github_source.stg_github__issue_assignee", "raw_code": "with issue_assignee as (\n\n select *\n from {{ ref('stg_github__issue_assignee_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_assignee_tmp')),\n staging_columns=get_issue_assignee_columns()\n )\n }}\n\n from issue_assignee\n\n), fields as (\n\n select \n issue_id,\n user_id\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue_assignee.sql", "original_file_path": "models/stg_github__issue_assignee.sql", "name": "stg_github__issue_assignee", "alias": "stg_github__issue_assignee", "checksum": {"name": "sha256", "checksum": "1ee1ae6a0a648f4fddde4964f184b889bfd09ca43f0560fb10faaa8544b2f90d"}, "tags": [], "refs": [["stg_github__issue_assignee_tmp"], ["stg_github__issue_assignee_tmp"]], "sources": [], "metrics": [], "description": "Table with the current user(s) assigned to an issue", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue_assignee.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1671481512.079486, "compiled_code": "with issue_assignee as (\n\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_assignee_tmp\"\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n issue_id\n \n as \n \n issue_id\n \n, \n \n \n user_id\n \n as \n \n user_id\n \n\n\n\n\n from issue_assignee\n\n), fields as (\n\n select \n issue_id,\n user_id\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"stg_github__issue_assignee\""}, "model.github_source.stg_github__repository": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_repository_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__repository_tmp", "model.github_source.stg_github__repository_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__repository"], "unique_id": "model.github_source.stg_github__repository", "raw_code": "with repository as (\n\n select *\n from {{ ref('stg_github__repository_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__repository_tmp')),\n staging_columns=get_repository_columns()\n )\n }}\n\n from repository\n\n), fields as (\n\n select \n id as repository_id,\n full_name,\n private as is_private\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__repository.sql", "original_file_path": "models/stg_github__repository.sql", "name": "stg_github__repository", "alias": "stg_github__repository", "checksum": {"name": "sha256", "checksum": "52faadfa1a36e8b144c01bdba106b9b22c58154bbd60b69c069c409f1b2f4712"}, "tags": [], "refs": [["stg_github__repository_tmp"], ["stg_github__repository_tmp"]], "sources": [], "metrics": [], "description": "Table representing the file structure of a directory under git control", "columns": {"repository_id": {"name": "repository_id", "description": "System generated unique id for the repository.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "full_name": {"name": "full_name", "description": "The name of the git repository.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_private": {"name": "is_private", "description": "Boolean field indicating whether the repository is private (true) or public (false).", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__repository.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1671481512.090047, "compiled_code": "with repository as (\n\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__repository_tmp\"\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\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 created_at\n \n as \n \n created_at\n \n, \n \n \n default_branch\n \n as \n \n default_branch\n \n, \n \n \n description\n \n as \n \n description\n \n, \n \n \n fork\n \n as \n \n fork\n \n, \n \n \n full_name\n \n as \n \n full_name\n \n, \n \n \n homepage\n \n as \n \n homepage\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n language\n \n as \n \n language\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n owner_id\n \n as \n \n owner_id\n \n, \n \n \n private\n \n as \n \n private\n \n\n\n\n\n from repository\n\n), fields as (\n\n select \n id as repository_id,\n full_name,\n private as is_private\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"stg_github__repository\""}, "model.github_source.stg_github__user": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_user_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__user_tmp", "model.github_source.stg_github__user_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__user"], "unique_id": "model.github_source.stg_github__user", "raw_code": "with github_user as (\n\n select *\n from {{ ref('stg_github__user_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__user_tmp')),\n staging_columns=get_user_columns()\n )\n }}\n \n \n from github_user\n\n), fields as (\n\n select\n id as user_id,\n login as login_name,\n name,\n company\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__user.sql", "original_file_path": "models/stg_github__user.sql", "name": "stg_github__user", "alias": "stg_github__user", "checksum": {"name": "sha256", "checksum": "3fade99df6af62e01efd3bdabe4245077eeb17d7c05a33eae885ab9cebfb33a6"}, "tags": [], "refs": [["stg_github__user_tmp"], ["stg_github__user_tmp"]], "sources": [], "metrics": [], "description": "Table representing contributors to a git project", "columns": {"user_id": {"name": "user_id", "description": "System generated unique id for the user.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "login_name": {"name": "login_name", "description": "The alias the user uses to login to github.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the user", "meta": {}, "data_type": null, "quote": null, "tags": []}, "company": {"name": "company", "description": "The company of the user.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__user.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1671481512.092858, "compiled_code": "with github_user as (\n\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__user_tmp\"\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n company\n \n as \n \n company\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n login\n \n as \n \n login\n \n, \n \n \n name\n \n as \n \n name\n \n\n\n\n \n \n from github_user\n\n), fields as (\n\n select\n id as user_id,\n login as login_name,\n name,\n company\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"stg_github__user\""}, "model.github_source.stg_github__pull_request_review": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_pull_request_review_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.github_source.stg_github__pull_request_review_tmp", "model.github_source.stg_github__pull_request_review_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__pull_request_review"], "unique_id": "model.github_source.stg_github__pull_request_review", "raw_code": "with pull_request_review as (\n\n select *\n from {{ ref('stg_github__pull_request_review_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__pull_request_review_tmp')),\n staging_columns=get_pull_request_review_columns()\n )\n }}\n\n from pull_request_review\n\n), fields as (\n\n select \n id as pull_request_review_id,\n pull_request_id,\n cast(submitted_at as {{ dbt.type_timestamp() }}) as submitted_at,\n state,\n user_id\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__pull_request_review.sql", "original_file_path": "models/stg_github__pull_request_review.sql", "name": "stg_github__pull_request_review", "alias": "stg_github__pull_request_review", "checksum": {"name": "sha256", "checksum": "3c5b56fcda26503106a11215aa4895199d140d378e4f81dc73fee0a95a39ef6b"}, "tags": [], "refs": [["stg_github__pull_request_review_tmp"], ["stg_github__pull_request_review_tmp"]], "sources": [], "metrics": [], "description": "Table containing reviews made to pull requests", "columns": {"pull_request_review_id": {"name": "pull_request_review_id", "description": "System generated unique id for the pull request review.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pull_request_id": {"name": "pull_request_id", "description": "Foreign key that references the pull request table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "submitted_at": {"name": "submitted_at", "description": "Timestamp of when the request for review was submitted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the review was an approval, request for change, comment, dismissal.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table, representing the user that reviewed the pull request.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__pull_request_review.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1671481512.087874, "compiled_code": "with pull_request_review as (\n\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__pull_request_review_tmp\"\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n body\n \n as \n \n body\n \n, \n \n \n commit_sha\n \n as \n \n commit_sha\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n pull_request_id\n \n as \n \n pull_request_id\n \n, \n \n \n state\n \n as \n \n state\n \n, \n \n \n submitted_at\n \n as \n \n submitted_at\n \n, \n \n \n user_id\n \n as \n \n user_id\n \n\n\n\n\n from pull_request_review\n\n), fields as (\n\n select \n id as pull_request_review_id,\n pull_request_id,\n cast(submitted_at as TIMESTAMP) as submitted_at,\n state,\n user_id\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"stg_github__pull_request_review\""}, "model.github_source.stg_github__repo_team": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_repo_team_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__repo_team_tmp", "model.github_source.stg_github__repo_team_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__repo_team"], "unique_id": "model.github_source.stg_github__repo_team", "raw_code": "{{ config(enabled=var('github__using_repo_team', True)) }}\n\nwith base as (\n\n select * \n from {{ ref('stg_github__repo_team_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__repo_team_tmp')),\n staging_columns=get_repo_team_columns()\n )\n }}\n \n from base\n \n), final as (\n \n select \n repository_id,\n team_id\n from fields\n)\n\nselect * from final", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__repo_team.sql", "original_file_path": "models/stg_github__repo_team.sql", "name": "stg_github__repo_team", "alias": "stg_github__repo_team", "checksum": {"name": "sha256", "checksum": "bbf2296c63f5601191f285d1b9509717c9af73282ef8faae25df101d5c2058ec"}, "tags": [], "refs": [["stg_github__repo_team_tmp"], ["stg_github__repo_team_tmp"]], "sources": [], "metrics": [], "description": "Table representing the mapping relationships between repositories and teams", "columns": {"repository_id": {"name": "repository_id", "description": "Reference to the respective repository for the record.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "team_id": {"name": "team_id", "description": "Reference to the respective team for the record.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__repo_team.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "enabled": true}, "created_at": 1671481512.0893729, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"github_integration_tests\".\"stg_github__repo_team_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n permission\n \n as \n \n permission\n \n, \n \n \n repository_id\n \n as \n \n repository_id\n \n, \n \n \n team_id\n \n as \n \n team_id\n \n\n\n\n \n from base\n \n), final as (\n \n select \n repository_id,\n team_id\n from fields\n)\n\nselect * from final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"stg_github__repo_team\""}, "model.github_source.stg_github__label": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_label_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__label_tmp", "model.github_source.stg_github__label_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__label"], "unique_id": "model.github_source.stg_github__label", "raw_code": "with issue_label as (\n\n select *\n from {{ ref('stg_github__label_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__label_tmp')),\n staging_columns=get_label_columns()\n )\n }}\n\n from issue_label\n\n), fields as (\n\n select \n id as label_id,\n _fivetran_synced,\t\n color,\n description,\n is_default,\n name as label,\n url\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__label.sql", "original_file_path": "models/stg_github__label.sql", "name": "stg_github__label", "alias": "stg_github__label", "checksum": {"name": "sha256", "checksum": "65919f8309be5eb259a6143e007f38f4ac91c1692d10990206708faa17f086e1"}, "tags": [], "refs": [["stg_github__label_tmp"], ["stg_github__label_tmp"]], "sources": [], "metrics": [], "description": "Table that contains labels that are used across your Github account within individual repositories.", "columns": {"label_id": {"name": "label_id", "description": "Unique identifier of the Github label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of the record being synced by Fivetran", "meta": {}, "data_type": null, "quote": null, "tags": []}, "color": {"name": "color", "description": "The color of the label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "The description of the label indicating the purpose", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_default": {"name": "is_default", "description": "Boolean flagging if the label is default on creation", "meta": {}, "data_type": null, "quote": null, "tags": []}, "label": {"name": "label", "description": "Name of the label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url": {"name": "url", "description": "Url where the label was used", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__label.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1671481512.08109, "compiled_code": "with issue_label as (\n\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__label_tmp\"\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\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 description\n \n as \n \n description\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n is_default\n \n as \n \n is_default\n \n, \n \n \n name\n \n as \n \n name\n \n, \n \n \n url\n \n as \n \n url\n \n\n\n\n\n from issue_label\n\n), fields as (\n\n select \n id as label_id,\n _fivetran_synced,\t\n color,\n description,\n is_default,\n name as label,\n url\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"stg_github__label\""}, "model.github_source.stg_github__issue": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_issue_columns", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp"], "nodes": ["model.github_source.stg_github__issue_tmp", "model.github_source.stg_github__issue_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__issue"], "unique_id": "model.github_source.stg_github__issue", "raw_code": "with issue as (\n\n select *\n from {{ ref('stg_github__issue_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__issue_tmp')),\n staging_columns=get_issue_columns()\n )\n }}\n\n from issue \n\n), fields as (\n\n select \n id as issue_id,\n body,\n cast(closed_at as {{ dbt.type_timestamp() }}) as closed_at,\n cast(created_at as {{ dbt.type_timestamp() }}) as created_at,\n locked as is_locked,\n milestone_id,\n number as issue_number,\n pull_request as is_pull_request,\n repository_id,\n state,\n title,\n cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at,\n user_id\n \n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__issue.sql", "original_file_path": "models/stg_github__issue.sql", "name": "stg_github__issue", "alias": "stg_github__issue", "checksum": {"name": "sha256", "checksum": "4fa11e7a1ff0785189f14a205478aba55bb62784e05066f421e1723ec12240d0"}, "tags": [], "refs": [["stg_github__issue_tmp"], ["stg_github__issue_tmp"]], "sources": [], "metrics": [], "description": "Table that contains 1 entry for every issue created. Pull Requests also create an entry in this table, and there is a boolean field to determine if an entry is a pull request.", "columns": {"issue_id": {"name": "issue_id", "description": "System generated unique id for the issue. This is not the number that appears in the URL.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "body": {"name": "body", "description": "The text of the main description of the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed_at": {"name": "closed_at", "description": "Timestamp of when the issue was closed, NULL for issues that are open.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_locked": {"name": "is_locked", "description": "Boolean indicating whether the issue is locked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the issue was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "milestone_id": {"name": "milestone_id", "description": "Foreign key that references the milestone table representing the current milestone the issue is in.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_number": {"name": "issue_number", "description": "The issue number within a repository. Is unique by repository, but not across repositories.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_pull_request": {"name": "is_pull_request", "description": "Boolean for is the issue is a pull request (true) ot regular issue (false)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_id": {"name": "repository_id", "description": "Foreign key that references the repository table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the issue is open or closed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "Title of the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the last update was made to the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table, representing the user that created the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__issue.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1671481512.086276, "compiled_code": "with issue as (\n\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_tmp\"\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n body\n \n as \n \n body\n \n, \n \n \n closed_at\n \n as \n \n closed_at\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 locked\n \n as \n \n locked\n \n, \n \n \n milestone_id\n \n as \n \n milestone_id\n \n, \n \n \n number\n \n as \n \n number\n \n, \n \n \n pull_request\n \n as \n \n pull_request\n \n, \n \n \n repository_id\n \n as \n \n repository_id\n \n, \n \n \n state\n \n as \n \n state\n \n, \n \n \n title\n \n as \n \n title\n \n, \n \n \n updated_at\n \n as \n \n updated_at\n \n, \n \n \n user_id\n \n as \n \n user_id\n \n\n\n\n\n from issue \n\n), fields as (\n\n select \n id as issue_id,\n body,\n cast(closed_at as TIMESTAMP) as closed_at,\n cast(created_at as TIMESTAMP) as created_at,\n locked as is_locked,\n milestone_id,\n number as issue_number,\n pull_request as is_pull_request,\n repository_id,\n state,\n title,\n cast(updated_at as TIMESTAMP) as updated_at,\n user_id\n \n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"stg_github__issue\""}, "model.github_source.stg_github__team": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_team_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__team_tmp", "model.github_source.stg_github__team_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__team"], "unique_id": "model.github_source.stg_github__team", "raw_code": "with base as (\n\n select * \n from {{ ref('stg_github__team_tmp') }}\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__team_tmp')),\n staging_columns=get_team_columns()\n )\n }}\n \n from base\n \n), final as (\n \n select \n id as team_id,\n description,\n name,\n parent_id,\n privacy,\n slug\n from fields\n)\n\nselect * \nfrom final", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__team.sql", "original_file_path": "models/stg_github__team.sql", "name": "stg_github__team", "alias": "stg_github__team", "checksum": {"name": "sha256", "checksum": "219e47883ec9f076dc1c27b22f72534709edaedd60e8ad9dc1b13db05499f4a4"}, "tags": [], "refs": [["stg_github__team_tmp"], ["stg_github__team_tmp"]], "sources": [], "metrics": [], "description": "Table containing teams and team details", "columns": {"team_id": {"name": "team_id", "description": "System generated unique id for the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "User created description of the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "User created name of the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "Reference to the parent team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "privacy": {"name": "privacy", "description": "Type of privacy permissions associated with the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "slug": {"name": "slug", "description": "Url friendly version of the team name.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__team.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1671481512.0919821, "compiled_code": "with base as (\n\n select * \n from \"postgres\".\"github_integration_tests\".\"stg_github__team_tmp\"\n\n),\n\nfields as (\n\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n description\n \n as \n \n description\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 org_id\n \n as \n \n org_id\n \n, \n \n \n parent_id\n \n as \n \n parent_id\n \n, \n \n \n privacy\n \n as \n \n privacy\n \n, \n \n \n slug\n \n as \n \n slug\n \n\n\n\n \n from base\n \n), final as (\n \n select \n id as team_id,\n description,\n name,\n parent_id,\n privacy,\n slug\n from fields\n)\n\nselect * \nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"stg_github__team\""}, "model.github_source.stg_github__pull_request": {"compiled": true, "resource_type": "model", "depends_on": {"macros": ["macro.github_source.get_pull_request_columns", "macro.fivetran_utils.fill_staging_columns"], "nodes": ["model.github_source.stg_github__pull_request_tmp", "model.github_source.stg_github__pull_request_tmp"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_source", "stg_github__pull_request"], "unique_id": "model.github_source.stg_github__pull_request", "raw_code": "with pull_request as (\n\n select *\n from {{ ref('stg_github__pull_request_tmp') }}\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_github__pull_request_tmp')),\n staging_columns=get_pull_request_columns()\n )\n }}\n\n from pull_request\n\n), fields as (\n\n select \n id as pull_request_id,\n issue_id,\n head_repo_id,\n head_user_id\n\n from macro\n)\n\nselect *\nfrom fields", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "stg_github__pull_request.sql", "original_file_path": "models/stg_github__pull_request.sql", "name": "stg_github__pull_request", "alias": "stg_github__pull_request", "checksum": {"name": "sha256", "checksum": "c2b1a593030492afcf35407523b636105f42f1cf3fd14f6067e31ba76d70dfe8"}, "tags": [], "refs": [["stg_github__pull_request_tmp"], ["stg_github__pull_request_tmp"]], "sources": [], "metrics": [], "description": "A special type of issue that is created when a user wants to merge one branch of code into another", "columns": {"pull_request_id": {"name": "pull_request_id", "description": "System generated unique id for the pull request.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "head_repo_id": {"name": "head_repo_id", "description": "Foreign key that references the repository table, referencing the current branch.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "head_user_id": {"name": "head_user_id", "description": "Foreign key that references the user table, referencing who created the current branch.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "github_source://models/stg_github.yml", "compiled_path": "target/compiled/github_source/models/stg_github__pull_request.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table"}, "created_at": 1671481512.088821, "compiled_code": "with pull_request as (\n\n select *\n from \"postgres\".\"github_integration_tests\".\"stg_github__pull_request_tmp\"\n\n), macro as (\n select\n /*\n The below macro is used to generate the correct SQL for package staging models. It takes a list of columns \n that are expected/needed (staging_columns from dbt_github_source/models/tmp/) and compares it with columns \n in the source (source_columns from dbt_github_source/macros/).\n\n For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).\n */\n \n \n \n _fivetran_synced\n \n as \n \n _fivetran_synced\n \n, \n \n \n base_label\n \n as \n \n base_label\n \n, \n \n \n base_ref\n \n as \n \n base_ref\n \n, \n \n \n base_repo_id\n \n as \n \n base_repo_id\n \n, \n \n \n base_sha\n \n as \n \n base_sha\n \n, \n \n \n base_user_id\n \n as \n \n base_user_id\n \n, \n \n \n head_label\n \n as \n \n head_label\n \n, \n \n \n head_ref\n \n as \n \n head_ref\n \n, \n \n \n head_repo_id\n \n as \n \n head_repo_id\n \n, \n \n \n head_sha\n \n as \n \n head_sha\n \n, \n \n \n head_user_id\n \n as \n \n head_user_id\n \n, \n \n \n id\n \n as \n \n id\n \n, \n \n \n issue_id\n \n as \n \n issue_id\n \n, \n \n \n merge_commit_sha\n \n as \n \n merge_commit_sha\n \n\n\n\n\n from pull_request\n\n), fields as (\n\n select \n id as pull_request_id,\n issue_id,\n head_repo_id,\n head_user_id\n\n from macro\n)\n\nselect *\nfrom fields", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"stg_github__pull_request\""}, "model.github_source.stg_github__repository_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.repository"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__repository_tmp"], "unique_id": "model.github_source.stg_github__repository_tmp", "raw_code": "select *\nfrom {{ var('repository') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__repository_tmp.sql", "original_file_path": "models/tmp/stg_github__repository_tmp.sql", "name": "stg_github__repository_tmp", "alias": "stg_github__repository_tmp", "checksum": {"name": "sha256", "checksum": "e090c8cb68dc96c49ee363d95e9bbaf417dd03e2ec675bfdc3d9cefdf889cfc8"}, "tags": [], "refs": [], "sources": [["github", "repository"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__repository_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1671481511.959328, "compiled_code": "select *\nfrom \"postgres\".\"github_integration_tests\".\"github_repository_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"stg_github__repository_tmp\""}, "model.github_source.stg_github__label_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.label"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__label_tmp"], "unique_id": "model.github_source.stg_github__label_tmp", "raw_code": "select *\nfrom {{ var('label') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__label_tmp.sql", "original_file_path": "models/tmp/stg_github__label_tmp.sql", "name": "stg_github__label_tmp", "alias": "stg_github__label_tmp", "checksum": {"name": "sha256", "checksum": "8e66aceee9e6c677e3b0b105b85de66edea0f4141bef42cd097fd9a236abcf2f"}, "tags": [], "refs": [], "sources": [["github", "label"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__label_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1671481511.962843, "compiled_code": "select *\nfrom \"postgres\".\"github_integration_tests\".\"github_label_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"stg_github__label_tmp\""}, "model.github_source.stg_github__requested_reviewer_history_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.requested_reviewer_history"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__requested_reviewer_history_tmp"], "unique_id": "model.github_source.stg_github__requested_reviewer_history_tmp", "raw_code": "select *\nfrom {{ var('requested_reviewer_history') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__requested_reviewer_history_tmp.sql", "original_file_path": "models/tmp/stg_github__requested_reviewer_history_tmp.sql", "name": "stg_github__requested_reviewer_history_tmp", "alias": "stg_github__requested_reviewer_history_tmp", "checksum": {"name": "sha256", "checksum": "ed713a77bb2c7407b63c6cc1eb5da22d3267a585bd972dabeb7c86e568180aaf"}, "tags": [], "refs": [], "sources": [["github", "requested_reviewer_history"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__requested_reviewer_history_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1671481511.966746, "compiled_code": "select *\nfrom \"postgres\".\"github_integration_tests\".\"github_requested_reviewer_history_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"stg_github__requested_reviewer_history_tmp\""}, "model.github_source.stg_github__issue_comment_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.issue_comment"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_comment_tmp"], "unique_id": "model.github_source.stg_github__issue_comment_tmp", "raw_code": "select *\nfrom {{ var('issue_comment') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_comment_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_comment_tmp.sql", "name": "stg_github__issue_comment_tmp", "alias": "stg_github__issue_comment_tmp", "checksum": {"name": "sha256", "checksum": "0954877e30180964df220c97f9b398d775fc74106c25666bf9dd98c5449a72a1"}, "tags": [], "refs": [], "sources": [["github", "issue_comment"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_comment_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1671481511.9703429, "compiled_code": "select *\nfrom \"postgres\".\"github_integration_tests\".\"github_issue_comment_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"stg_github__issue_comment_tmp\""}, "model.github_source.stg_github__pull_request_review_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.pull_request_review"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__pull_request_review_tmp"], "unique_id": "model.github_source.stg_github__pull_request_review_tmp", "raw_code": "select *\nfrom {{ var('pull_request_review') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__pull_request_review_tmp.sql", "original_file_path": "models/tmp/stg_github__pull_request_review_tmp.sql", "name": "stg_github__pull_request_review_tmp", "alias": "stg_github__pull_request_review_tmp", "checksum": {"name": "sha256", "checksum": "3419833d93b14d370eb3c9cfb7fda9a373c47a2f9701620425d882b95fbaa55c"}, "tags": [], "refs": [], "sources": [["github", "pull_request_review"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__pull_request_review_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1671481511.9736729, "compiled_code": "select *\nfrom \"postgres\".\"github_integration_tests\".\"github_pull_request_review_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"stg_github__pull_request_review_tmp\""}, "model.github_source.stg_github__issue_label_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.issue_label"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_label_tmp"], "unique_id": "model.github_source.stg_github__issue_label_tmp", "raw_code": "select *\nfrom {{ var('issue_label') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_label_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_label_tmp.sql", "name": "stg_github__issue_label_tmp", "alias": "stg_github__issue_label_tmp", "checksum": {"name": "sha256", "checksum": "3cd52e662c2bc67a66c9c3e6250e38739362a0b688287d41329d2989297fa201"}, "tags": [], "refs": [], "sources": [["github", "issue_label"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_label_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1671481511.9780679, "compiled_code": "select *\nfrom \"postgres\".\"github_integration_tests\".\"github_issue_label_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"stg_github__issue_label_tmp\""}, "model.github_source.stg_github__team_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.team"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__team_tmp"], "unique_id": "model.github_source.stg_github__team_tmp", "raw_code": "select * \nfrom {{ var('team') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__team_tmp.sql", "original_file_path": "models/tmp/stg_github__team_tmp.sql", "name": "stg_github__team_tmp", "alias": "stg_github__team_tmp", "checksum": {"name": "sha256", "checksum": "8c107692c9394962da82e0c2460045e6686d962c1eefe0cff564c618aed7a17d"}, "tags": [], "refs": [], "sources": [["github", "team"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__team_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1671481511.9817631, "compiled_code": "select * \nfrom \"postgres\".\"github_integration_tests\".\"github_team_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"stg_github__team_tmp\""}, "model.github_source.stg_github__pull_request_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.pull_request"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__pull_request_tmp"], "unique_id": "model.github_source.stg_github__pull_request_tmp", "raw_code": "select *\nfrom {{ var('pull_request') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__pull_request_tmp.sql", "original_file_path": "models/tmp/stg_github__pull_request_tmp.sql", "name": "stg_github__pull_request_tmp", "alias": "stg_github__pull_request_tmp", "checksum": {"name": "sha256", "checksum": "11df5e7fd7046db485c6654ea88c82c566b71140c4e233f3567bd63bbf1cca19"}, "tags": [], "refs": [], "sources": [["github", "pull_request"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__pull_request_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1671481511.985342, "compiled_code": "select *\nfrom \"postgres\".\"github_integration_tests\".\"github_pull_request_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"stg_github__pull_request_tmp\""}, "model.github_source.stg_github__issue_merged_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.issue_merged"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_merged_tmp"], "unique_id": "model.github_source.stg_github__issue_merged_tmp", "raw_code": "select *\nfrom {{ var('issue_merged') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_merged_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_merged_tmp.sql", "name": "stg_github__issue_merged_tmp", "alias": "stg_github__issue_merged_tmp", "checksum": {"name": "sha256", "checksum": "e61fb5297937f494370067232958a443ec21c885a55cca0022f480b463ce90a9"}, "tags": [], "refs": [], "sources": [["github", "issue_merged"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_merged_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1671481511.9888582, "compiled_code": "select *\nfrom \"postgres\".\"github_integration_tests\".\"github_issue_merged_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"stg_github__issue_merged_tmp\""}, "model.github_source.stg_github__user_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.user"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__user_tmp"], "unique_id": "model.github_source.stg_github__user_tmp", "raw_code": "select *\nfrom {{ var('user') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__user_tmp.sql", "original_file_path": "models/tmp/stg_github__user_tmp.sql", "name": "stg_github__user_tmp", "alias": "stg_github__user_tmp", "checksum": {"name": "sha256", "checksum": "e71885bca06f3e1feaef9e729cfb58827c8999bc4d4b7cda538c392c5f56ffdf"}, "tags": [], "refs": [], "sources": [["github", "user"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__user_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1671481511.9922261, "compiled_code": "select *\nfrom \"postgres\".\"github_integration_tests\".\"github_user_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"stg_github__user_tmp\""}, "model.github_source.stg_github__issue_closed_history_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.issue_closed_history"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_closed_history_tmp"], "unique_id": "model.github_source.stg_github__issue_closed_history_tmp", "raw_code": "select *\nfrom {{ var('issue_closed_history') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_closed_history_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_closed_history_tmp.sql", "name": "stg_github__issue_closed_history_tmp", "alias": "stg_github__issue_closed_history_tmp", "checksum": {"name": "sha256", "checksum": "5ce3eed90261c385c0ddcb0dc9d914a0bf3d3e0f737e4e233af244d29bbf3ce4"}, "tags": [], "refs": [], "sources": [["github", "issue_closed_history"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_closed_history_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1671481511.99559, "compiled_code": "select *\nfrom \"postgres\".\"github_integration_tests\".\"github_issue_closed_history_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"stg_github__issue_closed_history_tmp\""}, "model.github_source.stg_github__issue_assignee_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.issue_assignee"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_assignee_tmp"], "unique_id": "model.github_source.stg_github__issue_assignee_tmp", "raw_code": "select *\nfrom {{ var('issue_assignee') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_assignee_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_assignee_tmp.sql", "name": "stg_github__issue_assignee_tmp", "alias": "stg_github__issue_assignee_tmp", "checksum": {"name": "sha256", "checksum": "4cab39e652c5972bfa16de13454df8e5745610e91b69f3840305e49a9d613753"}, "tags": [], "refs": [], "sources": [["github", "issue_assignee"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_assignee_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1671481511.9998028, "compiled_code": "select *\nfrom \"postgres\".\"github_integration_tests\".\"github_issue_assignee_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"stg_github__issue_assignee_tmp\""}, "model.github_source.stg_github__issue_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.issue"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__issue_tmp"], "unique_id": "model.github_source.stg_github__issue_tmp", "raw_code": "select *\nfrom {{ var('issue') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__issue_tmp.sql", "original_file_path": "models/tmp/stg_github__issue_tmp.sql", "name": "stg_github__issue_tmp", "alias": "stg_github__issue_tmp", "checksum": {"name": "sha256", "checksum": "4100b13686c42d580a5eeaab15449896ec2ce740b0e5f002775eb9f222ef7c32"}, "tags": [], "refs": [], "sources": [["github", "issue"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__issue_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view"}, "created_at": 1671481512.002985, "compiled_code": "select *\nfrom \"postgres\".\"github_integration_tests\".\"github_issue_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"stg_github__issue_tmp\""}, "model.github_source.stg_github__repo_team_tmp": {"compiled": true, "resource_type": "model", "depends_on": {"macros": [], "nodes": ["source.github_source.github.repo_team"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "post-hook": [], "pre-hook": []}, "database": "postgres", "schema": "github_integration_tests", "fqn": ["github_source", "tmp", "stg_github__repo_team_tmp"], "unique_id": "model.github_source.stg_github__repo_team_tmp", "raw_code": "{{ config(enabled=var('github__using_repo_team', True)) }}\n\nselect * \nfrom {{ var('repo_team') }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "tmp/stg_github__repo_team_tmp.sql", "original_file_path": "models/tmp/stg_github__repo_team_tmp.sql", "name": "stg_github__repo_team_tmp", "alias": "stg_github__repo_team_tmp", "checksum": {"name": "sha256", "checksum": "25a704d9235d40dc05601995f184779690eabcc6e3a64d3a0489e00c3e6d13ab"}, "tags": [], "refs": [], "sources": [["github", "repo_team"]], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/tmp/stg_github__repo_team_tmp.sql", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "enabled": true}, "created_at": 1671481512.0065222, "compiled_code": "\n\nselect * \nfrom \"postgres\".\"github_integration_tests\".\"github_repo_team_data\"", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": "\"postgres\".\"github_integration_tests\".\"stg_github__repo_team_tmp\""}, "test.github.unique_github__issues_issue_id.6723b9b1db": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('github__issues')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__issues"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__issues_issue_id"], "unique_id": "test.github.unique_github__issues_issue_id.6723b9b1db", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__issues_issue_id.sql", "original_file_path": "models/github.yml", "name": "unique_github__issues_issue_id", "alias": "unique_github__issues_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__issues"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__issues_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481512.0400698, "compiled_code": "\n \n \n\nselect\n issue_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"github_integration_tests\".\"github__issues\"\nwhere issue_id is not null\ngroup by issue_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.github__issues"}, "test.github.not_null_github__issues_issue_id.fed0631e25": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('github__issues')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__issues"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__issues_issue_id"], "unique_id": "test.github.not_null_github__issues_issue_id.fed0631e25", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__issues_issue_id.sql", "original_file_path": "models/github.yml", "name": "not_null_github__issues_issue_id", "alias": "not_null_github__issues_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__issues"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__issues_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481512.041615, "compiled_code": "\n \n \n\n\n\nselect issue_id\nfrom \"postgres\".\"github_integration_tests\".\"github__issues\"\nwhere issue_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.github__issues"}, "test.github.unique_github__pull_requests_issue_id.ce23997907": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('github__pull_requests')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__pull_requests"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__pull_requests_issue_id"], "unique_id": "test.github.unique_github__pull_requests_issue_id.ce23997907", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__pull_requests_issue_id.sql", "original_file_path": "models/github.yml", "name": "unique_github__pull_requests_issue_id", "alias": "unique_github__pull_requests_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__pull_requests"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__pull_requests_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481512.042787, "compiled_code": "\n \n \n\nselect\n issue_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"github_integration_tests\".\"github__pull_requests\"\nwhere issue_id is not null\ngroup by issue_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.github__pull_requests"}, "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('github__pull_requests')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__pull_requests"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__pull_requests_issue_id"], "unique_id": "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__pull_requests_issue_id.sql", "original_file_path": "models/github.yml", "name": "not_null_github__pull_requests_issue_id", "alias": "not_null_github__pull_requests_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__pull_requests"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__pull_requests_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481512.043909, "compiled_code": "\n \n \n\n\n\nselect issue_id\nfrom \"postgres\".\"github_integration_tests\".\"github__pull_requests\"\nwhere issue_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.github__pull_requests"}, "test.github.unique_github__daily_metrics_day.f98cab9456": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "day", "model": "{{ get_where_subquery(ref('github__daily_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__daily_metrics_day"], "unique_id": "test.github.unique_github__daily_metrics_day.f98cab9456", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__daily_metrics_day.sql", "original_file_path": "models/github.yml", "name": "unique_github__daily_metrics_day", "alias": "unique_github__daily_metrics_day", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__daily_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__daily_metrics_day.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481512.045076, "compiled_code": "\n \n \n\nselect\n day as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"github_integration_tests\".\"github__daily_metrics\"\nwhere day is not null\ngroup by day\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "day", "file_key_name": "models.github__daily_metrics"}, "test.github.not_null_github__daily_metrics_day.647e494434": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "day", "model": "{{ get_where_subquery(ref('github__daily_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__daily_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__daily_metrics_day"], "unique_id": "test.github.not_null_github__daily_metrics_day.647e494434", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__daily_metrics_day.sql", "original_file_path": "models/github.yml", "name": "not_null_github__daily_metrics_day", "alias": "not_null_github__daily_metrics_day", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__daily_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__daily_metrics_day.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481512.0463629, "compiled_code": "\n \n \n\n\n\nselect day\nfrom \"postgres\".\"github_integration_tests\".\"github__daily_metrics\"\nwhere day is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "day", "file_key_name": "models.github__daily_metrics"}, "test.github.unique_github__weekly_metrics_week.6794858a8e": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "week", "model": "{{ get_where_subquery(ref('github__weekly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__weekly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__weekly_metrics_week"], "unique_id": "test.github.unique_github__weekly_metrics_week.6794858a8e", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__weekly_metrics_week.sql", "original_file_path": "models/github.yml", "name": "unique_github__weekly_metrics_week", "alias": "unique_github__weekly_metrics_week", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__weekly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__weekly_metrics_week.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481512.047505, "compiled_code": "\n \n \n\nselect\n week as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"github_integration_tests\".\"github__weekly_metrics\"\nwhere week is not null\ngroup by week\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "week", "file_key_name": "models.github__weekly_metrics"}, "test.github.not_null_github__weekly_metrics_week.4b0b928243": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "week", "model": "{{ get_where_subquery(ref('github__weekly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__weekly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__weekly_metrics_week"], "unique_id": "test.github.not_null_github__weekly_metrics_week.4b0b928243", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__weekly_metrics_week.sql", "original_file_path": "models/github.yml", "name": "not_null_github__weekly_metrics_week", "alias": "not_null_github__weekly_metrics_week", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__weekly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__weekly_metrics_week.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481512.048655, "compiled_code": "\n \n \n\n\n\nselect week\nfrom \"postgres\".\"github_integration_tests\".\"github__weekly_metrics\"\nwhere week is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "week", "file_key_name": "models.github__weekly_metrics"}, "test.github.unique_github__monthly_metrics_month.3076284fbb": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "month", "model": "{{ get_where_subquery(ref('github__monthly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__monthly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__monthly_metrics_month"], "unique_id": "test.github.unique_github__monthly_metrics_month.3076284fbb", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__monthly_metrics_month.sql", "original_file_path": "models/github.yml", "name": "unique_github__monthly_metrics_month", "alias": "unique_github__monthly_metrics_month", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__monthly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__monthly_metrics_month.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481512.049664, "compiled_code": "\n \n \n\nselect\n month as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"github_integration_tests\".\"github__monthly_metrics\"\nwhere month is not null\ngroup by month\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "month", "file_key_name": "models.github__monthly_metrics"}, "test.github.not_null_github__monthly_metrics_month.9e4fba84df": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "month", "model": "{{ get_where_subquery(ref('github__monthly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__monthly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__monthly_metrics_month"], "unique_id": "test.github.not_null_github__monthly_metrics_month.9e4fba84df", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__monthly_metrics_month.sql", "original_file_path": "models/github.yml", "name": "not_null_github__monthly_metrics_month", "alias": "not_null_github__monthly_metrics_month", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__monthly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__monthly_metrics_month.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481512.050782, "compiled_code": "\n \n \n\n\n\nselect month\nfrom \"postgres\".\"github_integration_tests\".\"github__monthly_metrics\"\nwhere month is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "month", "file_key_name": "models.github__monthly_metrics"}, "test.github.unique_github__quarterly_metrics_quarter.9165a921c1": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "quarter", "model": "{{ get_where_subquery(ref('github__quarterly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__quarterly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "unique_github__quarterly_metrics_quarter"], "unique_id": "test.github.unique_github__quarterly_metrics_quarter.9165a921c1", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "unique_github__quarterly_metrics_quarter.sql", "original_file_path": "models/github.yml", "name": "unique_github__quarterly_metrics_quarter", "alias": "unique_github__quarterly_metrics_quarter", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__quarterly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/unique_github__quarterly_metrics_quarter.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481512.051751, "compiled_code": "\n \n \n\nselect\n quarter as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"github_integration_tests\".\"github__quarterly_metrics\"\nwhere quarter is not null\ngroup by quarter\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "quarter", "file_key_name": "models.github__quarterly_metrics"}, "test.github.not_null_github__quarterly_metrics_quarter.92394d46dc": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "quarter", "model": "{{ get_where_subquery(ref('github__quarterly_metrics')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github.github__quarterly_metrics"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github", "not_null_github__quarterly_metrics_quarter"], "unique_id": "test.github.not_null_github__quarterly_metrics_quarter.92394d46dc", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github", "path": "not_null_github__quarterly_metrics_quarter.sql", "original_file_path": "models/github.yml", "name": "not_null_github__quarterly_metrics_quarter", "alias": "not_null_github__quarterly_metrics_quarter", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["github__quarterly_metrics"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github/models/github.yml/not_null_github__quarterly_metrics_quarter.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481512.052754, "compiled_code": "\n \n \n\n\n\nselect quarter\nfrom \"postgres\".\"github_integration_tests\".\"github__quarterly_metrics\"\nwhere quarter is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "quarter", "file_key_name": "models.github__quarterly_metrics"}, "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["issue_id", "user_id"], "model": "{{ get_where_subquery(ref('stg_github__issue_assignee')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue_assignee"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id"], "unique_id": "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388\") }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388.sql", "original_file_path": "models/stg_github.yml", "name": "dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id", "alias": "dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue_assignee"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_55c803fa741ab06ea0e2f5a562401388"}, "created_at": 1671481512.0933828, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n issue_id, user_id\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_assignee\"\n group by issue_id, user_id\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_github__issue_assignee"}, "test.github_source.not_null_stg_github__label_label_id.9f07379974": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "label_id", "model": "{{ get_where_subquery(ref('stg_github__label')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__label"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__label_label_id"], "unique_id": "test.github_source.not_null_stg_github__label_label_id.9f07379974", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__label_label_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__label_label_id", "alias": "not_null_stg_github__label_label_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__label"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__label_label_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481512.10109, "compiled_code": "\n \n \n\n\n\nselect label_id\nfrom \"postgres\".\"github_integration_tests\".\"stg_github__label\"\nwhere label_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "label_id", "file_key_name": "models.stg_github__label"}, "test.github_source.unique_stg_github__label_label_id.74d3c21466": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "label_id", "model": "{{ get_where_subquery(ref('stg_github__label')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__label"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__label_label_id"], "unique_id": "test.github_source.unique_stg_github__label_label_id.74d3c21466", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__label_label_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__label_label_id", "alias": "unique_stg_github__label_label_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__label"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__label_label_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481512.1020591, "compiled_code": "\n \n \n\nselect\n label_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"github_integration_tests\".\"stg_github__label\"\nwhere label_id is not null\ngroup by label_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "label_id", "file_key_name": "models.stg_github__label"}, "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["issue_id", "updated_at"], "model": "{{ get_where_subquery(ref('stg_github__issue_closed_history')) }}"}, "namespace": "dbt_utils"}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue_closed_history"]}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at"], "unique_id": "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d", "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f\") }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f.sql", "original_file_path": "models/stg_github.yml", "name": "dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at", "alias": "dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue_closed_history"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f.sql", "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_fc44911d78886c25d7806aac81804f5f"}, "created_at": 1671481512.103154, "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n select\n issue_id, updated_at\n from \"postgres\".\"github_integration_tests\".\"stg_github__issue_closed_history\"\n group by issue_id, updated_at\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": null, "file_key_name": "models.stg_github__issue_closed_history"}, "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "issue_comment_id", "model": "{{ get_where_subquery(ref('stg_github__issue_comment')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue_comment"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__issue_comment_issue_comment_id"], "unique_id": "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__issue_comment_issue_comment_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__issue_comment_issue_comment_id", "alias": "unique_stg_github__issue_comment_issue_comment_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue_comment"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__issue_comment_issue_comment_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481512.105783, "compiled_code": "\n \n \n\nselect\n issue_comment_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"github_integration_tests\".\"stg_github__issue_comment\"\nwhere issue_comment_id is not null\ngroup by issue_comment_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_comment_id", "file_key_name": "models.stg_github__issue_comment"}, "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "issue_comment_id", "model": "{{ get_where_subquery(ref('stg_github__issue_comment')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue_comment"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__issue_comment_issue_comment_id"], "unique_id": "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__issue_comment_issue_comment_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__issue_comment_issue_comment_id", "alias": "not_null_stg_github__issue_comment_issue_comment_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue_comment"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__issue_comment_issue_comment_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481512.1073651, "compiled_code": "\n \n \n\n\n\nselect issue_comment_id\nfrom \"postgres\".\"github_integration_tests\".\"stg_github__issue_comment\"\nwhere issue_comment_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_comment_id", "file_key_name": "models.stg_github__issue_comment"}, "test.github_source.unique_stg_github__issue_issue_id.84891aeece": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('stg_github__issue')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__issue_issue_id"], "unique_id": "test.github_source.unique_stg_github__issue_issue_id.84891aeece", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__issue_issue_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__issue_issue_id", "alias": "unique_stg_github__issue_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__issue_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481512.1085892, "compiled_code": "\n \n \n\nselect\n issue_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"github_integration_tests\".\"stg_github__issue\"\nwhere issue_id is not null\ngroup by issue_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.stg_github__issue"}, "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "issue_id", "model": "{{ get_where_subquery(ref('stg_github__issue')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__issue"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__issue_issue_id"], "unique_id": "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__issue_issue_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__issue_issue_id", "alias": "not_null_stg_github__issue_issue_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__issue"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__issue_issue_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481512.109654, "compiled_code": "\n \n \n\n\n\nselect issue_id\nfrom \"postgres\".\"github_integration_tests\".\"stg_github__issue\"\nwhere issue_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "issue_id", "file_key_name": "models.stg_github__issue"}, "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "pull_request_review_id", "model": "{{ get_where_subquery(ref('stg_github__pull_request_review')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__pull_request_review"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__pull_request_review_pull_request_review_id"], "unique_id": "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__pull_request_review_pull_request_review_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__pull_request_review_pull_request_review_id", "alias": "unique_stg_github__pull_request_review_pull_request_review_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__pull_request_review"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__pull_request_review_pull_request_review_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481512.110859, "compiled_code": "\n \n \n\nselect\n pull_request_review_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"github_integration_tests\".\"stg_github__pull_request_review\"\nwhere pull_request_review_id is not null\ngroup by pull_request_review_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "pull_request_review_id", "file_key_name": "models.stg_github__pull_request_review"}, "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "pull_request_review_id", "model": "{{ get_where_subquery(ref('stg_github__pull_request_review')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__pull_request_review"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__pull_request_review_pull_request_review_id"], "unique_id": "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__pull_request_review_pull_request_review_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__pull_request_review_pull_request_review_id", "alias": "not_null_stg_github__pull_request_review_pull_request_review_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__pull_request_review"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__pull_request_review_pull_request_review_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481512.112182, "compiled_code": "\n \n \n\n\n\nselect pull_request_review_id\nfrom \"postgres\".\"github_integration_tests\".\"stg_github__pull_request_review\"\nwhere pull_request_review_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "pull_request_review_id", "file_key_name": "models.stg_github__pull_request_review"}, "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "pull_request_id", "model": "{{ get_where_subquery(ref('stg_github__pull_request')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__pull_request"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__pull_request_pull_request_id"], "unique_id": "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__pull_request_pull_request_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__pull_request_pull_request_id", "alias": "unique_stg_github__pull_request_pull_request_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__pull_request"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__pull_request_pull_request_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481512.113334, "compiled_code": "\n \n \n\nselect\n pull_request_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"github_integration_tests\".\"stg_github__pull_request\"\nwhere pull_request_id is not null\ngroup by pull_request_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "pull_request_id", "file_key_name": "models.stg_github__pull_request"}, "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "pull_request_id", "model": "{{ get_where_subquery(ref('stg_github__pull_request')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__pull_request"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__pull_request_pull_request_id"], "unique_id": "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__pull_request_pull_request_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__pull_request_pull_request_id", "alias": "not_null_stg_github__pull_request_pull_request_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__pull_request"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__pull_request_pull_request_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481512.11455, "compiled_code": "\n \n \n\n\n\nselect pull_request_id\nfrom \"postgres\".\"github_integration_tests\".\"stg_github__pull_request\"\nwhere pull_request_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "pull_request_id", "file_key_name": "models.stg_github__pull_request"}, "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "repository_id", "model": "{{ get_where_subquery(ref('stg_github__repo_team')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__repo_team"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__repo_team_repository_id"], "unique_id": "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__repo_team_repository_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__repo_team_repository_id", "alias": "not_null_stg_github__repo_team_repository_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__repo_team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__repo_team_repository_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481512.115726, "compiled_code": "\n \n \n\n\n\nselect repository_id\nfrom \"postgres\".\"github_integration_tests\".\"stg_github__repo_team\"\nwhere repository_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "repository_id", "file_key_name": "models.stg_github__repo_team"}, "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "team_id", "model": "{{ get_where_subquery(ref('stg_github__repo_team')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__repo_team"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__repo_team_team_id"], "unique_id": "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__repo_team_team_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__repo_team_team_id", "alias": "not_null_stg_github__repo_team_team_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__repo_team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__repo_team_team_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481512.116977, "compiled_code": "\n \n \n\n\n\nselect team_id\nfrom \"postgres\".\"github_integration_tests\".\"stg_github__repo_team\"\nwhere team_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "team_id", "file_key_name": "models.stg_github__repo_team"}, "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "repository_id", "model": "{{ get_where_subquery(ref('stg_github__repository')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__repository"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__repository_repository_id"], "unique_id": "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__repository_repository_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__repository_repository_id", "alias": "unique_stg_github__repository_repository_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__repository"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__repository_repository_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481512.118057, "compiled_code": "\n \n \n\nselect\n repository_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"github_integration_tests\".\"stg_github__repository\"\nwhere repository_id is not null\ngroup by repository_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "repository_id", "file_key_name": "models.stg_github__repository"}, "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "repository_id", "model": "{{ get_where_subquery(ref('stg_github__repository')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__repository"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__repository_repository_id"], "unique_id": "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__repository_repository_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__repository_repository_id", "alias": "not_null_stg_github__repository_repository_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__repository"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__repository_repository_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481512.119118, "compiled_code": "\n \n \n\n\n\nselect repository_id\nfrom \"postgres\".\"github_integration_tests\".\"stg_github__repository\"\nwhere repository_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "repository_id", "file_key_name": "models.stg_github__repository"}, "test.github_source.unique_stg_github__team_team_id.94e9716ab4": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "team_id", "model": "{{ get_where_subquery(ref('stg_github__team')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__team"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__team_team_id"], "unique_id": "test.github_source.unique_stg_github__team_team_id.94e9716ab4", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__team_team_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__team_team_id", "alias": "unique_stg_github__team_team_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__team_team_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481512.12023, "compiled_code": "\n \n \n\nselect\n team_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"github_integration_tests\".\"stg_github__team\"\nwhere team_id is not null\ngroup by team_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "team_id", "file_key_name": "models.stg_github__team"}, "test.github_source.not_null_stg_github__team_team_id.440aefe7a7": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "team_id", "model": "{{ get_where_subquery(ref('stg_github__team')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__team"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__team_team_id"], "unique_id": "test.github_source.not_null_stg_github__team_team_id.440aefe7a7", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__team_team_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__team_team_id", "alias": "not_null_stg_github__team_team_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__team"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__team_team_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481512.121521, "compiled_code": "\n \n \n\n\n\nselect team_id\nfrom \"postgres\".\"github_integration_tests\".\"stg_github__team\"\nwhere team_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "team_id", "file_key_name": "models.stg_github__team"}, "test.github_source.unique_stg_github__user_user_id.5c1a00cd90": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(ref('stg_github__user')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__user"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "unique_stg_github__user_user_id"], "unique_id": "test.github_source.unique_stg_github__user_user_id.5c1a00cd90", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "unique_stg_github__user_user_id.sql", "original_file_path": "models/stg_github.yml", "name": "unique_stg_github__user_user_id", "alias": "unique_stg_github__user_user_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__user"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/unique_stg_github__user_user_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481512.122584, "compiled_code": "\n \n \n\nselect\n user_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"github_integration_tests\".\"stg_github__user\"\nwhere user_id is not null\ngroup by user_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "user_id", "file_key_name": "models.stg_github__user"}, "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(ref('stg_github__user')) }}"}, "namespace": null}, "compiled": true, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.github_source.stg_github__user"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "postgres", "schema": "github_integration_tests_dbt_test__audit", "fqn": ["github_source", "not_null_stg_github__user_user_id"], "unique_id": "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "not_null_stg_github__user_user_id.sql", "original_file_path": "models/stg_github.yml", "name": "not_null_stg_github__user_user_id", "alias": "not_null_stg_github__user_user_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["stg_github__user"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": "target/compiled/github_source/models/stg_github.yml/not_null_stg_github__user_user_id.sql", "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1671481512.123619, "compiled_code": "\n \n \n\n\n\nselect user_id\nfrom \"postgres\".\"github_integration_tests\".\"stg_github__user\"\nwhere user_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "relation_name": null, "column_name": "user_id", "file_key_name": "models.stg_github__user"}}, "sources": {"source.github_source.github.issue_assignee": {"fqn": ["github_source", "github", "issue_assignee"], "database": "postgres", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue_assignee", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue_assignee", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_issue_assignee_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table with the current user(s) assigned to an issue", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"github_integration_tests\".\"github_issue_assignee_data\"", "created_at": 1671481512.1245399}, "source.github_source.github.label": {"fqn": ["github_source", "github", "label"], "database": "postgres", "schema": "github_integration_tests", "unique_id": "source.github_source.github.label", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "label", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_label_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Table that contains labels that are used across your Github account within individual repositories.", "columns": {"id": {"name": "id", "description": "Unique identifier of the Github label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of the record being synced by Fivetran", "meta": {}, "data_type": null, "quote": null, "tags": []}, "color": {"name": "color", "description": "The color of the label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "The description of the label indicating the purpose", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_default": {"name": "is_default", "description": "Boolean flagging if the label is default on creation", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "Name of the label", "meta": {}, "data_type": null, "quote": null, "tags": []}, "url": {"name": "url", "description": "Url where the label was used", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"github_integration_tests\".\"github_label_data\"", "created_at": 1671481512.124641}, "source.github_source.github.issue_closed_history": {"fqn": ["github_source", "github", "issue_closed_history"], "database": "postgres", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue_closed_history", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue_closed_history", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_issue_closed_history_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table to track when an issue is closed or re-opened", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the action took place", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed": {"name": "closed", "description": "Boolean variable for if the issue was closed (true) or re-opened (false)", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"github_integration_tests\".\"github_issue_closed_history_data\"", "created_at": 1671481512.124714}, "source.github_source.github.issue_label": {"fqn": ["github_source", "github", "issue_label"], "database": "postgres", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue_label", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue_label", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_issue_label_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "The current labels attached to an issue", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "label_id": {"name": "label_id", "description": "Unique identifier of the used label", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"github_integration_tests\".\"github_issue_label_data\"", "created_at": 1671481512.12478}, "source.github_source.github.issue_comment": {"fqn": ["github_source", "github", "issue_comment"], "database": "postgres", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue_comment", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue_comment", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_issue_comment_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table that contains comments made on issues", "columns": {"id": {"name": "id", "description": "System generated unique id for the issue comment.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"github_integration_tests\".\"github_issue_comment_data\"", "created_at": 1671481512.1248472}, "source.github_source.github.issue_merged": {"fqn": ["github_source", "github", "issue_merged"], "database": "postgres", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue_merged", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue_merged", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_issue_merged_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table that tracks when an issue (always a pull request) is merged", "columns": {"issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table. This table will only reference issues that are pull requests", "meta": {}, "data_type": null, "quote": null, "tags": []}, "merged_at": {"name": "merged_at", "description": "Timestamp of when the code merge took place", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"github_integration_tests\".\"github_issue_merged_data\"", "created_at": 1671481512.124912}, "source.github_source.github.issue": {"fqn": ["github_source", "github", "issue"], "database": "postgres", "schema": "github_integration_tests", "unique_id": "source.github_source.github.issue", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "issue", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_issue_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table that contains 1 entry for every issue created. Pull Requests also create an entry in this table, and there is a boolean field to determine if an entry is a pull request.", "columns": {"id": {"name": "id", "description": "System generated unique id for the issue. This is not the number that appears in the URL.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "body": {"name": "body", "description": "The text of the main description of the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "locked": {"name": "locked", "description": "Boolean indicating whether the issue is locked.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "closed_at": {"name": "closed_at", "description": "Timestamp of when the issue was closed, NULL for issues that are open.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the issue was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "milestone_id": {"name": "milestone_id", "description": "Foreign key that references the milestone table representing the current milestone the issue is in.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "number": {"name": "number", "description": "The issue number within a repository. Is unique by repository, but not across repositories.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pull_request": {"name": "pull_request", "description": "Boolean for is the issue is a pull request (true) ot regular issue (false)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "repository_id": {"name": "repository_id", "description": "Foreign key that references the repository table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the issue is open or closed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "title": {"name": "title", "description": "Title of the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Timestamp of when the last update was made to the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table, representing the user that created the issue.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"github_integration_tests\".\"github_issue_data\"", "created_at": 1671481512.1249878}, "source.github_source.github.pull_request_review": {"fqn": ["github_source", "github", "pull_request_review"], "database": "postgres", "schema": "github_integration_tests", "unique_id": "source.github_source.github.pull_request_review", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "pull_request_review", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_pull_request_review_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table containing reviews made to pull requests", "columns": {"id": {"name": "id", "description": "System generated unique id for the pull request review.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pull_request_id": {"name": "pull_request_id", "description": "Foreign key that references the pull request table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "submitted_at": {"name": "submitted_at", "description": "Timestamp of when the request for review was submitted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "Whether the review was an approval, request for change, comment, dismissal.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "user_id": {"name": "user_id", "description": "Foreign key that references the user table, representing the user that reviewed the pull request.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"github_integration_tests\".\"github_pull_request_review_data\"", "created_at": 1671481512.125053}, "source.github_source.github.pull_request": {"fqn": ["github_source", "github", "pull_request"], "database": "postgres", "schema": "github_integration_tests", "unique_id": "source.github_source.github.pull_request", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "pull_request", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_pull_request_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "A special type of issue that is created when a user wants to merge one branch of code into another", "columns": {"id": {"name": "id", "description": "System generated unique id for the pull request.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "issue_id": {"name": "issue_id", "description": "Foreign key that references the issue table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "head_repo_id": {"name": "head_repo_id", "description": "Foreign key that references the repository table, referencing the current branch.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "head_user_id": {"name": "head_user_id", "description": "Foreign key that references the user table, referencing who created the current branch.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"github_integration_tests\".\"github_pull_request_data\"", "created_at": 1671481512.125124}, "source.github_source.github.repo_team": {"fqn": ["github_source", "github", "repo_team"], "database": "postgres", "schema": "github_integration_tests", "unique_id": "source.github_source.github.repo_team", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "repo_team", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_repo_team_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table representing the mapping relationships between repositories and teams", "columns": {"repository_id": {"name": "repository_id", "description": "Reference to the respective repository for the record.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "team_id": {"name": "team_id", "description": "Reference to the respective team for the record.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {"is_enabled": true}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"github_integration_tests\".\"github_repo_team_data\"", "created_at": 1671481512.1251872}, "source.github_source.github.repository": {"fqn": ["github_source", "github", "repository"], "database": "postgres", "schema": "github_integration_tests", "unique_id": "source.github_source.github.repository", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "repository", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_repository_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Table representing the file structure of a directory under git control", "columns": {"id": {"name": "id", "description": "System generated unique id for the repository.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the repository was created.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "full_name": {"name": "full_name", "description": "The name of the git repository.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "private": {"name": "private", "description": "Boolean field indicating whether the repository is private (true) or public (false).", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"github_integration_tests\".\"github_repository_data\"", "created_at": 1671481512.125248}, "source.github_source.github.requested_reviewer_history": {"fqn": ["github_source", "github", "requested_reviewer_history"], "database": "postgres", "schema": "github_integration_tests", "unique_id": "source.github_source.github.requested_reviewer_history", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "requested_reviewer_history", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_requested_reviewer_history_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table containing when a user requests another user to review a pull request", "columns": {"pull_request_id": {"name": "pull_request_id", "description": "Foreign key that references the pull request table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "created_at": {"name": "created_at", "description": "Timestamp of when the review was submitted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "requested_id": {"name": "requested_id", "description": "Foreign key that references the user table, representing the user that was requested to review a PR.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "removed": {"name": "removed", "description": "Boolean variable indicating if the requester was removed from the PR (true) or added to the PR (false).", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"github_integration_tests\".\"github_requested_reviewer_history_data\"", "created_at": 1671481512.125312}, "source.github_source.github.team": {"fqn": ["github_source", "github", "team"], "database": "postgres", "schema": "github_integration_tests", "unique_id": "source.github_source.github.team", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "team", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_team_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 72, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Table containing teams and team details", "columns": {"id": {"name": "id", "description": "System generated unique id for the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "User created description of the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "User created name of the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_id": {"name": "parent_id", "description": "Reference to the parent team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "privacy": {"name": "privacy", "description": "Type of privacy permissions associated with the team.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "slug": {"name": "slug", "description": "Url friendly version of the team name.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"github_integration_tests\".\"github_team_data\"", "created_at": 1671481512.1253781}, "source.github_source.github.user": {"fqn": ["github_source", "github", "user"], "database": "postgres", "schema": "github_integration_tests", "unique_id": "source.github_source.github.user", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "models/src_github.yml", "original_file_path": "models/src_github.yml", "name": "user", "source_name": "github", "source_description": "", "loader": "fivetran", "identifier": "github_user_data", "resource_type": "source", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": null, "external": null, "description": "Table representing contributors to a git project", "columns": {"id": {"name": "id", "description": "System generated unique id for the user.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "login": {"name": "login", "description": "The alias the user uses to login to github.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the user", "meta": {}, "data_type": null, "quote": null, "tags": []}, "company": {"name": "company", "description": "The company of the user.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"postgres\".\"github_integration_tests\".\"github_user_data\"", "created_at": 1671481512.1254358}}, "macros": {"macro.dbt_postgres.postgres__current_timestamp": {"unique_id": "macro.dbt_postgres.postgres__current_timestamp", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "name": "postgres__current_timestamp", "macro_sql": "{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.137474, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_string_as_time": {"unique_id": "macro.dbt_postgres.postgres__snapshot_string_as_time", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "name": "postgres__snapshot_string_as_time", "macro_sql": "{% macro postgres__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp without time zone\" -%}\n {{ return(result) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.137722, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_get_time": {"unique_id": "macro.dbt_postgres.postgres__snapshot_get_time", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "name": "postgres__snapshot_get_time", "macro_sql": "{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.137834, "supported_languages": null}, "macro.dbt_postgres.postgres__current_timestamp_backcompat": {"unique_id": "macro.dbt_postgres.postgres__current_timestamp_backcompat", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "name": "postgres__current_timestamp_backcompat", "macro_sql": "{% macro postgres__current_timestamp_backcompat() %}\n current_timestamp::{{ type_timestamp() }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.13794, "supported_languages": null}, "macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat": {"unique_id": "macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "name": "postgres__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro postgres__current_timestamp_in_utc_backcompat() %}\n (current_timestamp at time zone 'utc')::{{ type_timestamp() }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.138051, "supported_languages": null}, "macro.dbt_postgres.postgres__get_catalog": {"unique_id": "macro.dbt_postgres.postgres__get_catalog", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "name": "postgres__get_catalog", "macro_sql": "{% macro postgres__get_catalog(information_schema, schemas) -%}\n\n {%- call statement('catalog', fetch_result=True) -%}\n {#\n If the user has multiple databases set and the first one is wrong, this will fail.\n But we won't fail in the case where there are multiple quoting-difference-only dbs, which is better.\n #}\n {% set database = information_schema.database %}\n {{ adapter.verify_database(database) }}\n\n select\n '{{ database }}' as table_database,\n sch.nspname as table_schema,\n tbl.relname as table_name,\n case tbl.relkind\n when 'v' then 'VIEW'\n else 'BASE TABLE'\n end as table_type,\n tbl_desc.description as table_comment,\n col.attname as column_name,\n col.attnum as column_index,\n pg_catalog.format_type(col.atttypid, col.atttypmod) as column_type,\n col_desc.description as column_comment,\n pg_get_userbyid(tbl.relowner) as table_owner\n\n from pg_catalog.pg_namespace sch\n join pg_catalog.pg_class tbl on tbl.relnamespace = sch.oid\n join pg_catalog.pg_attribute col on col.attrelid = tbl.oid\n left outer join pg_catalog.pg_description tbl_desc on (tbl_desc.objoid = tbl.oid and tbl_desc.objsubid = 0)\n left outer join pg_catalog.pg_description col_desc on (col_desc.objoid = tbl.oid and col_desc.objsubid = col.attnum)\n\n where (\n {%- for schema in schemas -%}\n upper(sch.nspname) = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n and not pg_is_other_temp_schema(sch.oid) -- not a temporary schema belonging to another session\n and tbl.relpersistence in ('p', 'u') -- [p]ermanent table or [u]nlogged table. Exclude [t]emporary tables\n and tbl.relkind in ('r', 'v', 'f', 'p') -- o[r]dinary table, [v]iew, [f]oreign table, [p]artitioned table. Other values are [i]ndex, [S]equence, [c]omposite type, [t]OAST table, [m]aterialized view\n and col.attnum > 0 -- negative numbers are used for system columns such as oid\n and not col.attisdropped -- column as not been dropped\n\n order by\n sch.nspname,\n tbl.relname,\n col.attnum\n\n {%- endcall -%}\n\n {{ return(load_result('catalog').table) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.139176, "supported_languages": null}, "macro.dbt_postgres.postgres_get_relations": {"unique_id": "macro.dbt_postgres.postgres_get_relations", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/relations.sql", "original_file_path": "macros/relations.sql", "name": "postgres_get_relations", "macro_sql": "{% macro postgres_get_relations () -%}\n\n {#\n -- in pg_depend, objid is the dependent, refobjid is the referenced object\n -- > a pg_depend entry indicates that the referenced object cannot be\n -- > dropped without also dropping the dependent object.\n #}\n\n {%- call statement('relations', fetch_result=True) -%}\n with relation as (\n select\n pg_rewrite.ev_class as class,\n pg_rewrite.oid as id\n from pg_rewrite\n ),\n class as (\n select\n oid as id,\n relname as name,\n relnamespace as schema,\n relkind as kind\n from pg_class\n ),\n dependency as (\n select distinct\n pg_depend.objid as id,\n pg_depend.refobjid as ref\n from pg_depend\n ),\n schema as (\n select\n pg_namespace.oid as id,\n pg_namespace.nspname as name\n from pg_namespace\n where nspname != 'information_schema' and nspname not like 'pg\\_%'\n ),\n referenced as (\n select\n relation.id AS id,\n referenced_class.name ,\n referenced_class.schema ,\n referenced_class.kind\n from relation\n join class as referenced_class on relation.class=referenced_class.id\n where referenced_class.kind in ('r', 'v')\n ),\n relationships as (\n select\n referenced.name as referenced_name,\n referenced.schema as referenced_schema_id,\n dependent_class.name as dependent_name,\n dependent_class.schema as dependent_schema_id,\n referenced.kind as kind\n from referenced\n join dependency on referenced.id=dependency.id\n join class as dependent_class on dependency.ref=dependent_class.id\n where\n (referenced.name != dependent_class.name or\n referenced.schema != dependent_class.schema)\n )\n\n select\n referenced_schema.name as referenced_schema,\n relationships.referenced_name as referenced_name,\n dependent_schema.name as dependent_schema,\n relationships.dependent_name as dependent_name\n from relationships\n join schema as dependent_schema on relationships.dependent_schema_id=dependent_schema.id\n join schema as referenced_schema on relationships.referenced_schema_id=referenced_schema.id\n group by referenced_schema, referenced_name, dependent_schema, dependent_name\n order by referenced_schema, referenced_name, dependent_schema, dependent_name;\n\n {%- endcall -%}\n\n {{ return(load_result('relations').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.13985, "supported_languages": null}, "macro.dbt_postgres.postgres__create_table_as": {"unique_id": "macro.dbt_postgres.postgres__create_table_as", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__create_table_as", "macro_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.145355, "supported_languages": null}, "macro.dbt_postgres.postgres__get_create_index_sql": {"unique_id": "macro.dbt_postgres.postgres__get_create_index_sql", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__get_create_index_sql", "macro_sql": "{% macro postgres__get_create_index_sql(relation, index_dict) -%}\n {%- set index_config = adapter.parse_index(index_dict) -%}\n {%- set comma_separated_columns = \", \".join(index_config.columns) -%}\n {%- set index_name = index_config.render(relation) -%}\n\n create {% if index_config.unique -%}\n unique\n {%- endif %} index if not exists\n \"{{ index_name }}\"\n on {{ relation }} {% if index_config.type -%}\n using {{ index_config.type }}\n {%- endif %}\n ({{ comma_separated_columns }});\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.145859, "supported_languages": null}, "macro.dbt_postgres.postgres__create_schema": {"unique_id": "macro.dbt_postgres.postgres__create_schema", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__create_schema", "macro_sql": "{% macro postgres__create_schema(relation) -%}\n {% if relation.database -%}\n {{ adapter.verify_database(relation.database) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier().include(database=False) }}\n {%- endcall -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.1461818, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_schema": {"unique_id": "macro.dbt_postgres.postgres__drop_schema", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__drop_schema", "macro_sql": "{% macro postgres__drop_schema(relation) -%}\n {% if relation.database -%}\n {{ adapter.verify_database(relation.database) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier().include(database=False) }} cascade\n {%- endcall -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.146503, "supported_languages": null}, "macro.dbt_postgres.postgres__get_columns_in_relation": {"unique_id": "macro.dbt_postgres.postgres__get_columns_in_relation", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__get_columns_in_relation", "macro_sql": "{% macro postgres__get_columns_in_relation(relation) -%}\n {% call statement('get_columns_in_relation', fetch_result=True) %}\n select\n column_name,\n data_type,\n character_maximum_length,\n numeric_precision,\n numeric_scale\n\n from {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\n {% endif %}\n order by ordinal_position\n\n {% endcall %}\n {% set table = load_result('get_columns_in_relation').table %}\n {{ return(sql_convert_columns_in_relation(table)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.sql_convert_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.1469681, "supported_languages": null}, "macro.dbt_postgres.postgres__list_relations_without_caching": {"unique_id": "macro.dbt_postgres.postgres__list_relations_without_caching", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__list_relations_without_caching", "macro_sql": "{% macro postgres__list_relations_without_caching(schema_relation) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ schema_relation.database }}' as database,\n tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema_relation.schema }}'\n union all\n select\n '{{ schema_relation.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema_relation.schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.147337, "supported_languages": null}, "macro.dbt_postgres.postgres__information_schema_name": {"unique_id": "macro.dbt_postgres.postgres__information_schema_name", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__information_schema_name", "macro_sql": "{% macro postgres__information_schema_name(database) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n information_schema\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.147507, "supported_languages": null}, "macro.dbt_postgres.postgres__list_schemas": {"unique_id": "macro.dbt_postgres.postgres__list_schemas", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__list_schemas", "macro_sql": "{% macro postgres__list_schemas(database) %}\n {% if database -%}\n {{ adapter.verify_database(database) }}\n {%- endif -%}\n {% call statement('list_schemas', fetch_result=True, auto_begin=False) %}\n select distinct nspname from pg_namespace\n {% endcall %}\n {{ return(load_result('list_schemas').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.147845, "supported_languages": null}, "macro.dbt_postgres.postgres__check_schema_exists": {"unique_id": "macro.dbt_postgres.postgres__check_schema_exists", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__check_schema_exists", "macro_sql": "{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.148303, "supported_languages": null}, "macro.dbt_postgres.postgres__make_relation_with_suffix": {"unique_id": "macro.dbt_postgres.postgres__make_relation_with_suffix", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__make_relation_with_suffix", "macro_sql": "{% macro postgres__make_relation_with_suffix(base_relation, suffix, dstring) %}\n {% if dstring %}\n {% set dt = modules.datetime.datetime.now() %}\n {% set dtstring = dt.strftime(\"%H%M%S%f\") %}\n {% set suffix = suffix ~ dtstring %}\n {% endif %}\n {% set suffix_length = suffix|length %}\n {% set relation_max_name_length = base_relation.relation_max_name_length() %}\n {% if suffix_length > relation_max_name_length %}\n {% do exceptions.raise_compiler_error('Relation suffix is too long (' ~ suffix_length ~ ' characters). Maximum length is ' ~ relation_max_name_length ~ ' characters.') %}\n {% endif %}\n {% set identifier = base_relation.identifier[:relation_max_name_length - suffix_length] ~ suffix %}\n\n {{ return(base_relation.incorporate(path={\"identifier\": identifier })) }}\n\n {% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.14916, "supported_languages": null}, "macro.dbt_postgres.postgres__make_intermediate_relation": {"unique_id": "macro.dbt_postgres.postgres__make_intermediate_relation", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__make_intermediate_relation", "macro_sql": "{% macro postgres__make_intermediate_relation(base_relation, suffix) %}\n {{ return(postgres__make_relation_with_suffix(base_relation, suffix, dstring=False)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.149354, "supported_languages": null}, "macro.dbt_postgres.postgres__make_temp_relation": {"unique_id": "macro.dbt_postgres.postgres__make_temp_relation", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__make_temp_relation", "macro_sql": "{% macro postgres__make_temp_relation(base_relation, suffix) %}\n {% set temp_relation = postgres__make_relation_with_suffix(base_relation, suffix, dstring=True) %}\n {{ return(temp_relation.incorporate(path={\"schema\": none,\n \"database\": none})) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.149667, "supported_languages": null}, "macro.dbt_postgres.postgres__make_backup_relation": {"unique_id": "macro.dbt_postgres.postgres__make_backup_relation", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__make_backup_relation", "macro_sql": "{% macro postgres__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {% set backup_relation = postgres__make_relation_with_suffix(base_relation, suffix, dstring=False) %}\n {{ return(backup_relation.incorporate(type=backup_relation_type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.149937, "supported_languages": null}, "macro.dbt_postgres.postgres_escape_comment": {"unique_id": "macro.dbt_postgres.postgres_escape_comment", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres_escape_comment", "macro_sql": "{% macro postgres_escape_comment(comment) -%}\n {% if comment is not string %}\n {% do exceptions.raise_compiler_error('cannot escape a non-string: ' ~ comment) %}\n {% endif %}\n {%- set magic = '$dbt_comment_literal_block$' -%}\n {%- if magic in comment -%}\n {%- do exceptions.raise_compiler_error('The string ' ~ magic ~ ' is not allowed in comments.') -%}\n {%- endif -%}\n {{ magic }}{{ comment }}{{ magic }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.150348, "supported_languages": null}, "macro.dbt_postgres.postgres__alter_relation_comment": {"unique_id": "macro.dbt_postgres.postgres__alter_relation_comment", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__alter_relation_comment", "macro_sql": "{% macro postgres__alter_relation_comment(relation, comment) %}\n {% set escaped_comment = postgres_escape_comment(comment) %}\n comment on {{ relation.type }} {{ relation }} is {{ escaped_comment }};\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres_escape_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.150573, "supported_languages": null}, "macro.dbt_postgres.postgres__alter_column_comment": {"unique_id": "macro.dbt_postgres.postgres__alter_column_comment", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__alter_column_comment", "macro_sql": "{% macro postgres__alter_column_comment(relation, column_dict) %}\n {% set existing_columns = adapter.get_columns_in_relation(relation) | map(attribute=\"name\") | list %}\n {% for column_name in column_dict if (column_name in existing_columns) %}\n {% set comment = column_dict[column_name]['description'] %}\n {% set escaped_comment = postgres_escape_comment(comment) %}\n comment on column {{ relation }}.{{ adapter.quote(column_name) if column_dict[column_name]['quote'] else column_name }} is {{ escaped_comment }};\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres_escape_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.1511722, "supported_languages": null}, "macro.dbt_postgres.postgres__get_show_grant_sql": {"unique_id": "macro.dbt_postgres.postgres__get_show_grant_sql", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__get_show_grant_sql", "macro_sql": "\n\n{%- macro postgres__get_show_grant_sql(relation) -%}\n select grantee, privilege_type\n from {{ relation.information_schema('role_table_grants') }}\n where grantor = current_role\n and grantee != current_role\n and table_schema = '{{ relation.schema }}'\n and table_name = '{{ relation.identifier }}'\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.151368, "supported_languages": null}, "macro.dbt_postgres.postgres__copy_grants": {"unique_id": "macro.dbt_postgres.postgres__copy_grants", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "postgres__copy_grants", "macro_sql": "{% macro postgres__copy_grants() %}\n {{ return(False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.1514828, "supported_languages": null}, "macro.dbt_postgres.postgres__get_incremental_default_sql": {"unique_id": "macro.dbt_postgres.postgres__get_incremental_default_sql", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/materializations/incremental_strategies.sql", "original_file_path": "macros/materializations/incremental_strategies.sql", "name": "postgres__get_incremental_default_sql", "macro_sql": "{% macro postgres__get_incremental_default_sql(arg_dict) %}\n\n {% if arg_dict[\"unique_key\"] %}\n {% do return(get_incremental_delete_insert_sql(arg_dict)) %}\n {% else %}\n {% do return(get_incremental_append_sql(arg_dict)) %}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_incremental_delete_insert_sql", "macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.151978, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_merge_sql": {"unique_id": "macro.dbt_postgres.postgres__snapshot_merge_sql", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/materializations/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshot_merge.sql", "name": "postgres__snapshot_merge_sql", "macro_sql": "{% macro postgres__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n update {{ target }}\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.dbt_scd_id::text = {{ target }}.dbt_scd_id::text\n and DBT_INTERNAL_SOURCE.dbt_change_type::text in ('update'::text, 'delete'::text)\n and {{ target }}.dbt_valid_to is null;\n\n insert into {{ target }} ({{ insert_cols_csv }})\n select {% for column in insert_cols -%}\n DBT_INTERNAL_SOURCE.{{ column }} {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.dbt_change_type::text = 'insert'::text;\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.1527622, "supported_languages": null}, "macro.dbt_postgres.postgres__dateadd": {"unique_id": "macro.dbt_postgres.postgres__dateadd", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "name": "postgres__dateadd", "macro_sql": "{% macro postgres__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ from_date_or_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.153049, "supported_languages": null}, "macro.dbt_postgres.postgres__listagg": {"unique_id": "macro.dbt_postgres.postgres__listagg", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "name": "postgres__listagg", "macro_sql": "{% macro postgres__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n (array_agg(\n {{ measure }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n ))[1:{{ limit_num }}],\n {{ delimiter_text }}\n )\n {%- else %}\n string_agg(\n {{ measure }},\n {{ delimiter_text }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n )\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.153746, "supported_languages": null}, "macro.dbt_postgres.postgres__datediff": {"unique_id": "macro.dbt_postgres.postgres__datediff", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "name": "postgres__datediff", "macro_sql": "{% macro postgres__datediff(first_date, second_date, datepart) -%}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.156852, "supported_languages": null}, "macro.dbt_postgres.postgres__any_value": {"unique_id": "macro.dbt_postgres.postgres__any_value", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "name": "postgres__any_value", "macro_sql": "{% macro postgres__any_value(expression) -%}\n\n min({{ expression }})\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.1570728, "supported_languages": null}, "macro.dbt_postgres.postgres__last_day": {"unique_id": "macro.dbt_postgres.postgres__last_day", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "name": "postgres__last_day", "macro_sql": "{% macro postgres__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n -- postgres dateadd does not support quarter interval.\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd('month', '3', dbt.date_trunc(datepart, date))\n )}}\n as date)\n {%- else -%}\n {{dbt.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc", "macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.157629, "supported_languages": null}, "macro.dbt_postgres.postgres__split_part": {"unique_id": "macro.dbt_postgres.postgres__split_part", "package_name": "dbt_postgres", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/postgres", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "name": "postgres__split_part", "macro_sql": "{% macro postgres__split_part(string_text, delimiter_text, part_number) %}\n\n {% if part_number >= 0 %}\n {{ dbt.default__split_part(string_text, delimiter_text, part_number) }}\n {% else %}\n {{ dbt._split_part_negative(string_text, delimiter_text, part_number) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__split_part", "macro.dbt._split_part_negative"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.158098, "supported_languages": null}, "macro.dbt.run_hooks": {"unique_id": "macro.dbt.run_hooks", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.1591868, "supported_languages": null}, "macro.dbt.make_hook_config": {"unique_id": "macro.dbt.make_hook_config", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.159381, "supported_languages": null}, "macro.dbt.before_begin": {"unique_id": "macro.dbt.before_begin", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.1595242, "supported_languages": null}, "macro.dbt.in_transaction": {"unique_id": "macro.dbt.in_transaction", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.1596642, "supported_languages": null}, "macro.dbt.after_commit": {"unique_id": "macro.dbt.after_commit", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.159799, "supported_languages": null}, "macro.dbt.set_sql_header": {"unique_id": "macro.dbt.set_sql_header", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.160225, "supported_languages": null}, "macro.dbt.should_full_refresh": {"unique_id": "macro.dbt.should_full_refresh", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.1605172, "supported_languages": null}, "macro.dbt.should_store_failures": {"unique_id": "macro.dbt.should_store_failures", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.1608179, "supported_languages": null}, "macro.dbt.snapshot_merge_sql": {"unique_id": "macro.dbt.snapshot_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "name": "snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.1612952, "supported_languages": null}, "macro.dbt.default__snapshot_merge_sql": {"unique_id": "macro.dbt.default__snapshot_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "name": "default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.dbt_scd_id = DBT_INTERNAL_DEST.dbt_scd_id\n\n when matched\n and DBT_INTERNAL_DEST.dbt_valid_to is null\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.1615622, "supported_languages": null}, "macro.dbt.strategy_dispatch": {"unique_id": "macro.dbt.strategy_dispatch", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "strategy_dispatch", "macro_sql": "{% macro strategy_dispatch(name) -%}\n{% set original_name = name %}\n {% if '.' in name %}\n {% set package_name, name = name.split(\".\", 1) %}\n {% else %}\n {% set package_name = none %}\n {% endif %}\n\n {% if package_name is none %}\n {% set package_context = context %}\n {% elif package_name in context %}\n {% set package_context = context[package_name] %}\n {% else %}\n {% set error_msg %}\n Could not find package '{{package_name}}', called with '{{original_name}}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n\n {%- set search_name = 'snapshot_' ~ name ~ '_strategy' -%}\n\n {% if search_name not in package_context %}\n {% set error_msg %}\n The specified strategy macro '{{name}}' was not found in package '{{ package_name }}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n {{ return(package_context[search_name]) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.164979, "supported_languages": null}, "macro.dbt.snapshot_hash_arguments": {"unique_id": "macro.dbt.snapshot_hash_arguments", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments', 'dbt')(args) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.1651561, "supported_languages": null}, "macro.dbt.default__snapshot_hash_arguments": {"unique_id": "macro.dbt.default__snapshot_hash_arguments", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "default__snapshot_hash_arguments", "macro_sql": "{% macro default__snapshot_hash_arguments(args) -%}\n md5({%- for arg in args -%}\n coalesce(cast({{ arg }} as varchar ), '')\n {% if not loop.last %} || '|' || {% endif %}\n {%- endfor -%})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.1653728, "supported_languages": null}, "macro.dbt.snapshot_timestamp_strategy": {"unique_id": "macro.dbt.snapshot_timestamp_strategy", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_timestamp_strategy", "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set primary_key = config['unique_key'] %}\n {% set updated_at = config['updated_at'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/dbt-labs/dbt-core/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.dbt_valid_from < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.166083, "supported_languages": null}, "macro.dbt.snapshot_string_as_time": {"unique_id": "macro.dbt.snapshot_string_as_time", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time', 'dbt')(timestamp) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.1662521, "supported_languages": null}, "macro.dbt.default__snapshot_string_as_time": {"unique_id": "macro.dbt.default__snapshot_string_as_time", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "default__snapshot_string_as_time", "macro_sql": "{% macro default__snapshot_string_as_time(timestamp) %}\n {% do exceptions.raise_not_implemented(\n 'snapshot_string_as_time macro not implemented for adapter '+adapter.type()\n ) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.1664221, "supported_languages": null}, "macro.dbt.snapshot_check_all_get_existing_columns": {"unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) -%}\n {%- if not target_exists -%}\n {#-- no table yet -> return whatever the query does --#}\n {{ return((false, query_columns)) }}\n {%- endif -%}\n\n {#-- handle any schema changes --#}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=node.alias) -%}\n\n {% if check_cols_config == 'all' %}\n {%- set query_columns = get_columns_in_query(node['compiled_code']) -%}\n\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {#-- query for proper casing/quoting, to support comparison below --#}\n {%- set select_check_cols_from_target -%}\n select {{ check_cols_config | join(', ') }} from ({{ node['compiled_code'] }}) subq\n {%- endset -%}\n {% set query_columns = get_columns_in_query(select_check_cols_from_target) %}\n\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set existing_cols = adapter.get_columns_in_relation(target_relation) | map(attribute = 'name') | list -%}\n {%- set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(adapter.quote(col)) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return((ns.column_added, intersection)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.167765, "supported_languages": null}, "macro.dbt.snapshot_check_strategy": {"unique_id": "macro.dbt.snapshot_check_strategy", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set check_cols_config = config['check_cols'] %}\n {% set primary_key = config['unique_key'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n {% set updated_at = config.get('updated_at', snapshot_get_time()) %}\n\n {% set column_added = false %}\n\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n {{ get_true_sql() }}\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.get_true_sql", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.1690629, "supported_languages": null}, "macro.dbt.create_columns": {"unique_id": "macro.dbt.create_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns', 'dbt')(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.1727538, "supported_languages": null}, "macro.dbt.default__create_columns": {"unique_id": "macro.dbt.default__create_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation }} add column \"{{ column.name }}\" {{ column.data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.173032, "supported_languages": null}, "macro.dbt.post_snapshot": {"unique_id": "macro.dbt.post_snapshot", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.173196, "supported_languages": null}, "macro.dbt.default__post_snapshot": {"unique_id": "macro.dbt.default__post_snapshot", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.17328, "supported_languages": null}, "macro.dbt.get_true_sql": {"unique_id": "macro.dbt.get_true_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "get_true_sql", "macro_sql": "{% macro get_true_sql() %}\n {{ adapter.dispatch('get_true_sql', 'dbt')() }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_true_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.173423, "supported_languages": null}, "macro.dbt.default__get_true_sql": {"unique_id": "macro.dbt.default__get_true_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__get_true_sql", "macro_sql": "{% macro default__get_true_sql() %}\n {{ return('TRUE') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.1735308, "supported_languages": null}, "macro.dbt.snapshot_staging_table": {"unique_id": "macro.dbt.snapshot_staging_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "snapshot_staging_table", "macro_sql": "{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {{ adapter.dispatch('snapshot_staging_table', 'dbt')(strategy, source_sql, target_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_staging_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.173729, "supported_languages": null}, "macro.dbt.default__snapshot_staging_table": {"unique_id": "macro.dbt.default__snapshot_staging_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__snapshot_staging_table", "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *,\n {{ strategy.unique_key }} as dbt_unique_key\n\n from {{ target_relation }}\n where dbt_valid_to is null\n\n ),\n\n insertions_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to,\n {{ strategy.scd_id }} as dbt_scd_id\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n {{ strategy.updated_at }} as dbt_valid_to\n\n from snapshot_query\n ),\n\n {%- if strategy.invalidate_hard_deletes %}\n\n deletes_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from insertions_source_data as source_data\n left outer join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_unique_key is null\n or (\n snapshotted_data.dbt_unique_key is not null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.dbt_scd_id\n\n from updates_source_data as source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where (\n {{ strategy.row_changed }}\n )\n )\n\n {%- if strategy.invalidate_hard_deletes -%}\n ,\n\n deletes as (\n\n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as dbt_valid_from,\n {{ snapshot_get_time() }} as dbt_updated_at,\n {{ snapshot_get_time() }} as dbt_valid_to,\n snapshotted_data.dbt_scd_id\n\n from snapshotted_data\n left join deletes_source_data as source_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where source_data.dbt_unique_key is null\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.invalidate_hard_deletes %}\n union all\n select * from deletes\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.1745842, "supported_languages": null}, "macro.dbt.build_snapshot_table": {"unique_id": "macro.dbt.build_snapshot_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) -%}\n {{ adapter.dispatch('build_snapshot_table', 'dbt')(strategy, sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__build_snapshot_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.1747682, "supported_languages": null}, "macro.dbt.default__build_snapshot_table": {"unique_id": "macro.dbt.default__build_snapshot_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__build_snapshot_table", "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.175012, "supported_languages": null}, "macro.dbt.build_snapshot_staging_table": {"unique_id": "macro.dbt.build_snapshot_staging_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set temp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, temp_relation, select) }}\n {% endcall %}\n\n {% do return(temp_relation) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.175437, "supported_languages": null}, "macro.dbt.materialization_snapshot_default": {"unique_id": "macro.dbt.materialization_snapshot_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot.sql", "original_file_path": "macros/materializations/snapshots/snapshot.sql", "name": "materialization_snapshot_default", "macro_sql": "{% materialization snapshot, default %}\n {%- set config = model['config'] -%}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\n\n {% set target_relation_exists, target_relation = get_or_create_relation(\n database=model.database,\n schema=model.schema,\n identifier=target_table,\n type='table') -%}\n\n {%- if not target_relation.is_table -%}\n {% do exceptions.relation_wrong_type(target_relation, 'table') %}\n {%- endif -%}\n\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set strategy_macro = strategy_dispatch(strategy_name) %}\n {% set strategy = strategy_macro(model, \"snapshotted_data\", \"source_data\", config, target_relation_exists) %}\n\n {% if not target_relation_exists %}\n\n {% set build_sql = build_snapshot_table(strategy, model['compiled_code']) %}\n {% set final_sql = create_table_as(False, target_relation, build_sql) %}\n\n {% else %}\n\n {{ adapter.valid_snapshot_target(target_relation) }}\n\n {% set staging_table = build_snapshot_staging_table(strategy, sql, target_relation) %}\n\n -- this may no-op if the database does not require column expansion\n {% do adapter.expand_target_column_types(from_relation=staging_table,\n to_relation=target_relation) %}\n\n {% set missing_columns = adapter.get_missing_columns(staging_table, target_relation)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% do create_columns(target_relation, missing_columns) %}\n\n {% set source_columns = adapter.get_columns_in_relation(staging_table)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% set quoted_source_columns = [] %}\n {% for column in source_columns %}\n {% do quoted_source_columns.append(adapter.quote(column.name)) %}\n {% endfor %}\n\n {% set final_sql = snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n %}\n\n {% endif %}\n\n {% call statement('main') %}\n {{ final_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(target_relation_exists, full_refresh_mode=False) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if not target_relation_exists %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if staging_table is defined %}\n {% do post_snapshot(staging_table) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_or_create_relation", "macro.dbt.run_hooks", "macro.dbt.strategy_dispatch", "macro.dbt.build_snapshot_table", "macro.dbt.create_table_as", "macro.dbt.build_snapshot_staging_table", "macro.dbt.create_columns", "macro.dbt.snapshot_merge_sql", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes", "macro.dbt.post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.1811929, "supported_languages": ["sql"]}, "macro.dbt.materialization_test_default": {"unique_id": "macro.dbt.materialization_test_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/test.sql", "original_file_path": "macros/materializations/tests/test.sql", "name": "materialization_test_default", "macro_sql": "{%- materialization test, default -%}\n\n {% set relations = [] %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type='table') -%} %}\n\n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n\n {% call statement(auto_begin=True) %}\n {{ create_table_as(False, target_relation, sql) }}\n {% endcall %}\n\n {% do relations.append(target_relation) %}\n\n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n\n {{ adapter.commit() }}\n\n {% else %}\n\n {% set main_sql = sql %}\n\n {% endif %}\n\n {% set limit = config.get('limit') %}\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit)}}\n\n {%- endcall %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.183237, "supported_languages": ["sql"]}, "macro.dbt.get_test_sql": {"unique_id": "macro.dbt.get_test_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "name": "get_test_sql", "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql', 'dbt')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.1837351, "supported_languages": null}, "macro.dbt.default__get_test_sql": {"unique_id": "macro.dbt.default__get_test_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "name": "default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.184032, "supported_languages": null}, "macro.dbt.get_where_subquery": {"unique_id": "macro.dbt.get_where_subquery", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "name": "get_where_subquery", "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_where_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.184451, "supported_languages": null}, "macro.dbt.default__get_where_subquery": {"unique_id": "macro.dbt.default__get_where_subquery", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "name": "default__get_where_subquery", "macro_sql": "{% macro default__get_where_subquery(relation) -%}\n {% set where = config.get('where', '') %}\n {% if where %}\n {%- set filtered -%}\n (select * from {{ relation }} where {{ where }}) dbt_subquery\n {%- endset -%}\n {% do return(filtered) %}\n {%- else -%}\n {% do return(relation) %}\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.184821, "supported_languages": null}, "macro.dbt.get_quoted_csv": {"unique_id": "macro.dbt.get_quoted_csv", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\n\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.186347, "supported_languages": null}, "macro.dbt.diff_columns": {"unique_id": "macro.dbt.diff_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "diff_columns", "macro_sql": "{% macro diff_columns(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% set source_names = source_columns | map(attribute = 'column') | list %}\n {% set target_names = target_columns | map(attribute = 'column') | list %}\n\n {# --check whether the name attribute exists in the target - this does not perform a data type check #}\n {% for sc in source_columns %}\n {% if sc.name not in target_names %}\n {{ result.append(sc) }}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.186887, "supported_languages": null}, "macro.dbt.diff_column_data_types": {"unique_id": "macro.dbt.diff_column_data_types", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "diff_column_data_types", "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.data_type != tc.data_type and not sc.can_expand_to(other_column=tc) %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.data_type } ) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.1875389, "supported_languages": null}, "macro.dbt.get_merge_update_columns": {"unique_id": "macro.dbt.get_merge_update_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "get_merge_update_columns", "macro_sql": "{% macro get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {{ return(adapter.dispatch('get_merge_update_columns', 'dbt')(merge_update_columns, merge_exclude_columns, dest_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.1877692, "supported_languages": null}, "macro.dbt.default__get_merge_update_columns": {"unique_id": "macro.dbt.default__get_merge_update_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "default__get_merge_update_columns", "macro_sql": "{% macro default__get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {%- set default_cols = dest_columns | map(attribute=\"quoted\") | list -%}\n\n {%- if merge_update_columns and merge_exclude_columns -%}\n {{ exceptions.raise_compiler_error(\n 'Model cannot specify merge_update_columns and merge_exclude_columns. Please update model to use only one config'\n )}}\n {%- elif merge_update_columns -%}\n {%- set update_columns = merge_update_columns -%}\n {%- elif merge_exclude_columns -%}\n {%- set update_columns = [] -%}\n {%- for column in dest_columns -%}\n {% if column.column | lower not in merge_exclude_columns | map(\"lower\") | list %}\n {%- do update_columns.append(column.quoted) -%}\n {% endif %}\n {%- endfor -%}\n {%- else -%}\n {%- set update_columns = default_cols -%}\n {%- endif -%}\n\n {{ return(update_columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.1884632, "supported_languages": null}, "macro.dbt.get_merge_sql": {"unique_id": "macro.dbt.get_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, predicates=none) -%}\n {{ adapter.dispatch('get_merge_sql', 'dbt')(target, source, unique_key, dest_columns, predicates) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.1925912, "supported_languages": null}, "macro.dbt.default__get_merge_sql": {"unique_id": "macro.dbt.default__get_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, predicates) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set merge_update_columns = config.get('merge_update_columns') -%}\n {%- set merge_exclude_columns = config.get('merge_exclude_columns') -%}\n {%- set update_columns = get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not mapping and unique_key is not string %}\n {% for key in unique_key %}\n {% set this_key_match %}\n DBT_INTERNAL_SOURCE.{{ key }} = DBT_INTERNAL_DEST.{{ key }}\n {% endset %}\n {% do predicates.append(this_key_match) %}\n {% endfor %}\n {% else %}\n {% set unique_key_match %}\n DBT_INTERNAL_SOURCE.{{ unique_key }} = DBT_INTERNAL_DEST.{{ unique_key }}\n {% endset %}\n {% do predicates.append(unique_key_match) %}\n {% endif %}\n {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\n\n {{ sql_header if sql_header is not none }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on {{ predicates | join(' and ') }}\n\n {% if unique_key %}\n when matched then update set\n {% for column_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv", "macro.dbt.get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.194188, "supported_languages": null}, "macro.dbt.get_delete_insert_merge_sql": {"unique_id": "macro.dbt.get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql', 'dbt')(target, source, unique_key, dest_columns) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.194426, "supported_languages": null}, "macro.dbt.default__get_delete_insert_merge_sql": {"unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not string %}\n delete from {{target }}\n using {{ source }}\n where (\n {% for key in unique_key %}\n {{ source }}.{{ key }} = {{ target }}.{{ key }}\n {{ \"and \" if not loop.last }}\n {% endfor %}\n );\n {% else %}\n delete from {{ target }}\n where (\n {{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n );\n\n {% endif %}\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.1951501, "supported_languages": null}, "macro.dbt.get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql', 'dbt')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.195416, "supported_languages": null}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {#-- The only time include_sql_header is True: --#}\n {#-- BigQuery + insert_overwrite strategy + \"static\" partitions config --#}\n {#-- We should consider including the sql header at the materialization level instead --#}\n\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.19605, "supported_languages": null}, "macro.dbt.is_incremental": {"unique_id": "macro.dbt.is_incremental", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/is_incremental.sql", "original_file_path": "macros/materializations/models/incremental/is_incremental.sql", "name": "is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.196758, "supported_languages": null}, "macro.dbt.get_incremental_append_sql": {"unique_id": "macro.dbt.get_incremental_append_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_append_sql", "macro_sql": "{% macro get_incremental_append_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_append_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.197633, "supported_languages": null}, "macro.dbt.default__get_incremental_append_sql": {"unique_id": "macro.dbt.default__get_incremental_append_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_append_sql", "macro_sql": "{% macro default__get_incremental_append_sql(arg_dict) %}\n\n {% do return(get_insert_into_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_insert_into_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.197869, "supported_languages": null}, "macro.dbt.get_incremental_delete_insert_sql": {"unique_id": "macro.dbt.get_incremental_delete_insert_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_delete_insert_sql", "macro_sql": "{% macro get_incremental_delete_insert_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_delete_insert_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_delete_insert_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.1980538, "supported_languages": null}, "macro.dbt.default__get_incremental_delete_insert_sql": {"unique_id": "macro.dbt.default__get_incremental_delete_insert_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_delete_insert_sql", "macro_sql": "{% macro default__get_incremental_delete_insert_sql(arg_dict) %}\n\n {% do return(get_delete_insert_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.19831, "supported_languages": null}, "macro.dbt.get_incremental_merge_sql": {"unique_id": "macro.dbt.get_incremental_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_merge_sql", "macro_sql": "{% macro get_incremental_merge_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.198497, "supported_languages": null}, "macro.dbt.default__get_incremental_merge_sql": {"unique_id": "macro.dbt.default__get_incremental_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_merge_sql", "macro_sql": "{% macro default__get_incremental_merge_sql(arg_dict) %}\n\n {% do return(get_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.198751, "supported_languages": null}, "macro.dbt.get_incremental_insert_overwrite_sql": {"unique_id": "macro.dbt.get_incremental_insert_overwrite_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_insert_overwrite_sql", "macro_sql": "{% macro get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_insert_overwrite_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_insert_overwrite_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.1989398, "supported_languages": null}, "macro.dbt.default__get_incremental_insert_overwrite_sql": {"unique_id": "macro.dbt.default__get_incremental_insert_overwrite_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_insert_overwrite_sql", "macro_sql": "{% macro default__get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {% do return(get_insert_overwrite_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"], arg_dict[\"predicates\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.199199, "supported_languages": null}, "macro.dbt.get_incremental_default_sql": {"unique_id": "macro.dbt.get_incremental_default_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_incremental_default_sql", "macro_sql": "{% macro get_incremental_default_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_default_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_incremental_default_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.1993768, "supported_languages": null}, "macro.dbt.default__get_incremental_default_sql": {"unique_id": "macro.dbt.default__get_incremental_default_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "default__get_incremental_default_sql", "macro_sql": "{% macro default__get_incremental_default_sql(arg_dict) %}\n\n {% do return(get_incremental_append_sql(arg_dict)) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.1995258, "supported_languages": null}, "macro.dbt.get_insert_into_sql": {"unique_id": "macro.dbt.get_insert_into_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "get_insert_into_sql", "macro_sql": "{% macro get_insert_into_sql(target_relation, temp_relation, dest_columns) %}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ temp_relation }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.1997921, "supported_languages": null}, "macro.dbt.materialization_incremental_default": {"unique_id": "macro.dbt.materialization_incremental_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/incremental.sql", "original_file_path": "macros/materializations/models/incremental/incremental.sql", "name": "materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% if existing_relation is none %}\n {% set build_sql = get_create_table_as_sql(False, target_relation, sql) %}\n {% elif full_refresh_mode %}\n {% set build_sql = get_create_table_as_sql(False, intermediate_relation, sql) %}\n {% set need_swap = true %}\n {% else %}\n {% do run_query(get_create_table_as_sql(True, temp_relation, sql)) %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set incremental_predicates = config.get('incremental_predicates', none) %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.get_create_table_as_sql", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.204593, "supported_languages": ["sql"]}, "macro.dbt.incremental_validate_on_schema_change": {"unique_id": "macro.dbt.incremental_validate_on_schema_change", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "incremental_validate_on_schema_change", "macro_sql": "{% macro incremental_validate_on_schema_change(on_schema_change, default='ignore') %}\n\n {% if on_schema_change not in ['sync_all_columns', 'append_new_columns', 'fail', 'ignore'] %}\n\n {% set log_message = 'Invalid value for on_schema_change (%s) specified. Setting default value of %s.' % (on_schema_change, default) %}\n {% do log(log_message) %}\n\n {{ return(default) }}\n\n {% else %}\n\n {{ return(on_schema_change) }}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2095912, "supported_languages": null}, "macro.dbt.check_for_schema_changes": {"unique_id": "macro.dbt.check_for_schema_changes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "check_for_schema_changes", "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n\n {% set schema_changed = False %}\n\n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n\n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n\n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.diff_columns", "macro.dbt.diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.210784, "supported_languages": null}, "macro.dbt.sync_column_schemas": {"unique_id": "macro.dbt.sync_column_schemas", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "sync_column_schemas", "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n\n {% elif on_schema_change == 'sync_all_columns' %}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n\n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n\n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n\n {% do log(schema_change_message) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.alter_relation_add_remove_columns", "macro.dbt.alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.212276, "supported_languages": null}, "macro.dbt.process_schema_changes": {"unique_id": "macro.dbt.process_schema_changes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "process_schema_changes", "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n\n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n\n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n\n {% if schema_changes_dict['schema_changed'] %}\n\n {% if on_schema_change == 'fail' %}\n\n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways:\n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n\n Additional troubleshooting context:\n Source columns not in target: {{ schema_changes_dict['source_not_in_target'] }}\n Target columns not in source: {{ schema_changes_dict['target_not_in_source'] }}\n New column types: {{ schema_changes_dict['new_target_types'] }}\n {% endset %}\n\n {% do exceptions.raise_compiler_error(fail_msg) %}\n\n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n\n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {% endif %}\n\n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.213192, "supported_languages": null}, "macro.dbt.materialization_table_default": {"unique_id": "macro.dbt.materialization_table_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/table.sql", "original_file_path": "macros/materializations/models/table/table.sql", "name": "materialization_table_default", "macro_sql": "{% materialization table, default %}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do create_indexes(target_relation) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.get_create_table_as_sql", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.215839, "supported_languages": ["sql"]}, "macro.dbt.get_create_table_as_sql": {"unique_id": "macro.dbt.get_create_table_as_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "get_create_table_as_sql", "macro_sql": "{% macro get_create_table_as_sql(temporary, relation, sql) -%}\n {{ adapter.dispatch('get_create_table_as_sql', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_table_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.216425, "supported_languages": null}, "macro.dbt.default__get_create_table_as_sql": {"unique_id": "macro.dbt.default__get_create_table_as_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "default__get_create_table_as_sql", "macro_sql": "{% macro default__get_create_table_as_sql(temporary, relation, sql) -%}\n {{ return(create_table_as(temporary, relation, sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2166111, "supported_languages": null}, "macro.dbt.create_table_as": {"unique_id": "macro.dbt.create_table_as", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {# backward compatibility for create_table_as that does not support language #}\n {% if language == \"sql\" %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code)}}\n {% else %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code, language) }}\n {% endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.217033, "supported_languages": null}, "macro.dbt.default__create_table_as": {"unique_id": "macro.dbt.default__create_table_as", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.21744, "supported_languages": null}, "macro.dbt.materialization_view_default": {"unique_id": "macro.dbt.materialization_view_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/view.sql", "original_file_path": "macros/materializations/models/view/view.sql", "name": "materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='view') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n This relation (probably) doesn't exist yet. If it does exist, it's a leftover from\n a previous run, and we're going to try to drop it immediately. At the end of this\n materialization, we're going to rename the \"existing_relation\" to this identifier,\n and then we're going to drop it. In order to make sure we run the correct one of:\n - drop view ...\n - drop table ...\n\n We need to set the type of this relation to be the type of the existing_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the existing_relation does not\n exist, then there is nothing to move out of the way and subsequentally drop. In that case,\n this relation will be effectively unused.\n */\n {%- set backup_relation_type = 'view' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.22018, "supported_languages": ["sql"]}, "macro.dbt.handle_existing_table": {"unique_id": "macro.dbt.handle_existing_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/helpers.sql", "original_file_path": "macros/materializations/models/view/helpers.sql", "name": "handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.220642, "supported_languages": null}, "macro.dbt.default__handle_existing_table": {"unique_id": "macro.dbt.default__handle_existing_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/helpers.sql", "original_file_path": "macros/materializations/models/view/helpers.sql", "name": "default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2208672, "supported_languages": null}, "macro.dbt.create_or_replace_view": {"unique_id": "macro.dbt.create_or_replace_view", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/models/view/create_or_replace_view.sql", "name": "create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {% set should_revoke = should_revoke(exists_as_view, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=True) %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2224169, "supported_languages": null}, "macro.dbt.get_create_view_as_sql": {"unique_id": "macro.dbt.get_create_view_as_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "get_create_view_as_sql", "macro_sql": "{% macro get_create_view_as_sql(relation, sql) -%}\n {{ adapter.dispatch('get_create_view_as_sql', 'dbt')(relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.222854, "supported_languages": null}, "macro.dbt.default__get_create_view_as_sql": {"unique_id": "macro.dbt.default__get_create_view_as_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "default__get_create_view_as_sql", "macro_sql": "{% macro default__get_create_view_as_sql(relation, sql) -%}\n {{ return(create_view_as(relation, sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.223017, "supported_languages": null}, "macro.dbt.create_view_as": {"unique_id": "macro.dbt.create_view_as", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2231941, "supported_languages": null}, "macro.dbt.default__create_view_as": {"unique_id": "macro.dbt.default__create_view_as", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation }} as (\n {{ sql }}\n );\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.223449, "supported_languages": null}, "macro.dbt.materialization_seed_default": {"unique_id": "macro.dbt.materialization_seed_default", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/seed.sql", "original_file_path": "macros/materializations/seeds/seed.sql", "name": "materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set grant_config = config.get('grants') -%}\n {%- set agate_table = load_agate_table() -%}\n -- grab current tables grants config for comparision later on\n\n {%- do store_result('agate_table', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation)) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', code ~ ' ' ~ rows_affected, code, rows_affected) %}\n {{ get_csv_sql(create_table_sql, sql) }};\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if full_refresh_mode or not exists_as_table %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.run_hooks", "macro.dbt.reset_csv_table", "macro.dbt.create_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.noop_statement", "macro.dbt.get_csv_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.248986, "supported_languages": ["sql"]}, "macro.dbt.create_csv_table": {"unique_id": "macro.dbt.create_csv_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.253688, "supported_languages": null}, "macro.dbt.default__create_csv_table": {"unique_id": "macro.dbt.default__create_csv_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.254585, "supported_languages": null}, "macro.dbt.reset_csv_table": {"unique_id": "macro.dbt.reset_csv_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table', 'dbt')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.25482, "supported_languages": null}, "macro.dbt.default__reset_csv_table": {"unique_id": "macro.dbt.default__reset_csv_table", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.255297, "supported_languages": null}, "macro.dbt.get_csv_sql": {"unique_id": "macro.dbt.get_csv_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_csv_sql", "macro_sql": "{% macro get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ adapter.dispatch('get_csv_sql', 'dbt')(create_or_truncate_sql, insert_sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_csv_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2554922, "supported_languages": null}, "macro.dbt.default__get_csv_sql": {"unique_id": "macro.dbt.default__get_csv_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_csv_sql", "macro_sql": "{% macro default__get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ create_or_truncate_sql }};\n -- dbt seed --\n {{ insert_sql }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2556229, "supported_languages": null}, "macro.dbt.get_binding_char": {"unique_id": "macro.dbt.get_binding_char", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_binding_char", "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.25579, "supported_languages": null}, "macro.dbt.default__get_binding_char": {"unique_id": "macro.dbt.default__get_binding_char", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_binding_char", "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2559118, "supported_languages": null}, "macro.dbt.get_batch_size": {"unique_id": "macro.dbt.get_batch_size", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_batch_size", "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_batch_size"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.25607, "supported_languages": null}, "macro.dbt.default__get_batch_size": {"unique_id": "macro.dbt.default__get_batch_size", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_batch_size", "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2561831, "supported_languages": null}, "macro.dbt.get_seed_column_quoted_csv": {"unique_id": "macro.dbt.get_seed_column_quoted_csv", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2566469, "supported_languages": null}, "macro.dbt.load_csv_rows": {"unique_id": "macro.dbt.load_csv_rows", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.256835, "supported_languages": null}, "macro.dbt.default__load_csv_rows": {"unique_id": "macro.dbt.default__load_csv_rows", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n\n {% set batch_size = get_batch_size() %}\n\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.258166, "supported_languages": null}, "macro.dbt.generate_alias_name": {"unique_id": "macro.dbt.generate_alias_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "name": "generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_alias_name', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_alias_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.258723, "supported_languages": null}, "macro.dbt.default__generate_alias_name": {"unique_id": "macro.dbt.default__generate_alias_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "name": "default__generate_alias_name", "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name is none -%}\n\n {{ node.name }}\n\n {%- else -%}\n\n {{ custom_alias_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.25897, "supported_languages": null}, "macro.dbt.generate_schema_name": {"unique_id": "macro.dbt.generate_schema_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name=none, node=none) -%}\n {{ return(adapter.dispatch('generate_schema_name', 'dbt')(custom_schema_name, node)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.259613, "supported_languages": null}, "macro.dbt.default__generate_schema_name": {"unique_id": "macro.dbt.default__generate_schema_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.259886, "supported_languages": null}, "macro.dbt.generate_schema_name_for_env": {"unique_id": "macro.dbt.generate_schema_name_for_env", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.260185, "supported_languages": null}, "macro.dbt.generate_database_name": {"unique_id": "macro.dbt.generate_database_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "name": "generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name', 'dbt')(custom_database_name, node)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2606468, "supported_languages": null}, "macro.dbt.default__generate_database_name": {"unique_id": "macro.dbt.default__generate_database_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "name": "default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.260897, "supported_languages": null}, "macro.dbt.default__test_relationships": {"unique_id": "macro.dbt.default__test_relationships", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/relationships.sql", "original_file_path": "macros/generic_test_sql/relationships.sql", "name": "default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.261334, "supported_languages": null}, "macro.dbt.default__test_not_null": {"unique_id": "macro.dbt.default__test_not_null", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/not_null.sql", "original_file_path": "macros/generic_test_sql/not_null.sql", "name": "default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else column_name %}\n\nselect {{ column_list }}\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.261707, "supported_languages": null}, "macro.dbt.default__test_unique": {"unique_id": "macro.dbt.default__test_unique", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/unique.sql", "original_file_path": "macros/generic_test_sql/unique.sql", "name": "default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.262014, "supported_languages": null}, "macro.dbt.default__test_accepted_values": {"unique_id": "macro.dbt.default__test_accepted_values", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/accepted_values.sql", "original_file_path": "macros/generic_test_sql/accepted_values.sql", "name": "default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by {{ column_name }}\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.26265, "supported_languages": null}, "macro.dbt.statement": {"unique_id": "macro.dbt.statement", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "statement", "macro_sql": "\n{%- macro statement(name=None, fetch_result=False, auto_begin=True, language='sql') -%}\n {%- if execute: -%}\n {%- set compiled_code = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime {} for node \"{}\"'.format(language, model['unique_id'])) }}\n {{ write(compiled_code) }}\n {%- endif -%}\n {%- if language == 'sql'-%}\n {%- set res, table = adapter.execute(compiled_code, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- elif language == 'python' -%}\n {%- set res = submit_python_job(model, compiled_code) -%}\n {#-- TODO: What should table be for python models? --#}\n {%- set table = None -%}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"statement macro didn't get supported language\") %}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.264135, "supported_languages": null}, "macro.dbt.noop_statement": {"unique_id": "macro.dbt.noop_statement", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2647748, "supported_languages": null}, "macro.dbt.run_query": {"unique_id": "macro.dbt.run_query", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.265068, "supported_languages": null}, "macro.dbt.convert_datetime": {"unique_id": "macro.dbt.convert_datetime", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "convert_datetime", "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2667992, "supported_languages": null}, "macro.dbt.dates_in_range": {"unique_id": "macro.dbt.dates_in_range", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "dates_in_range", "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n Partiton start date is after the end date ({{ start_date }}, {{ end_date }})\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg, model) }}\n {% endif %}\n\n {% set date_list = [] %}\n {% for i in range(0, day_count + 1) %}\n {% set the_date = (modules.datetime.timedelta(days=i) + start_date) %}\n {% if not out_fmt %}\n {% set _ = date_list.append(the_date) %}\n {% else %}\n {% set _ = date_list.append(the_date.strftime(out_fmt)) %}\n {% endif %}\n {% endfor %}\n\n {{ return(date_list) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.26796, "supported_languages": null}, "macro.dbt.partition_range": {"unique_id": "macro.dbt.partition_range", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "partition_range", "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2687, "supported_languages": null}, "macro.dbt.py_current_timestring": {"unique_id": "macro.dbt.py_current_timestring", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "py_current_timestring", "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2689312, "supported_languages": null}, "macro.dbt.except": {"unique_id": "macro.dbt.except", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "name": "except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.269244, "supported_languages": null}, "macro.dbt.default__except": {"unique_id": "macro.dbt.default__except", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "name": "default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2693188, "supported_languages": null}, "macro.dbt.replace": {"unique_id": "macro.dbt.replace", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "name": "replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt') (field, old_chars, new_chars)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.269708, "supported_languages": null}, "macro.dbt.default__replace": {"unique_id": "macro.dbt.default__replace", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "name": "default__replace", "macro_sql": "{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.269869, "supported_languages": null}, "macro.dbt.concat": {"unique_id": "macro.dbt.concat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "name": "concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt')(fields)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.270188, "supported_languages": null}, "macro.dbt.default__concat": {"unique_id": "macro.dbt.default__concat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "name": "default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n {{ fields|join(' || ') }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2703161, "supported_languages": null}, "macro.dbt.length": {"unique_id": "macro.dbt.length", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "name": "length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__length"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.27063, "supported_languages": null}, "macro.dbt.default__length": {"unique_id": "macro.dbt.default__length", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "name": "default__length", "macro_sql": "{% macro default__length(expression) %}\n\n length(\n {{ expression }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.270736, "supported_languages": null}, "macro.dbt.dateadd": {"unique_id": "macro.dbt.dateadd", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "name": "dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.271135, "supported_languages": null}, "macro.dbt.default__dateadd": {"unique_id": "macro.dbt.default__dateadd", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "name": "default__dateadd", "macro_sql": "{% macro default__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_date_or_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.271306, "supported_languages": null}, "macro.dbt.intersect": {"unique_id": "macro.dbt.intersect", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "name": "intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__intersect"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.271606, "supported_languages": null}, "macro.dbt.default__intersect": {"unique_id": "macro.dbt.default__intersect", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "name": "default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.271682, "supported_languages": null}, "macro.dbt.escape_single_quotes": {"unique_id": "macro.dbt.escape_single_quotes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "name": "escape_single_quotes", "macro_sql": "{% macro escape_single_quotes(expression) %}\n {{ return(adapter.dispatch('escape_single_quotes', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__escape_single_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.272011, "supported_languages": null}, "macro.dbt.default__escape_single_quotes": {"unique_id": "macro.dbt.default__escape_single_quotes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "name": "default__escape_single_quotes", "macro_sql": "{% macro default__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\",\"''\") }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2721531, "supported_languages": null}, "macro.dbt.right": {"unique_id": "macro.dbt.right", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "name": "right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt') (string_text, length_expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__right"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2725, "supported_languages": null}, "macro.dbt.default__right": {"unique_id": "macro.dbt.default__right", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "name": "default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.272701, "supported_languages": null}, "macro.dbt.listagg": {"unique_id": "macro.dbt.listagg", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "name": "listagg", "macro_sql": "{% macro listagg(measure, delimiter_text=\"','\", order_by_clause=none, limit_num=none) -%}\n {{ return(adapter.dispatch('listagg', 'dbt') (measure, delimiter_text, order_by_clause, limit_num)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__listagg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.273352, "supported_languages": null}, "macro.dbt.default__listagg": {"unique_id": "macro.dbt.default__listagg", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "name": "default__listagg", "macro_sql": "{% macro default__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n array_slice(\n array_agg(\n {{ measure }}\n ){% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n ,0\n ,{{ limit_num }}\n ),\n {{ delimiter_text }}\n )\n {%- else %}\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n {%- endif %}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2737439, "supported_languages": null}, "macro.dbt.datediff": {"unique_id": "macro.dbt.datediff", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "name": "datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt')(first_date, second_date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.274146, "supported_languages": null}, "macro.dbt.default__datediff": {"unique_id": "macro.dbt.default__datediff", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "name": "default__datediff", "macro_sql": "{% macro default__datediff(first_date, second_date, datepart) -%}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.274302, "supported_languages": null}, "macro.dbt.safe_cast": {"unique_id": "macro.dbt.safe_cast", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "name": "safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt') (field, type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.274647, "supported_languages": null}, "macro.dbt.default__safe_cast": {"unique_id": "macro.dbt.default__safe_cast", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "name": "default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2747881, "supported_languages": null}, "macro.dbt.hash": {"unique_id": "macro.dbt.hash", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "name": "hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt') (field)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.275108, "supported_languages": null}, "macro.dbt.default__hash": {"unique_id": "macro.dbt.default__hash", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "name": "default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{ field }} as {{ api.Column.translate_type('string') }}))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.275264, "supported_languages": null}, "macro.dbt.cast_bool_to_text": {"unique_id": "macro.dbt.cast_bool_to_text", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "name": "cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', 'dbt') (field) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.275574, "supported_languages": null}, "macro.dbt.default__cast_bool_to_text": {"unique_id": "macro.dbt.default__cast_bool_to_text", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "name": "default__cast_bool_to_text", "macro_sql": "{% macro default__cast_bool_to_text(field) %}\n cast({{ field }} as {{ api.Column.translate_type('string') }})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.275732, "supported_languages": null}, "macro.dbt.any_value": {"unique_id": "macro.dbt.any_value", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "name": "any_value", "macro_sql": "{% macro any_value(expression) -%}\n {{ return(adapter.dispatch('any_value', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__any_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.276059, "supported_languages": null}, "macro.dbt.default__any_value": {"unique_id": "macro.dbt.default__any_value", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "name": "default__any_value", "macro_sql": "{% macro default__any_value(expression) -%}\n\n any_value({{ expression }})\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.276166, "supported_languages": null}, "macro.dbt.position": {"unique_id": "macro.dbt.position", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "name": "position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt') (substring_text, string_text)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__position"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2765079, "supported_languages": null}, "macro.dbt.default__position": {"unique_id": "macro.dbt.default__position", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "name": "default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.276644, "supported_languages": null}, "macro.dbt.string_literal": {"unique_id": "macro.dbt.string_literal", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "name": "string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt') (value)) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.276955, "supported_languages": null}, "macro.dbt.default__string_literal": {"unique_id": "macro.dbt.default__string_literal", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "name": "default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.277055, "supported_languages": null}, "macro.dbt.type_string": {"unique_id": "macro.dbt.type_string", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.277992, "supported_languages": null}, "macro.dbt.default__type_string": {"unique_id": "macro.dbt.default__type_string", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_string", "macro_sql": "{% macro default__type_string() %}\n {{ return(api.Column.translate_type(\"string\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2781491, "supported_languages": null}, "macro.dbt.type_timestamp": {"unique_id": "macro.dbt.type_timestamp", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.27838, "supported_languages": null}, "macro.dbt.default__type_timestamp": {"unique_id": "macro.dbt.default__type_timestamp", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n {{ return(api.Column.translate_type(\"timestamp\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.278531, "supported_languages": null}, "macro.dbt.type_float": {"unique_id": "macro.dbt.type_float", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.278692, "supported_languages": null}, "macro.dbt.default__type_float": {"unique_id": "macro.dbt.default__type_float", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_float", "macro_sql": "{% macro default__type_float() %}\n {{ return(api.Column.translate_type(\"float\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.278847, "supported_languages": null}, "macro.dbt.type_numeric": {"unique_id": "macro.dbt.type_numeric", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2790148, "supported_languages": null}, "macro.dbt.default__type_numeric": {"unique_id": "macro.dbt.default__type_numeric", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n {{ return(api.Column.numeric_type(\"numeric\", 28, 6)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.279188, "supported_languages": null}, "macro.dbt.type_bigint": {"unique_id": "macro.dbt.type_bigint", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.279351, "supported_languages": null}, "macro.dbt.default__type_bigint": {"unique_id": "macro.dbt.default__type_bigint", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n {{ return(api.Column.translate_type(\"bigint\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2795022, "supported_languages": null}, "macro.dbt.type_int": {"unique_id": "macro.dbt.type_int", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2796621, "supported_languages": null}, "macro.dbt.default__type_int": {"unique_id": "macro.dbt.default__type_int", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_int", "macro_sql": "{%- macro default__type_int() -%}\n {{ return(api.Column.translate_type(\"integer\")) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.279802, "supported_languages": null}, "macro.dbt.type_boolean": {"unique_id": "macro.dbt.type_boolean", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_boolean", "macro_sql": "\n\n{%- macro type_boolean() -%}\n {{ return(adapter.dispatch('type_boolean', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_boolean"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2799559, "supported_languages": null}, "macro.dbt.default__type_boolean": {"unique_id": "macro.dbt.default__type_boolean", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_boolean", "macro_sql": "{%- macro default__type_boolean() -%}\n {{ return(api.Column.translate_type(\"boolean\")) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2800949, "supported_languages": null}, "macro.dbt.array_concat": {"unique_id": "macro.dbt.array_concat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "name": "array_concat", "macro_sql": "{% macro array_concat(array_1, array_2) -%}\n {{ return(adapter.dispatch('array_concat', 'dbt')(array_1, array_2)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__array_concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.280441, "supported_languages": null}, "macro.dbt.default__array_concat": {"unique_id": "macro.dbt.default__array_concat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "name": "default__array_concat", "macro_sql": "{% macro default__array_concat(array_1, array_2) -%}\n array_cat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.280575, "supported_languages": null}, "macro.dbt.bool_or": {"unique_id": "macro.dbt.bool_or", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "name": "bool_or", "macro_sql": "{% macro bool_or(expression) -%}\n {{ return(adapter.dispatch('bool_or', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__bool_or"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.280891, "supported_languages": null}, "macro.dbt.default__bool_or": {"unique_id": "macro.dbt.default__bool_or", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "name": "default__bool_or", "macro_sql": "{% macro default__bool_or(expression) -%}\n\n bool_or({{ expression }})\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.281003, "supported_languages": null}, "macro.dbt.last_day": {"unique_id": "macro.dbt.last_day", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "name": "last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt') (date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2814069, "supported_languages": null}, "macro.dbt.default_last_day": {"unique_id": "macro.dbt.default_last_day", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "name": "default_last_day", "macro_sql": "\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd(datepart, '1', dbt.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2816792, "supported_languages": null}, "macro.dbt.default__last_day": {"unique_id": "macro.dbt.default__last_day", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "name": "default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt.default_last_day(date, datepart)}}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.281825, "supported_languages": null}, "macro.dbt.split_part": {"unique_id": "macro.dbt.split_part", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "name": "split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ return(adapter.dispatch('split_part', 'dbt') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.282389, "supported_languages": null}, "macro.dbt.default__split_part": {"unique_id": "macro.dbt.default__split_part", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "name": "default__split_part", "macro_sql": "{% macro default__split_part(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n {{ part_number }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2825541, "supported_languages": null}, "macro.dbt._split_part_negative": {"unique_id": "macro.dbt._split_part_negative", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "name": "_split_part_negative", "macro_sql": "{% macro _split_part_negative(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n length({{ string_text }})\n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 2 {{ part_number }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.282846, "supported_languages": null}, "macro.dbt.date_trunc": {"unique_id": "macro.dbt.date_trunc", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "name": "date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt') (datepart, date)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.283196, "supported_languages": null}, "macro.dbt.default__date_trunc": {"unique_id": "macro.dbt.default__date_trunc", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "name": "default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) -%}\n date_trunc('{{datepart}}', {{date}})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.283326, "supported_languages": null}, "macro.dbt.array_construct": {"unique_id": "macro.dbt.array_construct", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "name": "array_construct", "macro_sql": "{% macro array_construct(inputs=[], data_type=api.Column.translate_type('integer')) -%}\n {{ return(adapter.dispatch('array_construct', 'dbt')(inputs, data_type)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__array_construct"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.283763, "supported_languages": null}, "macro.dbt.default__array_construct": {"unique_id": "macro.dbt.default__array_construct", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "name": "default__array_construct", "macro_sql": "{% macro default__array_construct(inputs, data_type) -%}\n {% if inputs|length > 0 %}\n array[ {{ inputs|join(' , ') }} ]\n {% else %}\n array[]::{{data_type}}[]\n {% endif %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2840059, "supported_languages": null}, "macro.dbt.array_append": {"unique_id": "macro.dbt.array_append", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "name": "array_append", "macro_sql": "{% macro array_append(array, new_element) -%}\n {{ return(adapter.dispatch('array_append', 'dbt')(array, new_element)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__array_append"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2843509, "supported_languages": null}, "macro.dbt.default__array_append": {"unique_id": "macro.dbt.default__array_append", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "name": "default__array_append", "macro_sql": "{% macro default__array_append(array, new_element) -%}\n array_append({{ array }}, {{ new_element }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.28448, "supported_languages": null}, "macro.dbt.create_schema": {"unique_id": "macro.dbt.create_schema", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema', 'dbt')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.284912, "supported_languages": null}, "macro.dbt.default__create_schema": {"unique_id": "macro.dbt.default__create_schema", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.285096, "supported_languages": null}, "macro.dbt.drop_schema": {"unique_id": "macro.dbt.drop_schema", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.285259, "supported_languages": null}, "macro.dbt.default__drop_schema": {"unique_id": "macro.dbt.default__drop_schema", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.285438, "supported_languages": null}, "macro.dbt.current_timestamp": {"unique_id": "macro.dbt.current_timestamp", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "current_timestamp", "macro_sql": "{%- macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2859678, "supported_languages": null}, "macro.dbt.default__current_timestamp": {"unique_id": "macro.dbt.default__current_timestamp", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter ' + adapter.type()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2861178, "supported_languages": null}, "macro.dbt.snapshot_get_time": {"unique_id": "macro.dbt.snapshot_get_time", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "snapshot_get_time", "macro_sql": "\n\n{%- macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.28626, "supported_languages": null}, "macro.dbt.default__snapshot_get_time": {"unique_id": "macro.dbt.default__snapshot_get_time", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() %}\n {{ current_timestamp() }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.286365, "supported_languages": null}, "macro.dbt.current_timestamp_backcompat": {"unique_id": "macro.dbt.current_timestamp_backcompat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "current_timestamp_backcompat", "macro_sql": "{% macro current_timestamp_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2865238, "supported_languages": null}, "macro.dbt.default__current_timestamp_backcompat": {"unique_id": "macro.dbt.default__current_timestamp_backcompat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "default__current_timestamp_backcompat", "macro_sql": "{% macro default__current_timestamp_backcompat() %}\n current_timestamp::timestamp\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.286597, "supported_languages": null}, "macro.dbt.current_timestamp_in_utc_backcompat": {"unique_id": "macro.dbt.current_timestamp_in_utc_backcompat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "current_timestamp_in_utc_backcompat", "macro_sql": "{% macro current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_in_utc_backcompat', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.286761, "supported_languages": null}, "macro.dbt.default__current_timestamp_in_utc_backcompat": {"unique_id": "macro.dbt.default__current_timestamp_in_utc_backcompat", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "default__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro default__current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt_postgres.postgres__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.286926, "supported_languages": null}, "macro.dbt.get_create_index_sql": {"unique_id": "macro.dbt.get_create_index_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2874281, "supported_languages": null}, "macro.dbt.default__get_create_index_sql": {"unique_id": "macro.dbt.default__get_create_index_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.28763, "supported_languages": null}, "macro.dbt.create_indexes": {"unique_id": "macro.dbt.create_indexes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes', 'dbt')(relation) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.287785, "supported_languages": null}, "macro.dbt.default__create_indexes": {"unique_id": "macro.dbt.default__create_indexes", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.288177, "supported_languages": null}, "macro.dbt.make_intermediate_relation": {"unique_id": "macro.dbt.make_intermediate_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "make_intermediate_relation", "macro_sql": "{% macro make_intermediate_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_intermediate_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_intermediate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.291212, "supported_languages": null}, "macro.dbt.default__make_intermediate_relation": {"unique_id": "macro.dbt.default__make_intermediate_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__make_intermediate_relation", "macro_sql": "{% macro default__make_intermediate_relation(base_relation, suffix) %}\n {{ return(default__make_temp_relation(base_relation, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.291378, "supported_languages": null}, "macro.dbt.make_temp_relation": {"unique_id": "macro.dbt.make_temp_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.291594, "supported_languages": null}, "macro.dbt.default__make_temp_relation": {"unique_id": "macro.dbt.default__make_temp_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {%- set temp_identifier = base_relation.identifier ~ suffix -%}\n {%- set temp_relation = base_relation.incorporate(\n path={\"identifier\": temp_identifier}) -%}\n\n {{ return(temp_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.291887, "supported_languages": null}, "macro.dbt.make_backup_relation": {"unique_id": "macro.dbt.make_backup_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "make_backup_relation", "macro_sql": "{% macro make_backup_relation(base_relation, backup_relation_type, suffix='__dbt_backup') %}\n {{ return(adapter.dispatch('make_backup_relation', 'dbt')(base_relation, backup_relation_type, suffix)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_backup_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.29213, "supported_languages": null}, "macro.dbt.default__make_backup_relation": {"unique_id": "macro.dbt.default__make_backup_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__make_backup_relation", "macro_sql": "{% macro default__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {%- set backup_identifier = base_relation.identifier ~ suffix -%}\n {%- set backup_relation = base_relation.incorporate(\n path={\"identifier\": backup_identifier},\n type=backup_relation_type\n ) -%}\n {{ return(backup_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2924411, "supported_languages": null}, "macro.dbt.drop_relation": {"unique_id": "macro.dbt.drop_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.29262, "supported_languages": null}, "macro.dbt.default__drop_relation": {"unique_id": "macro.dbt.default__drop_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__drop_relation", "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.29285, "supported_languages": null}, "macro.dbt.truncate_relation": {"unique_id": "macro.dbt.truncate_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.293029, "supported_languages": null}, "macro.dbt.default__truncate_relation": {"unique_id": "macro.dbt.default__truncate_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.293186, "supported_languages": null}, "macro.dbt.rename_relation": {"unique_id": "macro.dbt.rename_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.293382, "supported_languages": null}, "macro.dbt.default__rename_relation": {"unique_id": "macro.dbt.default__rename_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.293658, "supported_languages": null}, "macro.dbt.get_or_create_relation": {"unique_id": "macro.dbt.get_or_create_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) -%}\n {{ return(adapter.dispatch('get_or_create_relation', 'dbt')(database, schema, identifier, type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_or_create_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2939038, "supported_languages": null}, "macro.dbt.default__get_or_create_relation": {"unique_id": "macro.dbt.default__get_or_create_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__get_or_create_relation", "macro_sql": "{% macro default__get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.294456, "supported_languages": null}, "macro.dbt.load_cached_relation": {"unique_id": "macro.dbt.load_cached_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "load_cached_relation", "macro_sql": "{% macro load_cached_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.294753, "supported_languages": null}, "macro.dbt.load_relation": {"unique_id": "macro.dbt.load_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {{ return(load_cached_relation(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2948952, "supported_languages": null}, "macro.dbt.drop_relation_if_exists": {"unique_id": "macro.dbt.drop_relation_if_exists", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.295088, "supported_languages": null}, "macro.dbt.collect_freshness": {"unique_id": "macro.dbt.collect_freshness", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness', 'dbt')(source, loaded_at_field, filter))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2955651, "supported_languages": null}, "macro.dbt.default__collect_freshness": {"unique_id": "macro.dbt.default__collect_freshness", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.295973, "supported_languages": null}, "macro.dbt.copy_grants": {"unique_id": "macro.dbt.copy_grants", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "copy_grants", "macro_sql": "{% macro copy_grants() %}\n {{ return(adapter.dispatch('copy_grants', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.29767, "supported_languages": null}, "macro.dbt.default__copy_grants": {"unique_id": "macro.dbt.default__copy_grants", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__copy_grants", "macro_sql": "{% macro default__copy_grants() %}\n {{ return(True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2977989, "supported_languages": null}, "macro.dbt.support_multiple_grantees_per_dcl_statement": {"unique_id": "macro.dbt.support_multiple_grantees_per_dcl_statement", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "support_multiple_grantees_per_dcl_statement", "macro_sql": "{% macro support_multiple_grantees_per_dcl_statement() %}\n {{ return(adapter.dispatch('support_multiple_grantees_per_dcl_statement', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2979698, "supported_languages": null}, "macro.dbt.default__support_multiple_grantees_per_dcl_statement": {"unique_id": "macro.dbt.default__support_multiple_grantees_per_dcl_statement", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__support_multiple_grantees_per_dcl_statement", "macro_sql": "\n\n{%- macro default__support_multiple_grantees_per_dcl_statement() -%}\n {{ return(True) }}\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2980921, "supported_languages": null}, "macro.dbt.should_revoke": {"unique_id": "macro.dbt.should_revoke", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "should_revoke", "macro_sql": "{% macro should_revoke(existing_relation, full_refresh_mode=True) %}\n\n {% if not existing_relation %}\n {#-- The table doesn't already exist, so no grants to copy over --#}\n {{ return(False) }}\n {% elif full_refresh_mode %}\n {#-- The object is being REPLACED -- whether grants are copied over depends on the value of user config --#}\n {{ return(copy_grants()) }}\n {% else %}\n {#-- The table is being merged/upserted/inserted -- grants will be carried over --#}\n {{ return(True) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.298434, "supported_languages": null}, "macro.dbt.get_show_grant_sql": {"unique_id": "macro.dbt.get_show_grant_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_show_grant_sql", "macro_sql": "{% macro get_show_grant_sql(relation) %}\n {{ return(adapter.dispatch(\"get_show_grant_sql\", \"dbt\")(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_show_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.298629, "supported_languages": null}, "macro.dbt.default__get_show_grant_sql": {"unique_id": "macro.dbt.default__get_show_grant_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_show_grant_sql", "macro_sql": "{% macro default__get_show_grant_sql(relation) %}\n show grants on {{ relation }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.29873, "supported_languages": null}, "macro.dbt.get_grant_sql": {"unique_id": "macro.dbt.get_grant_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_grant_sql", "macro_sql": "{% macro get_grant_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_grant_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.2989519, "supported_languages": null}, "macro.dbt.default__get_grant_sql": {"unique_id": "macro.dbt.default__get_grant_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_grant_sql", "macro_sql": "\n\n{%- macro default__get_grant_sql(relation, privilege, grantees) -%}\n grant {{ privilege }} on {{ relation }} to {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.299138, "supported_languages": null}, "macro.dbt.get_revoke_sql": {"unique_id": "macro.dbt.get_revoke_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_revoke_sql", "macro_sql": "{% macro get_revoke_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_revoke_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_revoke_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.29936, "supported_languages": null}, "macro.dbt.default__get_revoke_sql": {"unique_id": "macro.dbt.default__get_revoke_sql", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_revoke_sql", "macro_sql": "\n\n{%- macro default__get_revoke_sql(relation, privilege, grantees) -%}\n revoke {{ privilege }} on {{ relation }} from {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.299541, "supported_languages": null}, "macro.dbt.get_dcl_statement_list": {"unique_id": "macro.dbt.get_dcl_statement_list", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_dcl_statement_list", "macro_sql": "{% macro get_dcl_statement_list(relation, grant_config, get_dcl_macro) %}\n {{ return(adapter.dispatch('get_dcl_statement_list', 'dbt')(relation, grant_config, get_dcl_macro)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_dcl_statement_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.299764, "supported_languages": null}, "macro.dbt.default__get_dcl_statement_list": {"unique_id": "macro.dbt.default__get_dcl_statement_list", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_dcl_statement_list", "macro_sql": "\n\n{%- macro default__get_dcl_statement_list(relation, grant_config, get_dcl_macro) -%}\n {#\n -- Unpack grant_config into specific privileges and the set of users who need them granted/revoked.\n -- Depending on whether this database supports multiple grantees per statement, pass in the list of\n -- all grantees per privilege, or (if not) template one statement per privilege-grantee pair.\n -- `get_dcl_macro` will be either `get_grant_sql` or `get_revoke_sql`\n #}\n {%- set dcl_statements = [] -%}\n {%- for privilege, grantees in grant_config.items() %}\n {%- if support_multiple_grantees_per_dcl_statement() and grantees -%}\n {%- set dcl = get_dcl_macro(relation, privilege, grantees) -%}\n {%- do dcl_statements.append(dcl) -%}\n {%- else -%}\n {%- for grantee in grantees -%}\n {% set dcl = get_dcl_macro(relation, privilege, [grantee]) %}\n {%- do dcl_statements.append(dcl) -%}\n {% endfor -%}\n {%- endif -%}\n {%- endfor -%}\n {{ return(dcl_statements) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.300426, "supported_languages": null}, "macro.dbt.call_dcl_statements": {"unique_id": "macro.dbt.call_dcl_statements", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "call_dcl_statements", "macro_sql": "{% macro call_dcl_statements(dcl_statement_list) %}\n {{ return(adapter.dispatch(\"call_dcl_statements\", \"dbt\")(dcl_statement_list)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.300691, "supported_languages": null}, "macro.dbt.default__call_dcl_statements": {"unique_id": "macro.dbt.default__call_dcl_statements", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__call_dcl_statements", "macro_sql": "{% macro default__call_dcl_statements(dcl_statement_list) %}\n {#\n -- By default, supply all grant + revoke statements in a single semicolon-separated block,\n -- so that they're all processed together.\n\n -- Some databases do not support this. Those adapters will need to override this macro\n -- to run each statement individually.\n #}\n {% call statement('grants') %}\n {% for dcl_statement in dcl_statement_list %}\n {{ dcl_statement }};\n {% endfor %}\n {% endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.300939, "supported_languages": null}, "macro.dbt.apply_grants": {"unique_id": "macro.dbt.apply_grants", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "apply_grants", "macro_sql": "{% macro apply_grants(relation, grant_config, should_revoke) %}\n {{ return(adapter.dispatch(\"apply_grants\", \"dbt\")(relation, grant_config, should_revoke)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3011699, "supported_languages": null}, "macro.dbt.default__apply_grants": {"unique_id": "macro.dbt.default__apply_grants", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__apply_grants", "macro_sql": "{% macro default__apply_grants(relation, grant_config, should_revoke=True) %}\n {#-- If grant_config is {} or None, this is a no-op --#}\n {% if grant_config %}\n {% if should_revoke %}\n {#-- We think previous grants may have carried over --#}\n {#-- Show current grants and calculate diffs --#}\n {% set current_grants_table = run_query(get_show_grant_sql(relation)) %}\n {% set current_grants_dict = adapter.standardize_grants_dict(current_grants_table) %}\n {% set needs_granting = diff_of_two_dicts(grant_config, current_grants_dict) %}\n {% set needs_revoking = diff_of_two_dicts(current_grants_dict, grant_config) %}\n {% if not (needs_granting or needs_revoking) %}\n {{ log('On ' ~ relation ~': All grants are in place, no revocation or granting needed.')}}\n {% endif %}\n {% else %}\n {#-- We don't think there's any chance of previous grants having carried over. --#}\n {#-- Jump straight to granting what the user has configured. --#}\n {% set needs_revoking = {} %}\n {% set needs_granting = grant_config %}\n {% endif %}\n {% if needs_granting or needs_revoking %}\n {% set revoke_statement_list = get_dcl_statement_list(relation, needs_revoking, get_revoke_sql) %}\n {% set grant_statement_list = get_dcl_statement_list(relation, needs_granting, get_grant_sql) %}\n {% set dcl_statement_list = revoke_statement_list + grant_statement_list %}\n {% if dcl_statement_list %}\n {{ call_dcl_statements(dcl_statement_list) }}\n {% endif %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_grant_sql", "macro.dbt.get_dcl_statement_list", "macro.dbt.call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.302282, "supported_languages": null}, "macro.dbt.alter_column_comment": {"unique_id": "macro.dbt.alter_column_comment", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment', 'dbt')(relation, column_dict)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.303038, "supported_languages": null}, "macro.dbt.default__alter_column_comment": {"unique_id": "macro.dbt.default__alter_column_comment", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3032131, "supported_languages": null}, "macro.dbt.alter_relation_comment": {"unique_id": "macro.dbt.alter_relation_comment", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment', 'dbt')(relation, relation_comment)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.303421, "supported_languages": null}, "macro.dbt.default__alter_relation_comment": {"unique_id": "macro.dbt.default__alter_relation_comment", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.303591, "supported_languages": null}, "macro.dbt.persist_docs": {"unique_id": "macro.dbt.persist_docs", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs', 'dbt')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3038568, "supported_languages": null}, "macro.dbt.default__persist_docs": {"unique_id": "macro.dbt.default__persist_docs", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do run_query(alter_column_comment(relation, model.columns)) %}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.304341, "supported_languages": null}, "macro.dbt.get_catalog": {"unique_id": "macro.dbt.get_catalog", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3057961, "supported_languages": null}, "macro.dbt.default__get_catalog": {"unique_id": "macro.dbt.default__get_catalog", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3060522, "supported_languages": null}, "macro.dbt.information_schema_name": {"unique_id": "macro.dbt.information_schema_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.306238, "supported_languages": null}, "macro.dbt.default__information_schema_name": {"unique_id": "macro.dbt.default__information_schema_name", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.30639, "supported_languages": null}, "macro.dbt.list_schemas": {"unique_id": "macro.dbt.list_schemas", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3065689, "supported_languages": null}, "macro.dbt.default__list_schemas": {"unique_id": "macro.dbt.default__list_schemas", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3068109, "supported_languages": null}, "macro.dbt.check_schema_exists": {"unique_id": "macro.dbt.check_schema_exists", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists', 'dbt')(information_schema, schema)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.307014, "supported_languages": null}, "macro.dbt.default__check_schema_exists": {"unique_id": "macro.dbt.default__check_schema_exists", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.307307, "supported_languages": null}, "macro.dbt.list_relations_without_caching": {"unique_id": "macro.dbt.list_relations_without_caching", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.30749, "supported_languages": null}, "macro.dbt.default__list_relations_without_caching": {"unique_id": "macro.dbt.default__list_relations_without_caching", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.307646, "supported_languages": null}, "macro.dbt.get_columns_in_relation": {"unique_id": "macro.dbt.get_columns_in_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.30933, "supported_languages": null}, "macro.dbt.default__get_columns_in_relation": {"unique_id": "macro.dbt.default__get_columns_in_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3095622, "supported_languages": null}, "macro.dbt.sql_convert_columns_in_relation": {"unique_id": "macro.dbt.sql_convert_columns_in_relation", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3098738, "supported_languages": null}, "macro.dbt.get_columns_in_query": {"unique_id": "macro.dbt.get_columns_in_query", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3100579, "supported_languages": null}, "macro.dbt.default__get_columns_in_query": {"unique_id": "macro.dbt.default__get_columns_in_query", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.310393, "supported_languages": null}, "macro.dbt.alter_column_type": {"unique_id": "macro.dbt.alter_column_type", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type', 'dbt')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.310616, "supported_languages": null}, "macro.dbt.default__alter_column_type": {"unique_id": "macro.dbt.default__alter_column_type", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.311202, "supported_languages": null}, "macro.dbt.alter_relation_add_remove_columns": {"unique_id": "macro.dbt.alter_relation_add_remove_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "alter_relation_add_remove_columns", "macro_sql": "{% macro alter_relation_add_remove_columns(relation, add_columns = none, remove_columns = none) -%}\n {{ return(adapter.dispatch('alter_relation_add_remove_columns', 'dbt')(relation, add_columns, remove_columns)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__alter_relation_add_remove_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.311456, "supported_languages": null}, "macro.dbt.default__alter_relation_add_remove_columns": {"unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__alter_relation_add_remove_columns", "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation }}\n\n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n\n {% for column in remove_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3122182, "supported_languages": null}, "macro.dbt.build_ref_function": {"unique_id": "macro.dbt.build_ref_function", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "build_ref_function", "macro_sql": "{% macro build_ref_function(model) %}\n\n {%- set ref_dict = {} -%}\n {%- for _ref in model.refs -%}\n {%- set resolved = ref(*_ref) -%}\n {%- do ref_dict.update({_ref | join(\".\"): resolved.quote(database=False, schema=False, identifier=False) | string}) -%}\n {%- endfor -%}\n\ndef ref(*args,dbt_load_df_function):\n refs = {{ ref_dict | tojson }}\n key = \".\".join(args)\n return dbt_load_df_function(refs[key])\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.31367, "supported_languages": null}, "macro.dbt.build_source_function": {"unique_id": "macro.dbt.build_source_function", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "build_source_function", "macro_sql": "{% macro build_source_function(model) %}\n\n {%- set source_dict = {} -%}\n {%- for _source in model.sources -%}\n {%- set resolved = source(*_source) -%}\n {%- do source_dict.update({_source | join(\".\"): resolved.quote(database=False, schema=False, identifier=False) | string}) -%}\n {%- endfor -%}\n\ndef source(*args, dbt_load_df_function):\n sources = {{ source_dict | tojson }}\n key = \".\".join(args)\n return dbt_load_df_function(sources[key])\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.314131, "supported_languages": null}, "macro.dbt.build_config_dict": {"unique_id": "macro.dbt.build_config_dict", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "build_config_dict", "macro_sql": "{% macro build_config_dict(model) %}\n {%- set config_dict = {} -%}\n {%- for key in model.config.config_keys_used -%}\n {# weird type testing with enum, would be much easier to write this logic in Python! #}\n {%- if key == 'language' -%}\n {%- set value = 'python' -%}\n {%- endif -%}\n {%- set value = model.config[key] -%}\n {%- do config_dict.update({key: value}) -%}\n {%- endfor -%}\nconfig_dict = {{ config_dict }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3145752, "supported_languages": null}, "macro.dbt.py_script_postfix": {"unique_id": "macro.dbt.py_script_postfix", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "py_script_postfix", "macro_sql": "{% macro py_script_postfix(model) %}\n# This part is user provided model code\n# you will need to copy the next section to run the code\n# COMMAND ----------\n# this part is dbt logic for get ref work, do not modify\n\n{{ build_ref_function(model ) }}\n{{ build_source_function(model ) }}\n{{ build_config_dict(model) }}\n\nclass config:\n def __init__(self, *args, **kwargs):\n pass\n\n @staticmethod\n def get(key, default=None):\n return config_dict.get(key, default)\n\nclass this:\n \"\"\"dbt.this() or dbt.this.identifier\"\"\"\n database = '{{ this.database }}'\n schema = '{{ this.schema }}'\n identifier = '{{ this.identifier }}'\n def __repr__(self):\n return '{{ this }}'\n\n\nclass dbtObj:\n def __init__(self, load_df_function) -> None:\n self.source = lambda *args: source(*args, dbt_load_df_function=load_df_function)\n self.ref = lambda *args: ref(*args, dbt_load_df_function=load_df_function)\n self.config = config\n self.this = this()\n self.is_incremental = {{ is_incremental() }}\n\n# COMMAND ----------\n{{py_script_comment()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.build_ref_function", "macro.dbt.build_source_function", "macro.dbt.build_config_dict", "macro.dbt.is_incremental", "macro.dbt.py_script_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3149629, "supported_languages": null}, "macro.dbt.py_script_comment": {"unique_id": "macro.dbt.py_script_comment", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "py_script_comment", "macro_sql": "{%macro py_script_comment()%}\n{%endmacro%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3150349, "supported_languages": null}, "macro.dbt.test_unique": {"unique_id": "macro.dbt.test_unique", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3155892, "supported_languages": null}, "macro.dbt.test_not_null": {"unique_id": "macro.dbt.test_not_null", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.31582, "supported_languages": null}, "macro.dbt.test_accepted_values": {"unique_id": "macro.dbt.test_accepted_values", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values', 'dbt') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.316097, "supported_languages": null}, "macro.dbt.test_relationships": {"unique_id": "macro.dbt.test_relationships", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships', 'dbt') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.316365, "supported_languages": null}, "macro.dbt_utils.get_url_host": {"unique_id": "macro.dbt_utils.get_url_host", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "name": "get_url_host", "macro_sql": "{% macro get_url_host(field) -%}\n {{ return(adapter.dispatch('get_url_host', 'dbt_utils')(field)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_host"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.316778, "supported_languages": null}, "macro.dbt_utils.default__get_url_host": {"unique_id": "macro.dbt_utils.default__get_url_host", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "name": "default__get_url_host", "macro_sql": "{% macro default__get_url_host(field) -%}\n\n{%- set parsed =\n dbt.split_part(\n dbt.split_part(\n dbt.replace(\n dbt.replace(\n dbt.replace(field, \"'android-app://'\", \"''\"\n ), \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n\n-%}\n\n\n {{ dbt.safe_cast(\n parsed,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.split_part", "macro.dbt.replace", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.317321, "supported_languages": null}, "macro.dbt_utils.get_url_path": {"unique_id": "macro.dbt_utils.get_url_path", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "name": "get_url_path", "macro_sql": "{% macro get_url_path(field) -%}\n {{ return(adapter.dispatch('get_url_path', 'dbt_utils')(field)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_path"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.317845, "supported_languages": null}, "macro.dbt_utils.default__get_url_path": {"unique_id": "macro.dbt_utils.default__get_url_path", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "name": "default__get_url_path", "macro_sql": "{% macro default__get_url_path(field) -%}\n\n {%- set stripped_url =\n dbt.replace(\n dbt.replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{ dbt.position(\"'/'\", stripped_url) }}, 0),\n {{ dbt.position(\"'?'\", stripped_url) }} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n dbt.split_part(\n dbt.right(\n stripped_url,\n dbt.length(stripped_url) ~ \"-\" ~ first_slash_pos\n ),\n \"'?'\", 1\n )\n -%}\n\n {{ dbt.safe_cast(\n parsed_path,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.position", "macro.dbt.split_part", "macro.dbt.right", "macro.dbt.length", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.318503, "supported_languages": null}, "macro.dbt_utils.get_url_parameter": {"unique_id": "macro.dbt_utils.get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "name": "get_url_parameter", "macro_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n {{ return(adapter.dispatch('get_url_parameter', 'dbt_utils')(field, url_parameter)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.318887, "supported_languages": null}, "macro.dbt_utils.default__get_url_parameter": {"unique_id": "macro.dbt_utils.default__get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "name": "default__get_url_parameter", "macro_sql": "{% macro default__get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = dbt.split_part(dbt.split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.319202, "supported_languages": null}, "macro.dbt_utils.test_fewer_rows_than": {"unique_id": "macro.dbt_utils.test_fewer_rows_than", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "name": "test_fewer_rows_than", "macro_sql": "{% test fewer_rows_than(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_fewer_rows_than', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_fewer_rows_than"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.320266, "supported_languages": null}, "macro.dbt_utils.default__test_fewer_rows_than": {"unique_id": "macro.dbt_utils.default__test_fewer_rows_than", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "name": "default__test_fewer_rows_than", "macro_sql": "{% macro default__test_fewer_rows_than(model, compare_model, group_by_columns) %}\n\n{{ config(fail_calc = 'sum(coalesce(row_count_delta, 0))') }}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in equal_rowcount. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_fewer_rows_than'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_our_model \n from {{ model }}\n {{ groupby_gb_cols }}\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_comparison_model \n from {{ compare_model }}\n {{ groupby_gb_cols }}\n\n),\ncounts as (\n\n select\n\n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_our_model,\n count_comparison_model\n from a\n full join b on \n a.id_dbtutils_test_fewer_rows_than = b.id_dbtutils_test_fewer_rows_than\n {{ join_gb_cols }}\n\n),\nfinal as (\n\n select *,\n case\n -- fail the test if we have more rows than the reference model and return the row count delta\n when count_our_model > count_comparison_model then (count_our_model - count_comparison_model)\n -- fail the test if they are the same number\n when count_our_model = count_comparison_model then 1\n -- pass the test if the delta is positive (i.e. return the number 0)\n else 0\n end as row_count_delta\n from counts\n\n)\n\nselect * from final\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3212569, "supported_languages": null}, "macro.dbt_utils.test_equal_rowcount": {"unique_id": "macro.dbt_utils.test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "name": "test_equal_rowcount", "macro_sql": "{% test equal_rowcount(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_equal_rowcount', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_equal_rowcount"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.322125, "supported_languages": null}, "macro.dbt_utils.default__test_equal_rowcount": {"unique_id": "macro.dbt_utils.default__test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "name": "default__test_equal_rowcount", "macro_sql": "{% macro default__test_equal_rowcount(model, compare_model, group_by_columns) %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = 'sum(coalesce(diff_count, 0))') }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(', ') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in fewer_rows_than. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_equal_rowcount'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_a \n from {{ model }}\n {{groupby_gb_cols}}\n\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_b \n from {{ compare_model }}\n {{groupby_gb_cols}}\n\n),\nfinal as (\n\n select\n \n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_a,\n count_b,\n abs(count_a - count_b) as diff_count\n\n from a\n full join b\n on\n a.id_dbtutils_test_equal_rowcount = b.id_dbtutils_test_equal_rowcount\n {{join_gb_cols}}\n\n\n)\n\nselect * from final\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.323173, "supported_languages": null}, "macro.dbt_utils.test_relationships_where": {"unique_id": "macro.dbt_utils.test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "name": "test_relationships_where", "macro_sql": "{% test relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n {{ return(adapter.dispatch('test_relationships_where', 'dbt_utils')(model, column_name, to, field, from_condition, to_condition)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_relationships_where"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3238678, "supported_languages": null}, "macro.dbt_utils.default__test_relationships_where": {"unique_id": "macro.dbt_utils.default__test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "name": "default__test_relationships_where", "macro_sql": "{% macro default__test_relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n\nwith left_table as (\n\n select\n {{column_name}} as id\n\n from {{model}}\n\n where {{column_name}} is not null\n and {{from_condition}}\n\n),\n\nright_table as (\n\n select\n {{field}} as id\n\n from {{to}}\n\n where {{field}} is not null\n and {{to_condition}}\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.324209, "supported_languages": null}, "macro.dbt_utils.test_recency": {"unique_id": "macro.dbt_utils.test_recency", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "name": "test_recency", "macro_sql": "{% test recency(model, field, datepart, interval, ignore_time_component=False, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_recency', 'dbt_utils')(model, field, datepart, interval, ignore_time_component, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_recency"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.324959, "supported_languages": null}, "macro.dbt_utils.default__test_recency": {"unique_id": "macro.dbt_utils.default__test_recency", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "name": "default__test_recency", "macro_sql": "{% macro default__test_recency(model, field, datepart, interval, ignore_time_component, group_by_columns) %}\n\n{% set threshold = 'cast(' ~ dbt.dateadd(datepart, interval * -1, dbt.current_timestamp()) ~ ' as ' ~ ('date' if ignore_time_component else dbt.type_timestamp()) ~ ')' %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nwith recency as (\n\n select \n\n {{ select_gb_cols }}\n {% if ignore_time_component %}\n cast(max({{ field }}) as date) as most_recent\n {%- else %}\n max({{ field }}) as most_recent\n {%- endif %}\n\n from {{ model }}\n\n {{ groupby_gb_cols }}\n\n)\n\nselect\n\n {{ select_gb_cols }}\n most_recent,\n {{ threshold }} as threshold\n\nfrom recency\nwhere most_recent < {{ threshold }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.current_timestamp", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.325865, "supported_languages": null}, "macro.dbt_utils.test_not_constant": {"unique_id": "macro.dbt_utils.test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "name": "test_not_constant", "macro_sql": "{% test not_constant(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_constant', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_constant"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.326467, "supported_languages": null}, "macro.dbt_utils.default__test_not_constant": {"unique_id": "macro.dbt_utils.default__test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "name": "default__test_not_constant", "macro_sql": "{% macro default__test_not_constant(model, column_name, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nselect\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count(distinct {{ column_name }}) as filler_column\n\nfrom {{ model }}\n\n {{groupby_gb_cols}}\n\nhaving count(distinct {{ column_name }}) = 1\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.326944, "supported_languages": null}, "macro.dbt_utils.test_accepted_range": {"unique_id": "macro.dbt_utils.test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "name": "test_accepted_range", "macro_sql": "{% test accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n {{ return(adapter.dispatch('test_accepted_range', 'dbt_utils')(model, column_name, min_value, max_value, inclusive)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_accepted_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3276858, "supported_languages": null}, "macro.dbt_utils.default__test_accepted_range": {"unique_id": "macro.dbt_utils.default__test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "name": "default__test_accepted_range", "macro_sql": "{% macro default__test_accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n\nwith meet_condition as(\n select *\n from {{ model }}\n),\n\nvalidation_errors as (\n select *\n from meet_condition\n where\n -- never true, defaults to an empty result set. Exists to ensure any combo of the `or` clauses below succeeds\n 1 = 2\n\n {%- if min_value is not none %}\n -- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} > {{- \"=\" if inclusive }} {{ min_value }}\n {%- endif %}\n\n {%- if max_value is not none %}\n -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} < {{- \"=\" if inclusive }} {{ max_value }}\n {%- endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.32818, "supported_languages": null}, "macro.dbt_utils.test_not_accepted_values": {"unique_id": "macro.dbt_utils.test_not_accepted_values", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "name": "test_not_accepted_values", "macro_sql": "{% test not_accepted_values(model, column_name, values, quote=True) %}\n {{ return(adapter.dispatch('test_not_accepted_values', 'dbt_utils')(model, column_name, values, quote)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.328806, "supported_languages": null}, "macro.dbt_utils.default__test_not_accepted_values": {"unique_id": "macro.dbt_utils.default__test_not_accepted_values", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "name": "default__test_not_accepted_values", "macro_sql": "{% macro default__test_not_accepted_values(model, column_name, values, quote=True) %}\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3292658, "supported_languages": null}, "macro.dbt_utils.test_at_least_one": {"unique_id": "macro.dbt_utils.test_at_least_one", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "name": "test_at_least_one", "macro_sql": "{% test at_least_one(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_at_least_one', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_at_least_one"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3298, "supported_languages": null}, "macro.dbt_utils.default__test_at_least_one": {"unique_id": "macro.dbt_utils.default__test_at_least_one", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "name": "default__test_at_least_one", "macro_sql": "{% macro default__test_at_least_one(model, column_name, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nselect *\nfrom (\n select\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count({{ column_name }}) as filler_column\n\n from {{ model }}\n\n {{groupby_gb_cols}}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.330266, "supported_languages": null}, "macro.dbt_utils.test_unique_combination_of_columns": {"unique_id": "macro.dbt_utils.test_unique_combination_of_columns", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "name": "test_unique_combination_of_columns", "macro_sql": "{% test unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n {{ return(adapter.dispatch('test_unique_combination_of_columns', 'dbt_utils')(model, combination_of_columns, quote_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_combination_of_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.330924, "supported_languages": null}, "macro.dbt_utils.default__test_unique_combination_of_columns": {"unique_id": "macro.dbt_utils.default__test_unique_combination_of_columns", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "name": "default__test_unique_combination_of_columns", "macro_sql": "{% macro default__test_unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n\n{% if not quote_columns %}\n {%- set column_list=combination_of_columns %}\n{% elif quote_columns %}\n {%- set column_list=[] %}\n {% for column in combination_of_columns -%}\n {% set column_list = column_list.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set columns_csv=column_list | join(', ') %}\n\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3315609, "supported_languages": null}, "macro.dbt_utils.test_cardinality_equality": {"unique_id": "macro.dbt_utils.test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "name": "test_cardinality_equality", "macro_sql": "{% test cardinality_equality(model, column_name, to, field) %}\n {{ return(adapter.dispatch('test_cardinality_equality', 'dbt_utils')(model, column_name, to, field)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_cardinality_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.332157, "supported_languages": null}, "macro.dbt_utils.default__test_cardinality_equality": {"unique_id": "macro.dbt_utils.default__test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "name": "default__test_cardinality_equality", "macro_sql": "{% macro default__test_cardinality_equality(model, column_name, to, field) %}\n\n{# T-SQL does not let you use numbers as aliases for columns #}\n{# Thus, no \"GROUP BY 1\" #}\n\nwith table_a as (\nselect\n {{ column_name }},\n count(*) as num_rows\nfrom {{ model }}\ngroup by {{ column_name }}\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by {{ field }}\n),\n\nexcept_a as (\n select *\n from table_a\n {{ dbt.except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ dbt.except() }}\n select *\n from table_a\n),\n\nunioned as (\n select *\n from except_a\n union all\n select *\n from except_b\n)\n\nselect *\nfrom unioned\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.332492, "supported_languages": null}, "macro.dbt_utils.test_expression_is_true": {"unique_id": "macro.dbt_utils.test_expression_is_true", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "name": "test_expression_is_true", "macro_sql": "{% test expression_is_true(model, expression, column_name=None) %}\n {{ return(adapter.dispatch('test_expression_is_true', 'dbt_utils')(model, expression, column_name)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.332947, "supported_languages": null}, "macro.dbt_utils.default__test_expression_is_true": {"unique_id": "macro.dbt_utils.default__test_expression_is_true", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "name": "default__test_expression_is_true", "macro_sql": "{% macro default__test_expression_is_true(model, expression, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else \"1\" %}\n\nselect\n {{ column_list }}\nfrom {{ model }}\n{% if column_name is none %}\nwhere not({{ expression }})\n{%- else %}\nwhere not({{ column_name }} {{ expression }})\n{%- endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.333299, "supported_languages": null}, "macro.dbt_utils.test_not_null_proportion": {"unique_id": "macro.dbt_utils.test_not_null_proportion", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "name": "test_not_null_proportion", "macro_sql": "{% macro test_not_null_proportion(model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_null_proportion', 'dbt_utils')(model, group_by_columns, **kwargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_proportion"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3339782, "supported_languages": null}, "macro.dbt_utils.default__test_not_null_proportion": {"unique_id": "macro.dbt_utils.default__test_not_null_proportion", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "name": "default__test_not_null_proportion", "macro_sql": "{% macro default__test_not_null_proportion(model, group_by_columns) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n{% set at_least = kwargs.get('at_least', kwargs.get('arg')) %}\n{% set at_most = kwargs.get('at_most', kwargs.get('arg', 1)) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith validation as (\n select\n {{select_gb_cols}}\n sum(case when {{ column_name }} is null then 0 else 1 end) / cast(count(*) as numeric) as not_null_proportion\n from {{ model }}\n {{groupby_gb_cols}}\n),\nvalidation_errors as (\n select\n {{select_gb_cols}}\n not_null_proportion\n from validation\n where not_null_proportion < {{ at_least }} or not_null_proportion > {{ at_most }}\n)\nselect\n *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.334785, "supported_languages": null}, "macro.dbt_utils.test_sequential_values": {"unique_id": "macro.dbt_utils.test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "name": "test_sequential_values", "macro_sql": "{% test sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n {{ return(adapter.dispatch('test_sequential_values', 'dbt_utils')(model, column_name, interval, datepart, group_by_columns)) }}\n\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_sequential_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3356879, "supported_languages": null}, "macro.dbt_utils.default__test_sequential_values": {"unique_id": "macro.dbt_utils.default__test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "name": "default__test_sequential_values", "macro_sql": "{% macro default__test_sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n{% set previous_column_name = \"previous_\" ~ dbt_utils.slugify(column_name) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(',') + ', ' %}\n {% set partition_gb_cols = 'partition by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith windowed as (\n\n select\n {{ select_gb_cols }}\n {{ column_name }},\n lag({{ column_name }}) over (\n {{partition_gb_cols}}\n order by {{ column_name }}\n ) as {{ previous_column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ dbt.type_timestamp() }})= cast({{ dbt.dateadd(datepart, interval, previous_column_name) }} as {{ dbt.type_timestamp() }}))\n {% else %}\n where not({{ column_name }} = {{ previous_column_name }} + {{ interval }})\n {% endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.slugify", "macro.dbt.type_timestamp", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.336593, "supported_languages": null}, "macro.dbt_utils.test_equality": {"unique_id": "macro.dbt_utils.test_equality", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "name": "test_equality", "macro_sql": "{% test equality(model, compare_model, compare_columns=None) %}\n {{ return(adapter.dispatch('test_equality', 'dbt_utils')(model, compare_model, compare_columns)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.337377, "supported_languages": null}, "macro.dbt_utils.default__test_equality": {"unique_id": "macro.dbt_utils.default__test_equality", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "name": "default__test_equality", "macro_sql": "{% macro default__test_equality(model, compare_model, compare_columns=None) %}\n\n{% set set_diff %}\n count(*) + coalesce(abs(\n sum(case when which_diff = 'a_minus_b' then 1 else 0 end) -\n sum(case when which_diff = 'b_minus_a' then 1 else 0 end)\n ), 0)\n{% endset %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = set_diff) }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n-- setup\n{%- do dbt_utils._is_relation(model, 'test_equality') -%}\n\n{#-\nIf the compare_cols arg is provided, we can run this test without querying the\ninformation schema\u00a0\u2014 this allows the model to be an ephemeral model\n-#}\n\n{%- if not compare_columns -%}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set compare_columns = adapter.get_columns_in_relation(model) | map(attribute='quoted') -%}\n{%- endif -%}\n\n{% set compare_cols_csv = compare_columns | join(', ') %}\n\nwith a as (\n\n select * from {{ model }}\n\n),\n\nb as (\n\n select * from {{ compare_model }}\n\n),\n\na_minus_b as (\n\n select {{compare_cols_csv}} from a\n {{ dbt.except() }}\n select {{compare_cols_csv}} from b\n\n),\n\nb_minus_a as (\n\n select {{compare_cols_csv}} from b\n {{ dbt.except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select 'a_minus_b' as which_diff, a_minus_b.* from a_minus_b\n union all\n select 'b_minus_a' as which_diff, b_minus_a.* from b_minus_a\n\n)\n\nselect * from unioned\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.33826, "supported_languages": null}, "macro.dbt_utils.test_not_empty_string": {"unique_id": "macro.dbt_utils.test_not_empty_string", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "name": "test_not_empty_string", "macro_sql": "{% test not_empty_string(model, column_name, trim_whitespace=true) %}\n\n {{ return(adapter.dispatch('test_not_empty_string', 'dbt_utils')(model, column_name, trim_whitespace)) }}\n\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_empty_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.338807, "supported_languages": null}, "macro.dbt_utils.default__test_not_empty_string": {"unique_id": "macro.dbt_utils.default__test_not_empty_string", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "name": "default__test_not_empty_string", "macro_sql": "{% macro default__test_not_empty_string(model, column_name, trim_whitespace=true) %}\n\n with\n \n all_values as (\n\n select \n\n\n {% if trim_whitespace == true -%}\n\n trim({{ column_name }}) as {{ column_name }}\n\n {%- else -%}\n\n {{ column_name }}\n\n {%- endif %}\n \n from {{ model }}\n\n ),\n\n errors as (\n\n select * from all_values\n where {{ column_name }} = ''\n\n )\n\n select * from errors\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3391008, "supported_languages": null}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "name": "test_mutually_exclusive_ranges", "macro_sql": "{% test mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', 'dbt_utils')(model, lower_bound_column, upper_bound_column, partition_by, gaps, zero_length_range_allowed)) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_mutually_exclusive_ranges"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3423371, "supported_languages": null}, "macro.dbt_utils.default__test_mutually_exclusive_ranges": {"unique_id": "macro.dbt_utils.default__test_mutually_exclusive_ranges", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "name": "default__test_mutually_exclusive_ranges", "macro_sql": "{% macro default__test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n{% if gaps == 'not_allowed' %}\n {% set allow_gaps_operator='=' %}\n {% set allow_gaps_operator_in_words='equal_to' %}\n{% elif gaps == 'allowed' %}\n {% set allow_gaps_operator='<=' %}\n {% set allow_gaps_operator_in_words='less_than_or_equal_to' %}\n{% elif gaps == 'required' %}\n {% set allow_gaps_operator='<' %}\n {% set allow_gaps_operator_in_words='less_than' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '\" ~ gaps ~\"'.'\"\n ) }}\n{% endif %}\n{% if not zero_length_range_allowed %}\n {% set allow_zero_length_operator='<' %}\n {% set allow_zero_length_operator_in_words='less_than' %}\n{% elif zero_length_range_allowed %}\n {% set allow_zero_length_operator='<=' %}\n {% set allow_zero_length_operator_in_words='less_than_or_equal_to' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`zero_length_range_allowed` argument for mutually_exclusive_ranges test must be one of [true, false] Got: '\" ~ zero_length_range_allowed ~\"'.'\"\n ) }}\n{% endif %}\n\n{% set partition_clause=\"partition by \" ~ partition_by if partition_by else '' %}\n\nwith window_functions as (\n\n select\n {% if partition_by %}\n {{ partition_by }} as partition_by_col,\n {% endif %}\n {{ lower_bound_column }} as lower_bound,\n {{ upper_bound_column }} as upper_bound,\n\n lead({{ lower_bound_column }}) over (\n {{ partition_clause }}\n order by {{ lower_bound_column }}, {{ upper_bound_column }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_bound_column }} desc, {{ upper_bound_column }} desc\n ) = 1 as is_last_record\n\n from {{ model }}\n\n),\n\ncalc as (\n -- We want to return records where one of our assumptions fails, so we'll use\n -- the `not` function with `and` statements so we can write our assumptions more cleanly\n select\n *,\n\n -- For each record: lower_bound should be < upper_bound.\n -- Coalesce it to return an error on the null case (implicit assumption\n -- these columns are not_null)\n coalesce(\n lower_bound {{ allow_zero_length_operator }} upper_bound,\n false\n ) as lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect * from validation_errors\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.344137, "supported_languages": null}, "macro.dbt_utils.pretty_log_format": {"unique_id": "macro.dbt_utils.pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "name": "pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n {{ return(adapter.dispatch('pretty_log_format', 'dbt_utils')(message)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.344511, "supported_languages": null}, "macro.dbt_utils.default__pretty_log_format": {"unique_id": "macro.dbt_utils.default__pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "name": "default__pretty_log_format", "macro_sql": "{% macro default__pretty_log_format(message) %}\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.344678, "supported_languages": null}, "macro.dbt_utils._is_relation": {"unique_id": "macro.dbt_utils._is_relation", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/_is_relation.sql", "original_file_path": "macros/jinja_helpers/_is_relation.sql", "name": "_is_relation", "macro_sql": "{% macro _is_relation(obj, macro) %}\n {%- if not (obj is mapping and obj.get('metadata', {}).get('type', '').endswith('Relation')) -%}\n {%- do exceptions.raise_compiler_error(\"Macro \" ~ macro ~ \" expected a Relation but received the value: \" ~ obj) -%}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.345191, "supported_languages": null}, "macro.dbt_utils.pretty_time": {"unique_id": "macro.dbt_utils.pretty_time", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "name": "pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n {{ return(adapter.dispatch('pretty_time', 'dbt_utils')(format)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3455412, "supported_languages": null}, "macro.dbt_utils.default__pretty_time": {"unique_id": "macro.dbt_utils.default__pretty_time", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "name": "default__pretty_time", "macro_sql": "{% macro default__pretty_time(format='%H:%M:%S') %}\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.345738, "supported_languages": null}, "macro.dbt_utils.log_info": {"unique_id": "macro.dbt_utils.log_info", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "name": "log_info", "macro_sql": "{% macro log_info(message) %}\n {{ return(adapter.dispatch('log_info', 'dbt_utils')(message)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__log_info"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.346078, "supported_languages": null}, "macro.dbt_utils.default__log_info": {"unique_id": "macro.dbt_utils.default__log_info", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "name": "default__log_info", "macro_sql": "{% macro default__log_info(message) %}\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.346252, "supported_languages": null}, "macro.dbt_utils.slugify": {"unique_id": "macro.dbt_utils.slugify", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/slugify.sql", "original_file_path": "macros/jinja_helpers/slugify.sql", "name": "slugify", "macro_sql": "{% macro slugify(string) %}\n\n{#- Lower case the string -#}\n{% set string = string | lower %}\n{#- Replace spaces and dashes with underscores -#}\n{% set string = modules.re.sub('[ -]+', '_', string) %}\n{#- Only take letters, numbers, and underscores -#}\n{% set string = modules.re.sub('[^a-z0-9_]+', '', string) %}\n{#- Prepends \"_\" if string begins with a number -#}\n{% set string = modules.re.sub('^[0-9]', '_' + string[0], string) %}\n\n{{ return(string) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3469281, "supported_languages": null}, "macro.dbt_utils._is_ephemeral": {"unique_id": "macro.dbt_utils._is_ephemeral", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/_is_ephemeral.sql", "original_file_path": "macros/jinja_helpers/_is_ephemeral.sql", "name": "_is_ephemeral", "macro_sql": "{% macro _is_ephemeral(obj, macro) %}\n {%- if obj.is_cte -%}\n {% set ephemeral_prefix = api.Relation.add_ephemeral_prefix('') %}\n {% if obj.name.startswith(ephemeral_prefix) %}\n {% set model_name = obj.name[(ephemeral_prefix|length):] %}\n {% else %}\n {% set model_name = obj.name %}\n {%- endif -%}\n {% set error_message %}\nThe `{{ macro }}` macro cannot be used with ephemeral models, as it relies on the information schema.\n\n`{{ model_name }}` is an ephemeral model. Consider making it a view or table instead.\n {% endset %}\n {%- do exceptions.raise_compiler_error(error_message) -%}\n {%- endif -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.347797, "supported_languages": null}, "macro.dbt_utils.get_intervals_between": {"unique_id": "macro.dbt_utils.get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_utils')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.348522, "supported_languages": null}, "macro.dbt_utils.default__get_intervals_between": {"unique_id": "macro.dbt_utils.default__get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.349108, "supported_languages": null}, "macro.dbt_utils.date_spine": {"unique_id": "macro.dbt_utils.date_spine", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_utils')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.349334, "supported_languages": null}, "macro.dbt_utils.default__date_spine": {"unique_id": "macro.dbt_utils.default__date_spine", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{dbt_utils.generate_series(\n dbt_utils.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n),\n\nall_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.generate_series", "macro.dbt_utils.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.349688, "supported_languages": null}, "macro.dbt_utils.nullcheck_table": {"unique_id": "macro.dbt_utils.nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "name": "nullcheck_table", "macro_sql": "{% macro nullcheck_table(relation) %}\n {{ return(adapter.dispatch('nullcheck_table', 'dbt_utils')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.350076, "supported_languages": null}, "macro.dbt_utils.default__nullcheck_table": {"unique_id": "macro.dbt_utils.default__nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "name": "default__nullcheck_table", "macro_sql": "{% macro default__nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(relation, 'nullcheck_table') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'nullcheck_table') -%}\n {% set cols = adapter.get_columns_in_relation(relation) %}\n\n select {{ dbt_utils.nullcheck(cols) }}\n from {{relation}}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.350417, "supported_languages": null}, "macro.dbt_utils.get_relations_by_pattern": {"unique_id": "macro.dbt_utils.get_relations_by_pattern", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "name": "get_relations_by_pattern", "macro_sql": "{% macro get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_pattern', 'dbt_utils')(schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3511438, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_pattern": {"unique_id": "macro.dbt_utils.default__get_relations_by_pattern", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "name": "default__get_relations_by_pattern", "macro_sql": "{% macro default__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.352045, "supported_languages": null}, "macro.dbt_utils.get_powers_of_two": {"unique_id": "macro.dbt_utils.get_powers_of_two", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.352892, "supported_languages": null}, "macro.dbt_utils.default__get_powers_of_two": {"unique_id": "macro.dbt_utils.default__get_powers_of_two", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3533068, "supported_languages": null}, "macro.dbt_utils.generate_series": {"unique_id": "macro.dbt_utils.generate_series", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3534951, "supported_languages": null}, "macro.dbt_utils.default__generate_series": {"unique_id": "macro.dbt_utils.default__generate_series", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_utils.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.354006, "supported_languages": null}, "macro.dbt_utils.get_relations_by_prefix": {"unique_id": "macro.dbt_utils.get_relations_by_prefix", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "name": "get_relations_by_prefix", "macro_sql": "{% macro get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_prefix', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3547142, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_prefix": {"unique_id": "macro.dbt_utils.default__get_relations_by_prefix", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "name": "default__get_relations_by_prefix", "macro_sql": "{% macro default__get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_prefix_sql(schema, prefix, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.355542, "supported_languages": null}, "macro.dbt_utils.get_tables_by_prefix_sql": {"unique_id": "macro.dbt_utils.get_tables_by_prefix_sql", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "name": "get_tables_by_prefix_sql", "macro_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_prefix_sql', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.356006, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_prefix_sql": {"unique_id": "macro.dbt_utils.default__get_tables_by_prefix_sql", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "name": "default__get_tables_by_prefix_sql", "macro_sql": "{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(\n schema_pattern = schema,\n table_pattern = prefix ~ '%',\n exclude = exclude,\n database = database\n ) }}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.356286, "supported_languages": null}, "macro.dbt_utils.star": {"unique_id": "macro.dbt_utils.star", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "name": "star", "macro_sql": "{% macro star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True) -%}\r\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, prefix, suffix, quote_identifiers)) }}\r\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3575208, "supported_languages": null}, "macro.dbt_utils.default__star": {"unique_id": "macro.dbt_utils.default__star", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "name": "default__star", "macro_sql": "{% macro default__star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True) -%}\r\n {%- do dbt_utils._is_relation(from, 'star') -%}\r\n {%- do dbt_utils._is_ephemeral(from, 'star') -%}\r\n\r\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\r\n {%- if not execute -%}\r\n {% do return('*') %}\r\n {%- endif -%}\r\n\r\n {% set cols = dbt_utils.get_filtered_columns_in_relation(from, except) %}\r\n\r\n {%- if cols|length <= 0 -%}\r\n {% if flags.WHICH == 'compile' %}\r\n {% set response %}\r\n*\r\n/* No columns were returned. Maybe the relation doesn't exist yet \r\nor all columns were excluded. This star is only output during \r\ndbt compile, and exists to keep SQLFluff happy. */\r\n {% endset %}\r\n {% do return(response) %}\r\n {% else %}\r\n {% do return(\"/* no columns returned from star() macro */\") %}\r\n {% endif %}\r\n {%- else -%}\r\n {%- for col in cols %}\r\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}\r\n {%- if quote_identifiers -%}\r\n {{ adapter.quote(col)|trim }} {%- if prefix!='' or suffix!='' %} as {{ adapter.quote(prefix ~ col ~ suffix)|trim }} {%- endif -%}\r\n {%- else -%}\r\n {{ col|trim }} {%- if prefix!='' or suffix!='' %} as {{ (prefix ~ col ~ suffix)|trim }} {%- endif -%}\r\n {% endif %}\r\n {%- if not loop.last %},{{ '\\n ' }}{%- endif -%}\r\n {%- endfor -%}\r\n {% endif %}\r\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.358919, "supported_languages": null}, "macro.dbt_utils.unpivot": {"unique_id": "macro.dbt_utils.unpivot", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "name": "unpivot", "macro_sql": "{% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value') -%}\n {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.360233, "supported_languages": null}, "macro.dbt_utils.default__unpivot": {"unique_id": "macro.dbt_utils.default__unpivot", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "name": "default__unpivot", "macro_sql": "{% macro default__unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value') -%}\n\n {% if not relation %}\n {{ exceptions.raise_compiler_error(\"Error: argument `relation` is required for `unpivot` macro.\") }}\n {% endif %}\n\n {%- set exclude = exclude if exclude is not none else [] %}\n {%- set remove = remove if remove is not none else [] %}\n\n {%- set include_cols = [] %}\n\n {%- set table_columns = {} %}\n\n {%- do table_columns.update({relation: []}) %}\n\n {%- do dbt_utils._is_relation(relation, 'unpivot') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'unpivot') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) %}\n\n {%- for col in cols -%}\n {%- if col.column.lower() not in remove|map('lower') and col.column.lower() not in exclude|map('lower') -%}\n {% do include_cols.append(col) %}\n {%- endif %}\n {%- endfor %}\n\n\n {%- for col in include_cols -%}\n select\n {%- for exclude_col in exclude %}\n {{ exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ dbt.type_string() }}) as {{ field_name }},\n cast( {% if col.data_type == 'boolean' %}\n {{ dbt.cast_bool_to_text(col.column) }}\n {% else %}\n {{ col.column }}\n {% endif %}\n as {{ cast_to }}) as {{ value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_string", "macro.dbt.cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.361892, "supported_languages": null}, "macro.dbt_utils.safe_divide": {"unique_id": "macro.dbt_utils.safe_divide", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "name": "safe_divide", "macro_sql": "{% macro safe_divide(numerator, denominator) -%}\n {{ return(adapter.dispatch('safe_divide', 'dbt_utils')(numerator, denominator)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__safe_divide"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.362259, "supported_languages": null}, "macro.dbt_utils.default__safe_divide": {"unique_id": "macro.dbt_utils.default__safe_divide", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "name": "default__safe_divide", "macro_sql": "{% macro default__safe_divide(numerator, denominator) %}\n ( {{ numerator }} ) / nullif( ( {{ denominator }} ), 0)\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.362396, "supported_languages": null}, "macro.dbt_utils.union_relations": {"unique_id": "macro.dbt_utils.union_relations", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "name": "union_relations", "macro_sql": "{%- macro union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n {{ return(adapter.dispatch('union_relations', 'dbt_utils')(relations, column_override, include, exclude, source_column_name, where)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.365312, "supported_languages": null}, "macro.dbt_utils.default__union_relations": {"unique_id": "macro.dbt_utils.default__union_relations", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "name": "default__union_relations", "macro_sql": "\n\n{%- macro default__union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n cast({{ dbt.string_literal(relation) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ relation }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3687081, "supported_languages": null}, "macro.dbt_utils.group_by": {"unique_id": "macro.dbt_utils.group_by", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "name": "group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_utils')(n)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.369087, "supported_languages": null}, "macro.dbt_utils.default__group_by": {"unique_id": "macro.dbt_utils.default__group_by", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "name": "default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }} \n {%- endfor -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.369334, "supported_languages": null}, "macro.dbt_utils.deduplicate": {"unique_id": "macro.dbt_utils.deduplicate", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "deduplicate", "macro_sql": "{%- macro deduplicate(relation, partition_by, order_by) -%}\n {{ return(adapter.dispatch('deduplicate', 'dbt_utils')(relation, partition_by, order_by)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.postgres__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.370112, "supported_languages": null}, "macro.dbt_utils.default__deduplicate": {"unique_id": "macro.dbt_utils.default__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "default__deduplicate", "macro_sql": "\n\n{%- macro default__deduplicate(relation, partition_by, order_by) -%}\n\n with row_numbered as (\n select\n _inner.*,\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) as rn\n from {{ relation }} as _inner\n )\n\n select\n distinct data.*\n from {{ relation }} as data\n {#\n -- Not all DBs will support natural joins but the ones that do include:\n -- Oracle, MySQL, SQLite, Redshift, Teradata, Materialize, Databricks\n -- Apache Spark, SingleStore, Vertica\n -- Those that do not appear to support natural joins include:\n -- SQLServer, Trino, Presto, Rockset, Athena\n #}\n natural join row_numbered\n where row_numbered.rn = 1\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.370334, "supported_languages": null}, "macro.dbt_utils.redshift__deduplicate": {"unique_id": "macro.dbt_utils.redshift__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "redshift__deduplicate", "macro_sql": "{% macro redshift__deduplicate(relation, partition_by, order_by) -%}\n\n {{ return(dbt_utils.default__deduplicate(relation, partition_by, order_by=order_by)) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3705359, "supported_languages": null}, "macro.dbt_utils.postgres__deduplicate": {"unique_id": "macro.dbt_utils.postgres__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "postgres__deduplicate", "macro_sql": "\n{%- macro postgres__deduplicate(relation, partition_by, order_by) -%}\n\n select\n distinct on ({{ partition_by }}) *\n from {{ relation }}\n order by {{ partition_by }}{{ ',' ~ order_by }}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3707268, "supported_languages": null}, "macro.dbt_utils.snowflake__deduplicate": {"unique_id": "macro.dbt_utils.snowflake__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "snowflake__deduplicate", "macro_sql": "\n{%- macro snowflake__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3708868, "supported_languages": null}, "macro.dbt_utils.bigquery__deduplicate": {"unique_id": "macro.dbt_utils.bigquery__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "bigquery__deduplicate", "macro_sql": "\n{%- macro bigquery__deduplicate(relation, partition_by, order_by) -%}\n\n select unique.*\n from (\n select\n array_agg (\n original\n order by {{ order_by }}\n limit 1\n )[offset(0)] unique\n from {{ relation }} original\n group by {{ partition_by }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.371051, "supported_languages": null}, "macro.dbt_utils.surrogate_key": {"unique_id": "macro.dbt_utils.surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "name": "surrogate_key", "macro_sql": "{%- macro surrogate_key(field_list) -%}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('surrogate_key', 'dbt_utils')(field_list, *varargs)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3715231, "supported_languages": null}, "macro.dbt_utils.default__surrogate_key": {"unique_id": "macro.dbt_utils.default__surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "name": "default__surrogate_key", "macro_sql": "\n\n{%- macro default__surrogate_key(field_list) -%}\n\n{%- set error_message = '\nWarning: `dbt_utils.surrogate_key` has been replaced by \\\n`dbt_utils.generate_surrogate_key`. The new macro treats null values \\\ndifferently to empty strings. To restore the behaviour of the original \\\nmacro, add a global variable in dbt_project.yml called \\\n`surrogate_key_treat_nulls_as_empty_strings` to your \\\ndbt_project.yml file with a value of True. \\\nThe {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3717601, "supported_languages": null}, "macro.dbt_utils.safe_add": {"unique_id": "macro.dbt_utils.safe_add", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "name": "safe_add", "macro_sql": "{%- macro safe_add(field_list) -%}\n {{ return(adapter.dispatch('safe_add', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__safe_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.37219, "supported_languages": null}, "macro.dbt_utils.default__safe_add": {"unique_id": "macro.dbt_utils.default__safe_add", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "name": "default__safe_add", "macro_sql": "\n\n{%- macro default__safe_add(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_add` macro now takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.warn(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.372732, "supported_languages": null}, "macro.dbt_utils.nullcheck": {"unique_id": "macro.dbt_utils.nullcheck", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "name": "nullcheck", "macro_sql": "{% macro nullcheck(cols) %}\n {{ return(adapter.dispatch('nullcheck', 'dbt_utils')(cols)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.373133, "supported_languages": null}, "macro.dbt_utils.default__nullcheck": {"unique_id": "macro.dbt_utils.default__nullcheck", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "name": "default__nullcheck", "macro_sql": "{% macro default__nullcheck(cols) %}\n{%- for col in cols %}\n\n {% if col.is_string() -%}\n\n nullif({{col.name}},'') as {{col.name}}\n\n {%- else -%}\n\n {{col.name}}\n\n {%- endif -%}\n\n{%- if not loop.last -%} , {%- endif -%}\n\n{%- endfor -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.373457, "supported_languages": null}, "macro.dbt_utils.get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "get_tables_by_pattern_sql", "macro_sql": "{% macro get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_pattern_sql', 'dbt_utils')\n (schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.375073, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.default__get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "default__get_tables_by_pattern_sql", "macro_sql": "{% macro default__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.375426, "supported_languages": null}, "macro.dbt_utils.bigquery__get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.bigquery__get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "bigquery__get_tables_by_pattern_sql", "macro_sql": "{% macro bigquery__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% if '%' in schema_pattern %}\n {% set schemata=dbt_utils._bigquery__get_matching_schemata(schema_pattern, database) %}\n {% else %}\n {% set schemata=[schema_pattern] %}\n {% endif %}\n\n {% set sql %}\n {% for schema in schemata %}\n select distinct\n table_schema,\n table_name,\n {{ dbt_utils.get_table_types_sql() }}\n\n from {{ adapter.quote(database) }}.{{ schema }}.INFORMATION_SCHEMA.TABLES\n where lower(table_name) like lower ('{{ table_pattern }}')\n and lower(table_name) not like lower ('{{ exclude }}')\n\n {% if not loop.last %} union all {% endif %}\n\n {% endfor %}\n {% endset %}\n\n {{ return(sql) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._bigquery__get_matching_schemata", "macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.376197, "supported_languages": null}, "macro.dbt_utils._bigquery__get_matching_schemata": {"unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "_bigquery__get_matching_schemata", "macro_sql": "{% macro _bigquery__get_matching_schemata(schema_pattern, database) %}\n {% if execute %}\n\n {% set sql %}\n select schema_name from {{ adapter.quote(database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like lower('{{ schema_pattern }}')\n {% endset %}\n\n {% set results=run_query(sql) %}\n\n {% set schemata=results.columns['schema_name'].values() %}\n\n {{ return(schemata) }}\n\n {% else %}\n\n {{ return([]) }}\n\n {% endif %}\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.376692, "supported_languages": null}, "macro.dbt_utils.get_column_values": {"unique_id": "macro.dbt_utils.get_column_values", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "name": "get_column_values", "macro_sql": "{% macro get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {{ return(adapter.dispatch('get_column_values', 'dbt_utils')(table, column, order_by, max_records, default, where)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_column_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.377812, "supported_languages": null}, "macro.dbt_utils.default__get_column_values": {"unique_id": "macro.dbt_utils.default__get_column_values", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "name": "default__get_column_values", "macro_sql": "{% macro default__get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {% set default = [] if not default %}\n {{ return(default) }}\n {% endif %}\n\n {%- do dbt_utils._is_ephemeral(table, 'get_column_values') -%}\n\n {# Not all relations are tables. Renaming for internal clarity without breaking functionality for anyone using named arguments #}\n {# TODO: Change the method signature in a future 0.x.0 release #}\n {%- set target_relation = table -%}\n\n {# adapter.load_relation is a convenience wrapper to avoid building a Relation when we already have one #}\n {% set relation_exists = (load_relation(target_relation)) is not none %}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not relation_exists and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ target_relation ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not relation_exists and default is not none -%}\n\n {{ log(\"Relation \" ~ target_relation ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n\n {% if where is not none %}\n where {{ where }}\n {% endif %}\n\n group by {{ column }}\n order by {{ order_by }}\n\n {% if max_records is not none %}\n limit {{ max_records }}\n {% endif %}\n\n {% endif %}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_column_values') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values) }}\n {%- else -%}\n {{ return(default) }}\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_ephemeral", "macro.dbt.load_relation", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.379284, "supported_languages": null}, "macro.dbt_utils.pivot": {"unique_id": "macro.dbt_utils.pivot", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "name": "pivot", "macro_sql": "{% macro pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {{ return(adapter.dispatch('pivot', 'dbt_utils')(column, values, alias, agg, cmp, prefix, suffix, then_value, else_value, quote_identifiers, distinct)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3803542, "supported_languages": null}, "macro.dbt_utils.default__pivot": {"unique_id": "macro.dbt_utils.default__pivot", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "name": "default__pivot", "macro_sql": "{% macro default__pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {% for value in values %}\n {{ agg }}(\n {% if distinct %} distinct {% endif %}\n case\n when {{ column }} {{ cmp }} '{{ dbt.escape_single_quotes(value) }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ value ~ suffix) }}\n {% else %}\n as {{ dbt_utils.slugify(prefix ~ value ~ suffix) }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.escape_single_quotes", "macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3811781, "supported_languages": null}, "macro.dbt_utils.get_filtered_columns_in_relation": {"unique_id": "macro.dbt_utils.get_filtered_columns_in_relation", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "name": "get_filtered_columns_in_relation", "macro_sql": "{% macro get_filtered_columns_in_relation(from, except=[]) -%}\n {{ return(adapter.dispatch('get_filtered_columns_in_relation', 'dbt_utils')(from, except)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3817012, "supported_languages": null}, "macro.dbt_utils.default__get_filtered_columns_in_relation": {"unique_id": "macro.dbt_utils.default__get_filtered_columns_in_relation", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "name": "default__get_filtered_columns_in_relation", "macro_sql": "{% macro default__get_filtered_columns_in_relation(from, except=[]) -%}\n {%- do dbt_utils._is_relation(from, 'get_filtered_columns_in_relation') -%}\n {%- do dbt_utils._is_ephemeral(from, 'get_filtered_columns_in_relation') -%}\n\n {# -- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return('') }}\n {% endif %}\n\n {%- set include_cols = [] %}\n {%- set cols = adapter.get_columns_in_relation(from) -%}\n {%- set except = except | map(\"lower\") | list %}\n {%- for col in cols -%}\n {%- if col.column|lower not in except -%}\n {% do include_cols.append(col.column) %}\n {%- endif %}\n {%- endfor %}\n\n {{ return(include_cols) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.382422, "supported_languages": null}, "macro.dbt_utils.width_bucket": {"unique_id": "macro.dbt_utils.width_bucket", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "name": "width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ return(adapter.dispatch('width_bucket', 'dbt_utils') (expr, min_value, max_value, num_buckets)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__width_bucket"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3838239, "supported_languages": null}, "macro.dbt_utils.default__width_bucket": {"unique_id": "macro.dbt_utils.default__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "name": "default__width_bucket", "macro_sql": "{% macro default__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is eaxtly at the bucket egde\n case\n when\n mod(\n {{ dbt.safe_cast(expr, dbt.type_numeric() ) }},\n {{ dbt.safe_cast(bin_size, dbt.type_numeric() ) }}\n ) = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3842728, "supported_languages": null}, "macro.dbt_utils.redshift__width_bucket": {"unique_id": "macro.dbt_utils.redshift__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "name": "redshift__width_bucket", "macro_sql": "{% macro redshift__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is exactly at the bucket edge\n case\n when\n {{ dbt.safe_cast(expr, dbt.type_numeric() ) }} %\n {{ dbt.safe_cast(bin_size, dbt.type_numeric() ) }}\n = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.384722, "supported_languages": null}, "macro.dbt_utils.snowflake__width_bucket": {"unique_id": "macro.dbt_utils.snowflake__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "name": "snowflake__width_bucket", "macro_sql": "{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.384904, "supported_languages": null}, "macro.dbt_utils.get_query_results_as_dict": {"unique_id": "macro.dbt_utils.get_query_results_as_dict", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "name": "get_query_results_as_dict", "macro_sql": "{% macro get_query_results_as_dict(query) %}\n {{ return(adapter.dispatch('get_query_results_as_dict', 'dbt_utils')(query)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_query_results_as_dict"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.385355, "supported_languages": null}, "macro.dbt_utils.default__get_query_results_as_dict": {"unique_id": "macro.dbt_utils.default__get_query_results_as_dict", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "name": "default__get_query_results_as_dict", "macro_sql": "{% macro default__get_query_results_as_dict(query) %}\n\n{# This macro returns a dictionary of the form {column_name: (tuple_of_results)} #}\n\n {%- call statement('get_query_results', fetch_result=True,auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {% set sql_results={} %}\n\n {%- if execute -%}\n {% set sql_results_table = load_result('get_query_results').table.columns %}\n {% for column_name, column in sql_results_table.items() %}\n {% do sql_results.update({column_name: column.values()}) %}\n {% endfor %}\n {%- endif -%}\n\n {{ return(sql_results) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.385938, "supported_languages": null}, "macro.dbt_utils.generate_surrogate_key": {"unique_id": "macro.dbt_utils.generate_surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "name": "generate_surrogate_key", "macro_sql": "{%- macro generate_surrogate_key(field_list) -%}\n {{ return(adapter.dispatch('generate_surrogate_key', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__generate_surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3864498, "supported_languages": null}, "macro.dbt_utils.default__generate_surrogate_key": {"unique_id": "macro.dbt_utils.default__generate_surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "name": "default__generate_surrogate_key", "macro_sql": "\n\n{%- macro default__generate_surrogate_key(field_list) -%}\n\n{% if var('surrogate_key_treat_nulls_as_empty_strings', False) %}\n {% set default_null_value = \"\" %}\n{% else %}\n {% set default_null_value = '_dbt_utils_surrogate_key_null_'%}\n{% endif %}\n\n{%- set fields = [] -%}\n\n{%- for field in field_list -%}\n\n {%- do fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ dbt.type_string() ~ \"), '\" ~ default_null_value ~\"')\"\n ) -%}\n\n {%- if not loop.last %}\n {%- do fields.append(\"'-'\") -%}\n {%- endif -%}\n\n{%- endfor -%}\n\n{{ dbt.hash(dbt.concat(fields)) }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.hash", "macro.dbt.concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.387093, "supported_languages": null}, "macro.dbt_utils.get_table_types_sql": {"unique_id": "macro.dbt_utils.get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "name": "get_table_types_sql", "macro_sql": "{%- macro get_table_types_sql() -%}\n {{ return(adapter.dispatch('get_table_types_sql', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.postgres__get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3875682, "supported_languages": null}, "macro.dbt_utils.default__get_table_types_sql": {"unique_id": "macro.dbt_utils.default__get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "name": "default__get_table_types_sql", "macro_sql": "{% macro default__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.387705, "supported_languages": null}, "macro.dbt_utils.postgres__get_table_types_sql": {"unique_id": "macro.dbt_utils.postgres__get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "name": "postgres__get_table_types_sql", "macro_sql": "{% macro postgres__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'FOREIGN' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.38784, "supported_languages": null}, "macro.dbt_utils.get_single_value": {"unique_id": "macro.dbt_utils.get_single_value", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "name": "get_single_value", "macro_sql": "{% macro get_single_value(query, default=none) %}\n {{ return(adapter.dispatch('get_single_value', 'dbt_utils')(query, default)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_single_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.388407, "supported_languages": null}, "macro.dbt_utils.default__get_single_value": {"unique_id": "macro.dbt_utils.default__get_single_value", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "name": "default__get_single_value", "macro_sql": "{% macro default__get_single_value(query, default) %}\n\n{# This macro returns the (0, 0) record in a query, i.e. the first row of the first column #}\n\n {%- call statement('get_query_result', fetch_result=True, auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {%- if execute -%}\n\n {% set r = load_result('get_query_result').table.columns[0].values() %}\n {% if r | length == 0 %}\n {% do print('Query `' ~ query ~ '` returned no rows. Using the default value: ' ~ default) %}\n {% set sql_result = default %}\n {% else %}\n {% set sql_result = r[0] %}\n {% endif %}\n \n {%- else -%}\n \n {% set sql_result = default %}\n \n {%- endif -%}\n\n {% do return(sql_result) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.389212, "supported_languages": null}, "macro.dbt_utils.degrees_to_radians": {"unique_id": "macro.dbt_utils.degrees_to_radians", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "degrees_to_radians", "macro_sql": "{% macro degrees_to_radians(degrees) -%}\n acos(-1) * {{degrees}} / 180\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3902662, "supported_languages": null}, "macro.dbt_utils.haversine_distance": {"unique_id": "macro.dbt_utils.haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "haversine_distance", "macro_sql": "{% macro haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n {{ return(adapter.dispatch('haversine_distance', 'dbt_utils')(lat1,lon1,lat2,lon2,unit)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.390539, "supported_languages": null}, "macro.dbt_utils.default__haversine_distance": {"unique_id": "macro.dbt_utils.default__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n\n 2 * 3961 * asin(sqrt(power((sin(radians(({{ lat2 }} - {{ lat1 }}) / 2))), 2) +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n power((sin(radians(({{ lon2 }} - {{ lon1 }}) / 2))), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.391097, "supported_languages": null}, "macro.dbt_utils.bigquery__haversine_distance": {"unique_id": "macro.dbt_utils.bigquery__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "bigquery__haversine_distance", "macro_sql": "{% macro bigquery__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{% set radians_lat1 = dbt_utils.degrees_to_radians(lat1) %}\n{% set radians_lat2 = dbt_utils.degrees_to_radians(lat2) %}\n{% set radians_lon1 = dbt_utils.degrees_to_radians(lon1) %}\n{% set radians_lon2 = dbt_utils.degrees_to_radians(lon2) %}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n 2 * 3961 * asin(sqrt(power(sin(({{ radians_lat2 }} - {{ radians_lat1 }}) / 2), 2) +\n cos({{ radians_lat1 }}) * cos({{ radians_lat2 }}) *\n power(sin(({{ radians_lon2 }} - {{ radians_lon1 }}) / 2), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.degrees_to_radians"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3918788, "supported_languages": null}, "macro.spark_utils.get_tables": {"unique_id": "macro.spark_utils.get_tables", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "name": "get_tables", "macro_sql": "{% macro get_tables(table_regex_pattern='.*') %}\n\n {% set tables = [] %}\n {% for database in spark__list_schemas('not_used') %}\n {% for table in spark__list_relations_without_caching(database[0]) %}\n {% set db_tablename = database[0] ~ \".\" ~ table[1] %}\n {% set is_match = modules.re.match(table_regex_pattern, db_tablename) %}\n {% if is_match %}\n {% call statement('table_detail', fetch_result=True) -%}\n describe extended {{ db_tablename }}\n {% endcall %}\n\n {% set table_type = load_result('table_detail').table|reverse|selectattr(0, 'in', ('type', 'TYPE', 'Type'))|first %}\n {% if table_type[1]|lower != 'view' %}\n {{ tables.append(db_tablename) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% endfor %}\n {{ return(tables) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.396727, "supported_languages": null}, "macro.spark_utils.get_delta_tables": {"unique_id": "macro.spark_utils.get_delta_tables", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "name": "get_delta_tables", "macro_sql": "{% macro get_delta_tables(table_regex_pattern='.*') %}\n\n {% set delta_tables = [] %}\n {% for db_tablename in get_tables(table_regex_pattern) %}\n {% call statement('table_detail', fetch_result=True) -%}\n describe extended {{ db_tablename }}\n {% endcall %}\n\n {% set table_type = load_result('table_detail').table|reverse|selectattr(0, 'in', ('provider', 'PROVIDER', 'Provider'))|first %}\n {% if table_type[1]|lower == 'delta' %}\n {{ delta_tables.append(db_tablename) }}\n {% endif %}\n {% endfor %}\n {{ return(delta_tables) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.get_tables", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.3974159, "supported_languages": null}, "macro.spark_utils.get_statistic_columns": {"unique_id": "macro.spark_utils.get_statistic_columns", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "name": "get_statistic_columns", "macro_sql": "{% macro get_statistic_columns(table) %}\n\n {% call statement('input_columns', fetch_result=True) %}\n SHOW COLUMNS IN {{ table }}\n {% endcall %}\n {% set input_columns = load_result('input_columns').table %}\n\n {% set output_columns = [] %}\n {% for column in input_columns %}\n {% call statement('column_information', fetch_result=True) %}\n DESCRIBE TABLE {{ table }} `{{ column[0] }}`\n {% endcall %}\n {% if not load_result('column_information').table[1][1].startswith('struct') and not load_result('column_information').table[1][1].startswith('array') %}\n {{ output_columns.append('`' ~ column[0] ~ '`') }}\n {% endif %}\n {% endfor %}\n {{ return(output_columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.398295, "supported_languages": null}, "macro.spark_utils.spark_optimize_delta_tables": {"unique_id": "macro.spark_utils.spark_optimize_delta_tables", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "name": "spark_optimize_delta_tables", "macro_sql": "{% macro spark_optimize_delta_tables(table_regex_pattern='.*') %}\n\n {% for table in get_delta_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Optimizing \" ~ table) }}\n {% do run_query(\"optimize \" ~ table) %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.get_delta_tables", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.399031, "supported_languages": null}, "macro.spark_utils.spark_vacuum_delta_tables": {"unique_id": "macro.spark_utils.spark_vacuum_delta_tables", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "name": "spark_vacuum_delta_tables", "macro_sql": "{% macro spark_vacuum_delta_tables(table_regex_pattern='.*') %}\n\n {% for table in get_delta_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Vacuuming \" ~ table) }}\n {% do run_query(\"vacuum \" ~ table) %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.get_delta_tables", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.399758, "supported_languages": null}, "macro.spark_utils.spark_analyze_tables": {"unique_id": "macro.spark_utils.spark_analyze_tables", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "name": "spark_analyze_tables", "macro_sql": "{% macro spark_analyze_tables(table_regex_pattern='.*') %}\n\n {% for table in get_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set columns = get_statistic_columns(table) | join(',') %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Analyzing \" ~ table) }}\n {% if columns != '' %}\n {% do run_query(\"analyze table \" ~ table ~ \" compute statistics for columns \" ~ columns) %}\n {% endif %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.get_tables", "macro.spark_utils.get_statistic_columns", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.400702, "supported_languages": null}, "macro.spark_utils.spark__concat": {"unique_id": "macro.spark_utils.spark__concat", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/spark_utils", "path": "macros/dbt_utils/cross_db_utils/concat.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/concat.sql", "name": "spark__concat", "macro_sql": "{% macro spark__concat(fields) -%}\n concat({{ fields|join(', ') }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.400964, "supported_languages": null}, "macro.spark_utils.spark__type_numeric": {"unique_id": "macro.spark_utils.spark__type_numeric", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/spark_utils", "path": "macros/dbt_utils/cross_db_utils/datatypes.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/datatypes.sql", "name": "spark__type_numeric", "macro_sql": "{% macro spark__type_numeric() %}\n decimal(28, 6)\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.4011478, "supported_languages": null}, "macro.spark_utils.spark__dateadd": {"unique_id": "macro.spark_utils.spark__dateadd", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/spark_utils", "path": "macros/dbt_utils/cross_db_utils/dateadd.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/dateadd.sql", "name": "spark__dateadd", "macro_sql": "{% macro spark__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {%- set clock_component -%}\n {# make sure the dates + timestamps are real, otherwise raise an error asap #}\n to_unix_timestamp({{ spark_utils.assert_not_null('to_timestamp', from_date_or_timestamp) }})\n - to_unix_timestamp({{ spark_utils.assert_not_null('date', from_date_or_timestamp) }})\n {%- endset -%}\n\n {%- if datepart in ['day', 'week'] -%}\n \n {%- set multiplier = 7 if datepart == 'week' else 1 -%}\n\n to_timestamp(\n to_unix_timestamp(\n date_add(\n {{ spark_utils.assert_not_null('date', from_date_or_timestamp) }},\n cast({{interval}} * {{multiplier}} as int)\n )\n ) + {{clock_component}}\n )\n\n {%- elif datepart in ['month', 'quarter', 'year'] -%}\n \n {%- set multiplier -%} \n {%- if datepart == 'month' -%} 1\n {%- elif datepart == 'quarter' -%} 3\n {%- elif datepart == 'year' -%} 12\n {%- endif -%}\n {%- endset -%}\n\n to_timestamp(\n to_unix_timestamp(\n add_months(\n {{ spark_utils.assert_not_null('date', from_date_or_timestamp) }},\n cast({{interval}} * {{multiplier}} as int)\n )\n ) + {{clock_component}}\n )\n\n {%- elif datepart in ('hour', 'minute', 'second', 'millisecond', 'microsecond') -%}\n \n {%- set multiplier -%} \n {%- if datepart == 'hour' -%} 3600\n {%- elif datepart == 'minute' -%} 60\n {%- elif datepart == 'second' -%} 1\n {%- elif datepart == 'millisecond' -%} (1/1000000)\n {%- elif datepart == 'microsecond' -%} (1/1000000)\n {%- endif -%}\n {%- endset -%}\n\n to_timestamp(\n {{ spark_utils.assert_not_null('to_unix_timestamp', from_date_or_timestamp) }}\n + cast({{interval}} * {{multiplier}} as int)\n )\n\n {%- else -%}\n\n {{ exceptions.raise_compiler_error(\"macro dateadd not implemented for datepart ~ '\" ~ datepart ~ \"' ~ on Spark\") }}\n\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.403929, "supported_languages": null}, "macro.spark_utils.spark__datediff": {"unique_id": "macro.spark_utils.spark__datediff", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/spark_utils", "path": "macros/dbt_utils/cross_db_utils/datediff.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/datediff.sql", "name": "spark__datediff", "macro_sql": "{% macro spark__datediff(first_date, second_date, datepart) %}\n\n {%- if datepart in ['day', 'week', 'month', 'quarter', 'year'] -%}\n \n {# make sure the dates are real, otherwise raise an error asap #}\n {% set first_date = spark_utils.assert_not_null('date', first_date) %}\n {% set second_date = spark_utils.assert_not_null('date', second_date) %}\n \n {%- endif -%}\n \n {%- if datepart == 'day' -%}\n \n datediff({{second_date}}, {{first_date}})\n \n {%- elif datepart == 'week' -%}\n \n case when {{first_date}} < {{second_date}}\n then floor(datediff({{second_date}}, {{first_date}})/7)\n else ceil(datediff({{second_date}}, {{first_date}})/7)\n end\n \n -- did we cross a week boundary (Sunday)?\n + case\n when {{first_date}} < {{second_date}} and dayofweek({{second_date}}) < dayofweek({{first_date}}) then 1\n when {{first_date}} > {{second_date}} and dayofweek({{second_date}}) > dayofweek({{first_date}}) then -1\n else 0 end\n\n {%- elif datepart == 'month' -%}\n\n case when {{first_date}} < {{second_date}}\n then floor(months_between(date({{second_date}}), date({{first_date}})))\n else ceil(months_between(date({{second_date}}), date({{first_date}})))\n end\n \n -- did we cross a month boundary?\n + case\n when {{first_date}} < {{second_date}} and dayofmonth({{second_date}}) < dayofmonth({{first_date}}) then 1\n when {{first_date}} > {{second_date}} and dayofmonth({{second_date}}) > dayofmonth({{first_date}}) then -1\n else 0 end\n \n {%- elif datepart == 'quarter' -%}\n \n case when {{first_date}} < {{second_date}}\n then floor(months_between(date({{second_date}}), date({{first_date}}))/3)\n else ceil(months_between(date({{second_date}}), date({{first_date}}))/3)\n end\n \n -- did we cross a quarter boundary?\n + case\n when {{first_date}} < {{second_date}} and (\n (dayofyear({{second_date}}) - (quarter({{second_date}}) * 365/4))\n < (dayofyear({{first_date}}) - (quarter({{first_date}}) * 365/4))\n ) then 1\n when {{first_date}} > {{second_date}} and (\n (dayofyear({{second_date}}) - (quarter({{second_date}}) * 365/4))\n > (dayofyear({{first_date}}) - (quarter({{first_date}}) * 365/4))\n ) then -1\n else 0 end\n\n {%- elif datepart == 'year' -%}\n \n year({{second_date}}) - year({{first_date}})\n\n {%- elif datepart in ('hour', 'minute', 'second', 'millisecond', 'microsecond') -%}\n \n {%- set divisor -%} \n {%- if datepart == 'hour' -%} 3600\n {%- elif datepart == 'minute' -%} 60\n {%- elif datepart == 'second' -%} 1\n {%- elif datepart == 'millisecond' -%} (1/1000)\n {%- elif datepart == 'microsecond' -%} (1/1000000)\n {%- endif -%}\n {%- endset -%}\n\n case when {{first_date}} < {{second_date}}\n then ceil((\n {# make sure the timestamps are real, otherwise raise an error asap #}\n {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', second_date)) }}\n - {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', first_date)) }}\n ) / {{divisor}})\n else floor((\n {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', second_date)) }}\n - {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', first_date)) }}\n ) / {{divisor}})\n end\n \n {% if datepart == 'millisecond' %}\n + cast(date_format({{second_date}}, 'SSS') as int)\n - cast(date_format({{first_date}}, 'SSS') as int)\n {% endif %}\n \n {% if datepart == 'microsecond' %} \n {% set capture_str = '[0-9]{4}-[0-9]{2}-[0-9]{2}.[0-9]{2}:[0-9]{2}:[0-9]{2}.([0-9]{6})' %}\n -- Spark doesn't really support microseconds, so this is a massive hack!\n -- It will only work if the timestamp-string is of the format\n -- 'yyyy-MM-dd-HH mm.ss.SSSSSS'\n + cast(regexp_extract({{second_date}}, '{{capture_str}}', 1) as int)\n - cast(regexp_extract({{first_date}}, '{{capture_str}}', 1) as int) \n {% endif %}\n\n {%- else -%}\n\n {{ exceptions.raise_compiler_error(\"macro datediff not implemented for datepart ~ '\" ~ datepart ~ \"' ~ on Spark\") }}\n\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.411018, "supported_languages": null}, "macro.spark_utils.spark__current_timestamp": {"unique_id": "macro.spark_utils.spark__current_timestamp", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/spark_utils", "path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "name": "spark__current_timestamp", "macro_sql": "{% macro spark__current_timestamp() %}\n current_timestamp()\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.4112341, "supported_languages": null}, "macro.spark_utils.spark__current_timestamp_in_utc": {"unique_id": "macro.spark_utils.spark__current_timestamp_in_utc", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/spark_utils", "path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "name": "spark__current_timestamp_in_utc", "macro_sql": "{% macro spark__current_timestamp_in_utc() %}\n unix_timestamp()\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.411309, "supported_languages": null}, "macro.spark_utils.spark__split_part": {"unique_id": "macro.spark_utils.spark__split_part", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/spark_utils", "path": "macros/dbt_utils/cross_db_utils/split_part.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/split_part.sql", "name": "spark__split_part", "macro_sql": "{% macro spark__split_part(string_text, delimiter_text, part_number) %}\n\n {% set delimiter_expr %}\n \n -- escape if starts with a special character\n case when regexp_extract({{ delimiter_text }}, '([^A-Za-z0-9])(.*)', 1) != '_'\n then concat('\\\\', {{ delimiter_text }})\n else {{ delimiter_text }} end\n \n {% endset %}\n\n {% set split_part_expr %}\n \n split(\n {{ string_text }},\n {{ delimiter_expr }}\n )[({{ part_number - 1 }})]\n \n {% endset %}\n \n {{ return(split_part_expr) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.411943, "supported_languages": null}, "macro.spark_utils.spark__get_relations_by_pattern": {"unique_id": "macro.spark_utils.spark__get_relations_by_pattern", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "name": "spark__get_relations_by_pattern", "macro_sql": "{% macro spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n show table extended in {{ schema_pattern }} like '{{ table_pattern }}'\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=None,\n schema=row[0],\n identifier=row[1],\n type=('view' if 'Type: VIEW' in row[3] else 'table')\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.413548, "supported_languages": null}, "macro.spark_utils.spark__get_relations_by_prefix": {"unique_id": "macro.spark_utils.spark__get_relations_by_prefix", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "name": "spark__get_relations_by_prefix", "macro_sql": "{% macro spark__get_relations_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {% set table_pattern = table_pattern ~ '*' %}\n {{ return(spark_utils.spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.413878, "supported_languages": null}, "macro.spark_utils.spark__get_tables_by_pattern": {"unique_id": "macro.spark_utils.spark__get_tables_by_pattern", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "name": "spark__get_tables_by_pattern", "macro_sql": "{% macro spark__get_tables_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(spark_utils.spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.414145, "supported_languages": null}, "macro.spark_utils.spark__get_tables_by_prefix": {"unique_id": "macro.spark_utils.spark__get_tables_by_prefix", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "name": "spark__get_tables_by_prefix", "macro_sql": "{% macro spark__get_tables_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(spark_utils.spark__get_relations_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.4144099, "supported_languages": null}, "macro.spark_utils.assert_not_null": {"unique_id": "macro.spark_utils.assert_not_null", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/spark_utils", "path": "macros/etc/assert_not_null.sql", "original_file_path": "macros/etc/assert_not_null.sql", "name": "assert_not_null", "macro_sql": "{% macro assert_not_null(function, arg) -%}\n {{ return(adapter.dispatch('assert_not_null', 'spark_utils')(function, arg)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.spark_utils.default__assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.4147992, "supported_languages": null}, "macro.spark_utils.default__assert_not_null": {"unique_id": "macro.spark_utils.default__assert_not_null", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/spark_utils", "path": "macros/etc/assert_not_null.sql", "original_file_path": "macros/etc/assert_not_null.sql", "name": "default__assert_not_null", "macro_sql": "{% macro default__assert_not_null(function, arg) %}\n\n coalesce({{function}}({{arg}}), nvl2({{function}}({{arg}}), assert_true({{function}}({{arg}}) is not null), null))\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.414998, "supported_languages": null}, "macro.spark_utils.spark__convert_timezone": {"unique_id": "macro.spark_utils.spark__convert_timezone", "package_name": "spark_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/spark_utils", "path": "macros/snowplow/convert_timezone.sql", "original_file_path": "macros/snowplow/convert_timezone.sql", "name": "spark__convert_timezone", "macro_sql": "{% macro spark__convert_timezone(in_tz, out_tz, in_timestamp) %}\n from_utc_timestamp(to_utc_timestamp({{in_timestamp}}, {{in_tz}}), {{out_tz}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.4152691, "supported_languages": null}, "macro.fivetran_utils.enabled_vars": {"unique_id": "macro.fivetran_utils.enabled_vars", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/enabled_vars.sql", "original_file_path": "macros/enabled_vars.sql", "name": "enabled_vars", "macro_sql": "{% macro enabled_vars(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, True) == False %}\n {{ return(False) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(True) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.415732, "supported_languages": null}, "macro.fivetran_utils.percentile": {"unique_id": "macro.fivetran_utils.percentile", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "percentile", "macro_sql": "{% macro percentile(percentile_field, partition_field, percent) -%}\n\n{{ adapter.dispatch('percentile', 'fivetran_utils') (percentile_field, partition_field, percent) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.postgres__percentile"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.416666, "supported_languages": null}, "macro.fivetran_utils.default__percentile": {"unique_id": "macro.fivetran_utils.default__percentile", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "default__percentile", "macro_sql": "{% macro default__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.41683, "supported_languages": null}, "macro.fivetran_utils.redshift__percentile": {"unique_id": "macro.fivetran_utils.redshift__percentile", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "redshift__percentile", "macro_sql": "{% macro redshift__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.416985, "supported_languages": null}, "macro.fivetran_utils.bigquery__percentile": {"unique_id": "macro.fivetran_utils.bigquery__percentile", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "bigquery__percentile", "macro_sql": "{% macro bigquery__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.417141, "supported_languages": null}, "macro.fivetran_utils.postgres__percentile": {"unique_id": "macro.fivetran_utils.postgres__percentile", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "postgres__percentile", "macro_sql": "{% macro postgres__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n /* have to group by partition field */\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.417279, "supported_languages": null}, "macro.fivetran_utils.spark__percentile": {"unique_id": "macro.fivetran_utils.spark__percentile", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "name": "spark__percentile", "macro_sql": "{% macro spark__percentile(percentile_field, partition_field, percent) %}\n\n percentile( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.417436, "supported_languages": null}, "macro.fivetran_utils.pivot_json_extract": {"unique_id": "macro.fivetran_utils.pivot_json_extract", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/pivot_json_extract.sql", "original_file_path": "macros/pivot_json_extract.sql", "name": "pivot_json_extract", "macro_sql": "{% macro pivot_json_extract(string, list_of_properties) %}\n\n{%- for property in list_of_properties -%}\n{%- if property is mapping -%}\nreplace( {{ fivetran_utils.json_extract(string, property.name) }}, '\"', '') as {{ property.alias if property.alias else property.name | replace(' ', '_') | replace('.', '_') | lower }}\n\n{%- else -%}\nreplace( {{ fivetran_utils.json_extract(string, property) }}, '\"', '') as {{ property | replace(' ', '_') | lower }}\n\n{%- endif -%}\n{%- if not loop.last -%},{%- endif %}\n{% endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.418331, "supported_languages": null}, "macro.fivetran_utils.persist_pass_through_columns": {"unique_id": "macro.fivetran_utils.persist_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/persist_pass_through_columns.sql", "original_file_path": "macros/persist_pass_through_columns.sql", "name": "persist_pass_through_columns", "macro_sql": "{% macro persist_pass_through_columns(pass_through_variable, identifier=none, transform='') %}\n\n{% if var(pass_through_variable, none) %}\n {% for field in var(pass_through_variable) %}\n , {{ transform ~ '(' ~ (identifier ~ '.' if identifier else '') ~ (field.alias if field.alias else field.name) ~ ')' }} as {{ field.alias if field.alias else field.name }}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.419036, "supported_languages": null}, "macro.fivetran_utils.json_parse": {"unique_id": "macro.fivetran_utils.json_parse", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "json_parse", "macro_sql": "{% macro json_parse(string, string_path) -%}\n\n{{ adapter.dispatch('json_parse', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.postgres__json_parse"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.420141, "supported_languages": null}, "macro.fivetran_utils.default__json_parse": {"unique_id": "macro.fivetran_utils.default__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "default__json_parse", "macro_sql": "{% macro default__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.420387, "supported_languages": null}, "macro.fivetran_utils.redshift__json_parse": {"unique_id": "macro.fivetran_utils.redshift__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "redshift__json_parse", "macro_sql": "{% macro redshift__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.420639, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_parse": {"unique_id": "macro.fivetran_utils.bigquery__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "bigquery__json_parse", "macro_sql": "{% macro bigquery__json_parse(string, string_path) %}\n\n \n json_extract_scalar({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.4208798, "supported_languages": null}, "macro.fivetran_utils.postgres__json_parse": {"unique_id": "macro.fivetran_utils.postgres__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "postgres__json_parse", "macro_sql": "{% macro postgres__json_parse(string, string_path) %}\n\n {{string}}::json #>> '{ {%- for s in string_path -%}{{ s }}{%- if not loop.last -%},{%- endif -%}{%- endfor -%} }'\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.42112, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_parse": {"unique_id": "macro.fivetran_utils.snowflake__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "snowflake__json_parse", "macro_sql": "{% macro snowflake__json_parse(string, string_path) %}\n\n parse_json( {{string}} ) {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.421382, "supported_languages": null}, "macro.fivetran_utils.spark__json_parse": {"unique_id": "macro.fivetran_utils.spark__json_parse", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "name": "spark__json_parse", "macro_sql": "{% macro spark__json_parse(string, string_path) %}\n\n {{string}} : {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.4216409, "supported_languages": null}, "macro.fivetran_utils.max_bool": {"unique_id": "macro.fivetran_utils.max_bool", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "max_bool", "macro_sql": "{% macro max_bool(boolean_field) -%}\n\n{{ adapter.dispatch('max_bool', 'fivetran_utils') (boolean_field) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__max_bool"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.4220228, "supported_languages": null}, "macro.fivetran_utils.default__max_bool": {"unique_id": "macro.fivetran_utils.default__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "default__max_bool", "macro_sql": "{% macro default__max_bool(boolean_field) %}\n\n bool_or( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.422127, "supported_languages": null}, "macro.fivetran_utils.snowflake__max_bool": {"unique_id": "macro.fivetran_utils.snowflake__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "snowflake__max_bool", "macro_sql": "{% macro snowflake__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.4222238, "supported_languages": null}, "macro.fivetran_utils.bigquery__max_bool": {"unique_id": "macro.fivetran_utils.bigquery__max_bool", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "name": "bigquery__max_bool", "macro_sql": "{% macro bigquery__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.4223192, "supported_languages": null}, "macro.fivetran_utils.calculated_fields": {"unique_id": "macro.fivetran_utils.calculated_fields", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/calculated_fields.sql", "original_file_path": "macros/calculated_fields.sql", "name": "calculated_fields", "macro_sql": "{% macro calculated_fields(variable) -%}\n\n{% if var(variable, none) %}\n {% for field in var(variable) %}\n , {{ field.transform_sql }} as {{ field.name }} \n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.4227571, "supported_languages": null}, "macro.fivetran_utils.seed_data_helper": {"unique_id": "macro.fivetran_utils.seed_data_helper", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/seed_data_helper.sql", "original_file_path": "macros/seed_data_helper.sql", "name": "seed_data_helper", "macro_sql": "{% macro seed_data_helper(seed_name, warehouses) %}\n\n{% if target.type in warehouses %}\n {% for w in warehouses %}\n {% if target.type == w %}\n {{ return(ref(seed_name ~ \"_\" ~ w ~ \"\")) }}\n {% endif %}\n {% endfor %}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.423409, "supported_languages": null}, "macro.fivetran_utils.fill_pass_through_columns": {"unique_id": "macro.fivetran_utils.fill_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/fill_pass_through_columns.sql", "original_file_path": "macros/fill_pass_through_columns.sql", "name": "fill_pass_through_columns", "macro_sql": "{% macro fill_pass_through_columns(pass_through_variable) %}\n\n{% if var(pass_through_variable) %}\n {% for field in var(pass_through_variable) %}\n {% if field is mapping %}\n {% if field.transform_sql %}\n , {{ field.transform_sql }} as {{ field.alias if field.alias else field.name }}\n {% else %}\n , {{ field.alias if field.alias else field.name }}\n {% endif %}\n {% else %}\n , {{ field }}\n {% endif %}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.424254, "supported_languages": null}, "macro.fivetran_utils.string_agg": {"unique_id": "macro.fivetran_utils.string_agg", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "string_agg", "macro_sql": "{% macro string_agg(field_to_agg, delimiter) -%}\n\n{{ adapter.dispatch('string_agg', 'fivetran_utils') (field_to_agg, delimiter) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__string_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.424788, "supported_languages": null}, "macro.fivetran_utils.default__string_agg": {"unique_id": "macro.fivetran_utils.default__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "default__string_agg", "macro_sql": "{% macro default__string_agg(field_to_agg, delimiter) %}\n string_agg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.42492, "supported_languages": null}, "macro.fivetran_utils.snowflake__string_agg": {"unique_id": "macro.fivetran_utils.snowflake__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "snowflake__string_agg", "macro_sql": "{% macro snowflake__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.425049, "supported_languages": null}, "macro.fivetran_utils.redshift__string_agg": {"unique_id": "macro.fivetran_utils.redshift__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "redshift__string_agg", "macro_sql": "{% macro redshift__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.4251819, "supported_languages": null}, "macro.fivetran_utils.spark__string_agg": {"unique_id": "macro.fivetran_utils.spark__string_agg", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "name": "spark__string_agg", "macro_sql": "{% macro spark__string_agg(field_to_agg, delimiter) %}\n -- collect set will remove duplicates\n replace(replace(replace(cast( collect_set({{ field_to_agg }}) as string), '[', ''), ']', ''), ', ', {{ delimiter }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.425385, "supported_languages": null}, "macro.fivetran_utils.timestamp_diff": {"unique_id": "macro.fivetran_utils.timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "timestamp_diff", "macro_sql": "{% macro timestamp_diff(first_date, second_date, datepart) %}\n {{ adapter.dispatch('timestamp_diff', 'fivetran_utils')(first_date, second_date, datepart) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.postgres__timestamp_diff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.4281971, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_diff": {"unique_id": "macro.fivetran_utils.default__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "default__timestamp_diff", "macro_sql": "{% macro default__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.4283662, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_diff": {"unique_id": "macro.fivetran_utils.redshift__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "redshift__timestamp_diff", "macro_sql": "{% macro redshift__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.428525, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_diff": {"unique_id": "macro.fivetran_utils.bigquery__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "bigquery__timestamp_diff", "macro_sql": "{% macro bigquery__timestamp_diff(first_date, second_date, datepart) %}\n\n timestamp_diff(\n {{second_date}},\n {{first_date}},\n {{datepart}}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.428682, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_diff": {"unique_id": "macro.fivetran_utils.postgres__timestamp_diff", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "name": "postgres__timestamp_diff", "macro_sql": "{% macro postgres__timestamp_diff(first_date, second_date, datepart) %}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ dbt.datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.430346, "supported_languages": null}, "macro.fivetran_utils.try_cast": {"unique_id": "macro.fivetran_utils.try_cast", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "try_cast", "macro_sql": "{% macro try_cast(field, type) %}\n {{ adapter.dispatch('try_cast', 'fivetran_utils') (field, type) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.postgres__try_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.431246, "supported_languages": null}, "macro.fivetran_utils.default__safe_cast": {"unique_id": "macro.fivetran_utils.default__safe_cast", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.43138, "supported_languages": null}, "macro.fivetran_utils.redshift__try_cast": {"unique_id": "macro.fivetran_utils.redshift__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "redshift__try_cast", "macro_sql": "{% macro redshift__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when trim({{field}}) ~ '^(0|[1-9][0-9]*)$' then trim({{field}})\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.431647, "supported_languages": null}, "macro.fivetran_utils.postgres__try_cast": {"unique_id": "macro.fivetran_utils.postgres__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "postgres__try_cast", "macro_sql": "{% macro postgres__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar)) ~ '^(0|[1-9][0-9]*)$' \n then replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar))\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.431923, "supported_languages": null}, "macro.fivetran_utils.snowflake__try_cast": {"unique_id": "macro.fivetran_utils.snowflake__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "snowflake__try_cast", "macro_sql": "{% macro snowflake__try_cast(field, type) %}\n try_cast(cast({{field}} as varchar) as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.432048, "supported_languages": null}, "macro.fivetran_utils.bigquery__try_cast": {"unique_id": "macro.fivetran_utils.bigquery__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "bigquery__try_cast", "macro_sql": "{% macro bigquery__try_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.43217, "supported_languages": null}, "macro.fivetran_utils.spark__try_cast": {"unique_id": "macro.fivetran_utils.spark__try_cast", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "name": "spark__try_cast", "macro_sql": "{% macro spark__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.432291, "supported_languages": null}, "macro.fivetran_utils.source_relation": {"unique_id": "macro.fivetran_utils.source_relation", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "name": "source_relation", "macro_sql": "{% macro source_relation(union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('source_relation', 'fivetran_utils') (union_schema_variable, union_database_variable) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.432829, "supported_languages": null}, "macro.fivetran_utils.default__source_relation": {"unique_id": "macro.fivetran_utils.default__source_relation", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "name": "default__source_relation", "macro_sql": "{% macro default__source_relation(union_schema_variable, union_database_variable) %}\n\n{% if var(union_schema_variable, none) %}\n, case\n {% for schema in var(union_schema_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%.{{ schema|lower }}.%' then '{{ schema|lower }}'\n {% endfor %}\n end as source_relation\n{% elif var(union_database_variable, none) %}\n, case\n {% for database in var(union_database_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%{{ database|lower }}.%' then '{{ database|lower }}'\n {% endfor %}\n end as source_relation\n{% else %}\n, cast('' as {{ dbt.type_string() }}) as source_relation\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.4333901, "supported_languages": null}, "macro.fivetran_utils.first_value": {"unique_id": "macro.fivetran_utils.first_value", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "first_value", "macro_sql": "{% macro first_value(first_value_field, partition_field, order_by_field, order=\"asc\") -%}\n\n{{ adapter.dispatch('first_value', 'fivetran_utils') (first_value_field, partition_field, order_by_field, order) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__first_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.43395, "supported_languages": null}, "macro.fivetran_utils.default__first_value": {"unique_id": "macro.fivetran_utils.default__first_value", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "default__first_value", "macro_sql": "{% macro default__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.434155, "supported_languages": null}, "macro.fivetran_utils.redshift__first_value": {"unique_id": "macro.fivetran_utils.redshift__first_value", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "name": "redshift__first_value", "macro_sql": "{% macro redshift__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} , {{ partition_field }} rows unbounded preceding )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.4343832, "supported_languages": null}, "macro.fivetran_utils.add_dbt_source_relation": {"unique_id": "macro.fivetran_utils.add_dbt_source_relation", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/add_dbt_source_relation.sql", "original_file_path": "macros/add_dbt_source_relation.sql", "name": "add_dbt_source_relation", "macro_sql": "{% macro add_dbt_source_relation() %}\n\n{% if var('union_schemas', none) or var('union_databases', none) %}\n, _dbt_source_relation\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.434714, "supported_languages": null}, "macro.fivetran_utils.add_pass_through_columns": {"unique_id": "macro.fivetran_utils.add_pass_through_columns", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/add_pass_through_columns.sql", "original_file_path": "macros/add_pass_through_columns.sql", "name": "add_pass_through_columns", "macro_sql": "{% macro add_pass_through_columns(base_columns, pass_through_var) %}\n\n {% if pass_through_var %}\n\n {% for column in pass_through_var %}\n\n {% if column is mapping %}\n\n {% if column.alias %}\n\n {% do base_columns.append({ \"name\": column.name, \"alias\": column.alias, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column.name, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n \n {% endif %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column, \"datatype\": dbt.type_string()}) %}\n\n {% endif %}\n\n {% endfor %}\n\n {% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.435939, "supported_languages": null}, "macro.fivetran_utils.union_relations": {"unique_id": "macro.fivetran_utils.union_relations", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "name": "union_relations", "macro_sql": "{%- macro union_relations(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n {%- set source_column_name = source_column_name if source_column_name is not none else '_dbt_source_relation' -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt.string_literal(relation) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ aliases[loop.index0] if aliases else relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.4398808, "supported_languages": null}, "macro.fivetran_utils.union_tables": {"unique_id": "macro.fivetran_utils.union_tables", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "name": "union_tables", "macro_sql": "{%- macro union_tables(tables, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_table') -%}\n\n {%- do exceptions.warn(\"Warning: the `union_tables` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use the `union_relations` macro instead\") -%}\n\n {{ return(dbt_utils.union_relations(tables, column_override, include, exclude, source_column_name)) }}\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.440248, "supported_languages": null}, "macro.fivetran_utils.snowflake_seed_data": {"unique_id": "macro.fivetran_utils.snowflake_seed_data", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/snowflake_seed_data.sql", "original_file_path": "macros/snowflake_seed_data.sql", "name": "snowflake_seed_data", "macro_sql": "{% macro snowflake_seed_data(seed_name) %}\n\n{% if target.type == 'snowflake' %}\n{{ return(ref(seed_name ~ '_snowflake')) }}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.440714, "supported_languages": null}, "macro.fivetran_utils.fill_staging_columns": {"unique_id": "macro.fivetran_utils.fill_staging_columns", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "name": "fill_staging_columns", "macro_sql": "{% macro fill_staging_columns(source_columns, staging_columns) -%}\n\n{%- set source_column_names = source_columns|map(attribute='name')|map('lower')|list -%}\n\n{%- for column in staging_columns %}\n {% if column.name|lower in source_column_names -%}\n {{ fivetran_utils.quote_column(column) }} as \n {%- if 'alias' in column %} {{ column.alias }} {% else %} {{ fivetran_utils.quote_column(column) }} {%- endif -%}\n {%- else -%}\n cast(null as {{ column.datatype }})\n {%- if 'alias' in column %} as {{ column.alias }} {% else %} as {{ fivetran_utils.quote_column(column) }} {% endif -%}\n {%- endif -%}\n {%- if not loop.last -%} , {% endif -%}\n{% endfor %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.quote_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.442293, "supported_languages": null}, "macro.fivetran_utils.quote_column": {"unique_id": "macro.fivetran_utils.quote_column", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "name": "quote_column", "macro_sql": "{% macro quote_column(column) %}\n {% if 'quote' in column %}\n {% if column.quote %}\n {% if target.type in ('bigquery', 'spark') %}\n `{{ column.name }}`\n {% elif target.type == 'snowflake' %}\n \"{{ column.name | upper }}\"\n {% else %}\n \"{{ column.name }}\"\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.442846, "supported_languages": null}, "macro.fivetran_utils.json_extract": {"unique_id": "macro.fivetran_utils.json_extract", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "json_extract", "macro_sql": "{% macro json_extract(string, string_path) -%}\n\n{{ adapter.dispatch('json_extract', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.postgres__json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.443467, "supported_languages": null}, "macro.fivetran_utils.default__json_extract": {"unique_id": "macro.fivetran_utils.default__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "default__json_extract", "macro_sql": "{% macro default__json_extract(string, string_path) %}\n\n json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} )\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.443627, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_extract": {"unique_id": "macro.fivetran_utils.snowflake__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "snowflake__json_extract", "macro_sql": "{% macro snowflake__json_extract(string, string_path) %}\n\n json_extract_path_text(try_parse_json( {{string}} ), {{ \"'\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.443785, "supported_languages": null}, "macro.fivetran_utils.redshift__json_extract": {"unique_id": "macro.fivetran_utils.redshift__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "redshift__json_extract", "macro_sql": "{% macro redshift__json_extract(string, string_path) %}\n\n case when is_valid_json( {{string}} ) then json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} ) else null end\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.443954, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_extract": {"unique_id": "macro.fivetran_utils.bigquery__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "bigquery__json_extract", "macro_sql": "{% macro bigquery__json_extract(string, string_path) %}\n\n json_extract_scalar({{string}}, {{ \"'$.\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.444108, "supported_languages": null}, "macro.fivetran_utils.postgres__json_extract": {"unique_id": "macro.fivetran_utils.postgres__json_extract", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "name": "postgres__json_extract", "macro_sql": "{% macro postgres__json_extract(string, string_path) %}\n\n {{string}}::json->>{{\"'\" ~ string_path ~ \"'\" }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.4442592, "supported_languages": null}, "macro.fivetran_utils.collect_freshness": {"unique_id": "macro.fivetran_utils.collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "name": "collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness')(source, loaded_at_field, filter))}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.445009, "supported_languages": null}, "macro.fivetran_utils.default__collect_freshness": {"unique_id": "macro.fivetran_utils.default__collect_freshness", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "name": "default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n\n {%- set enabled_array = [] -%}\n {% for node in graph.sources.values() %}\n {% if node.identifier == source.identifier %}\n {% if (node.meta['is_enabled'] | default(true)) %}\n {%- do enabled_array.append(1) -%}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% set is_enabled = (enabled_array != []) %}\n\n select\n {% if is_enabled %}\n max({{ loaded_at_field }})\n {% else %} \n {{ current_timestamp() }} {% endif %} as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n\n {% if is_enabled %}\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endif %}\n\n {% endcall %}\n {{ return(load_result('collect_freshness').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.4459908, "supported_languages": null}, "macro.fivetran_utils.timestamp_add": {"unique_id": "macro.fivetran_utils.timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "timestamp_add", "macro_sql": "{% macro timestamp_add(datepart, interval, from_timestamp) -%}\n\n{{ adapter.dispatch('timestamp_add', 'fivetran_utils') (datepart, interval, from_timestamp) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.postgres__timestamp_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.446718, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_add": {"unique_id": "macro.fivetran_utils.default__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "default__timestamp_add", "macro_sql": "{% macro default__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestampadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.446879, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_add": {"unique_id": "macro.fivetran_utils.bigquery__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "bigquery__timestamp_add", "macro_sql": "{% macro bigquery__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestamp_add({{ from_timestamp }}, interval {{ interval }} {{ datepart }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.4470358, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_add": {"unique_id": "macro.fivetran_utils.redshift__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "redshift__timestamp_add", "macro_sql": "{% macro redshift__timestamp_add(datepart, interval, from_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.447189, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_add": {"unique_id": "macro.fivetran_utils.postgres__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "postgres__timestamp_add", "macro_sql": "{% macro postgres__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ from_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.447344, "supported_languages": null}, "macro.fivetran_utils.spark__timestamp_add": {"unique_id": "macro.fivetran_utils.spark__timestamp_add", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "name": "spark__timestamp_add", "macro_sql": "{% macro spark__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ dbt.dateadd(datepart, interval, from_timestamp) }}\n \n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.447576, "supported_languages": null}, "macro.fivetran_utils.ceiling": {"unique_id": "macro.fivetran_utils.ceiling", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "ceiling", "macro_sql": "{% macro ceiling(num) -%}\n\n{{ adapter.dispatch('ceiling', 'fivetran_utils') (num) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__ceiling"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.447895, "supported_languages": null}, "macro.fivetran_utils.default__ceiling": {"unique_id": "macro.fivetran_utils.default__ceiling", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "default__ceiling", "macro_sql": "{% macro default__ceiling(num) %}\n ceiling({{ num }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.4479969, "supported_languages": null}, "macro.fivetran_utils.snowflake__ceiling": {"unique_id": "macro.fivetran_utils.snowflake__ceiling", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "name": "snowflake__ceiling", "macro_sql": "{% macro snowflake__ceiling(num) %}\n ceil({{ num }})\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.448101, "supported_languages": null}, "macro.fivetran_utils.remove_prefix_from_columns": {"unique_id": "macro.fivetran_utils.remove_prefix_from_columns", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/remove_prefix_from_columns.sql", "original_file_path": "macros/remove_prefix_from_columns.sql", "name": "remove_prefix_from_columns", "macro_sql": "{% macro remove_prefix_from_columns(columns, prefix='', exclude=[]) %}\n\n {%- for col in columns if col.name not in exclude -%}\n {%- if col.name[:prefix|length]|lower == prefix -%}\n {{ col.name }} as {{ col.name[prefix|length:] }}\n {%- else -%}\n {{ col.name }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {% endfor -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.448807, "supported_languages": null}, "macro.fivetran_utils.union_data": {"unique_id": "macro.fivetran_utils.union_data", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "name": "union_data", "macro_sql": "{% macro union_data(table_identifier, database_variable, schema_variable, default_database, default_schema, default_variable, union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('union_data', 'fivetran_utils') (\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__union_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.4502091, "supported_languages": null}, "macro.fivetran_utils.default__union_data": {"unique_id": "macro.fivetran_utils.default__union_data", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "name": "default__union_data", "macro_sql": "{% macro default__union_data(\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) %}\n\n{% if var(union_schema_variable, none) %}\n\n {% set relations = [] %}\n \n {% if var(union_schema_variable) is string %}\n {% set trimmed = var(union_schema_variable)|trim('[')|trim(']') %}\n {% set schemas = trimmed.split(',')|map('trim',\" \")|map('trim','\"')|map('trim',\"'\") %}\n {% else %}\n {% set schemas = var(union_schema_variable) %}\n {% endif %}\n\n {% for schema in var(union_schema_variable) %}\n {% set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else var(database_variable, default_database),\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else schema,\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n \n {% set relation_exists=relation is not none %}\n\n {% if relation_exists %}\n\n {% do relations.append(relation) %}\n \n {% endif %}\n\n {% endfor %}\n\n {{ dbt_utils.union_relations(relations) }}\n\n{% elif var(union_database_variable, none) %}\n\n {% set relations = [] %}\n\n {% for database in var(union_database_variable) %}\n\n {% set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else database,\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else var(schema_variable, default_schema),\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n\n {% set relation_exists=relation is not none %}\n\n {% if relation_exists %}\n\n {% do relations.append(relation) %}\n \n {% endif %}\n\n {% endfor %}\n\n {{ dbt_utils.union_relations(relations) }}\n\n{% else %}\n\n select * \n from {{ var(default_variable) }}\n\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.452804, "supported_languages": null}, "macro.fivetran_utils.dummy_coalesce_value": {"unique_id": "macro.fivetran_utils.dummy_coalesce_value", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/dummy_coalesce_value.sql", "original_file_path": "macros/dummy_coalesce_value.sql", "name": "dummy_coalesce_value", "macro_sql": "{% macro dummy_coalesce_value(column) %}\n\n{% set coalesce_value = {\n 'STRING': \"'DUMMY_STRING'\",\n 'BOOLEAN': 'null',\n 'INT': 999999999,\n 'FLOAT': 999999999.99,\n 'TIMESTAMP': 'cast(\"2099-12-31\" as timestamp)',\n 'DATE': 'cast(\"2099-12-31\" as date)',\n} %}\n\n{% if column.is_float() %}\n{{ return(coalesce_value['FLOAT']) }}\n\n{% elif column.is_numeric() %}\n{{ return(coalesce_value['INT']) }}\n\n{% elif column.is_string() %}\n{{ return(coalesce_value['STRING']) }}\n\n{% elif column.data_type|lower == 'boolean' %}\n{{ return(coalesce_value['BOOLEAN']) }}\n\n{% elif 'timestamp' in column.data_type|lower %}\n{{ return(coalesce_value['TIMESTAMP']) }}\n\n{% elif 'date' in column.data_type|lower %}\n{{ return(coalesce_value['DATE']) }}\n\n{% elif 'int' in column.data_type|lower %}\n{{ return(coalesce_value['INT']) }}\n\n{% endif %}\n\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.454303, "supported_languages": null}, "macro.fivetran_utils.array_agg": {"unique_id": "macro.fivetran_utils.array_agg", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "array_agg", "macro_sql": "{% macro array_agg(field_to_agg) -%}\n\n{{ adapter.dispatch('array_agg', 'fivetran_utils') (field_to_agg) }}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.fivetran_utils.default__array_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.4546402, "supported_languages": null}, "macro.fivetran_utils.default__array_agg": {"unique_id": "macro.fivetran_utils.default__array_agg", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "default__array_agg", "macro_sql": "{% macro default__array_agg(field_to_agg) %}\n array_agg({{ field_to_agg }})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.454744, "supported_languages": null}, "macro.fivetran_utils.redshift__array_agg": {"unique_id": "macro.fivetran_utils.redshift__array_agg", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "name": "redshift__array_agg", "macro_sql": "{% macro redshift__array_agg(field_to_agg) %}\n listagg({{ field_to_agg }}, ',')\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.454845, "supported_languages": null}, "macro.fivetran_utils.empty_variable_warning": {"unique_id": "macro.fivetran_utils.empty_variable_warning", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/empty_variable_warning.sql", "original_file_path": "macros/empty_variable_warning.sql", "name": "empty_variable_warning", "macro_sql": "{% macro empty_variable_warning(variable, downstream_model) %}\n\n{% if not var(variable) %}\n{{ log(\n \"\"\"\n Warning: You have passed an empty list to the \"\"\" ~ variable ~ \"\"\".\n As a result, you won't see the history of any columns in the \"\"\" ~ downstream_model ~ \"\"\" model.\n \"\"\",\n info=True\n) }}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.455303, "supported_languages": null}, "macro.fivetran_utils.enabled_vars_one_true": {"unique_id": "macro.fivetran_utils.enabled_vars_one_true", "package_name": "fivetran_utils", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/fivetran_utils", "path": "macros/enabled_vars_one_true.sql", "original_file_path": "macros/enabled_vars_one_true.sql", "name": "enabled_vars_one_true", "macro_sql": "{% macro enabled_vars_one_true(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, False) == True %}\n {{ return(True) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(False) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.455758, "supported_languages": null}, "macro.github_source.get_issue_columns": {"unique_id": "macro.github_source.get_issue_columns", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_columns.sql", "original_file_path": "macros/get_issue_columns.sql", "name": "get_issue_columns", "macro_sql": "{% macro get_issue_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"body\", \"datatype\": dbt.type_string()},\n {\"name\": \"closed_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"locked\", \"datatype\": \"boolean\"},\n {\"name\": \"milestone_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"number\", \"datatype\": dbt.type_int()},\n {\"name\": \"pull_request\", \"datatype\": \"boolean\"},\n {\"name\": \"repository_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"state\", \"datatype\": dbt.type_string()},\n {\"name\": \"title\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"user_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.4573781, "supported_languages": null}, "macro.github_source.get_issue_comment_columns": {"unique_id": "macro.github_source.get_issue_comment_columns", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_comment_columns.sql", "original_file_path": "macros/get_issue_comment_columns.sql", "name": "get_issue_comment_columns", "macro_sql": "{% macro get_issue_comment_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"body\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"user_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.4583738, "supported_languages": null}, "macro.github_source.get_repository_columns": {"unique_id": "macro.github_source.get_repository_columns", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_repository_columns.sql", "original_file_path": "macros/get_repository_columns.sql", "name": "get_repository_columns", "macro_sql": "{% macro get_repository_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"archived\", \"datatype\": \"boolean\"},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"default_branch\", \"datatype\": dbt.type_string()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"fork\", \"datatype\": \"boolean\"},\n {\"name\": \"full_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"homepage\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"language\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"owner_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"private\", \"datatype\": \"boolean\"}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.459841, "supported_languages": null}, "macro.github_source.get_issue_merged_columns": {"unique_id": "macro.github_source.get_issue_merged_columns", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_merged_columns.sql", "original_file_path": "macros/get_issue_merged_columns.sql", "name": "get_issue_merged_columns", "macro_sql": "{% macro get_issue_merged_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"actor_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"commit_sha\", \"datatype\": dbt.type_string()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"merged_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.4606001, "supported_languages": null}, "macro.github_source.get_pull_request_review_columns": {"unique_id": "macro.github_source.get_pull_request_review_columns", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_pull_request_review_columns.sql", "original_file_path": "macros/get_pull_request_review_columns.sql", "name": "get_pull_request_review_columns", "macro_sql": "{% macro get_pull_request_review_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"body\", \"datatype\": dbt.type_string()},\n {\"name\": \"commit_sha\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"pull_request_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"state\", \"datatype\": dbt.type_string()},\n {\"name\": \"submitted_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"user_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.461632, "supported_languages": null}, "macro.github_source.get_team_columns": {"unique_id": "macro.github_source.get_team_columns", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_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_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"org_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"parent_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"privacy\", \"datatype\": dbt.type_string()},\n {\"name\": \"slug\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.462652, "supported_languages": null}, "macro.github_source.get_issue_assignee_columns": {"unique_id": "macro.github_source.get_issue_assignee_columns", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_assignee_columns.sql", "original_file_path": "macros/get_issue_assignee_columns.sql", "name": "get_issue_assignee_columns", "macro_sql": "{% macro get_issue_assignee_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"user_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.463208, "supported_languages": null}, "macro.github_source.get_user_columns": {"unique_id": "macro.github_source.get_user_columns", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_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\": \"company\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"login\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.4638562, "supported_languages": null}, "macro.github_source.get_label_columns": {"unique_id": "macro.github_source.get_label_columns", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_label_columns.sql", "original_file_path": "macros/get_label_columns.sql", "name": "get_label_columns", "macro_sql": "{% macro get_label_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"color\", \"datatype\": dbt.type_string()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"is_default\", \"datatype\": \"boolean\"},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"url\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.464766, "supported_languages": null}, "macro.github_source.get_pull_request_columns": {"unique_id": "macro.github_source.get_pull_request_columns", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_pull_request_columns.sql", "original_file_path": "macros/get_pull_request_columns.sql", "name": "get_pull_request_columns", "macro_sql": "{% macro get_pull_request_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"base_label\", \"datatype\": dbt.type_string()},\n {\"name\": \"base_ref\", \"datatype\": dbt.type_string()},\n {\"name\": \"base_repo_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"base_sha\", \"datatype\": dbt.type_string()},\n {\"name\": \"base_user_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"head_label\", \"datatype\": dbt.type_string()},\n {\"name\": \"head_ref\", \"datatype\": dbt.type_string()},\n {\"name\": \"head_repo_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"head_sha\", \"datatype\": dbt.type_string()},\n {\"name\": \"head_user_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"id\", \"datatype\": dbt.type_int()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"merge_commit_sha\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.466433, "supported_languages": null}, "macro.github_source.get_requested_reviewer_history_columns": {"unique_id": "macro.github_source.get_requested_reviewer_history_columns", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_requested_reviewer_history_columns.sql", "original_file_path": "macros/get_requested_reviewer_history_columns.sql", "name": "get_requested_reviewer_history_columns", "macro_sql": "{% macro get_requested_reviewer_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"actor_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"created_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"pull_request_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"removed\", \"datatype\": \"boolean\"},\n {\"name\": \"requested_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.467259, "supported_languages": null}, "macro.github_source.get_issue_closed_history_columns": {"unique_id": "macro.github_source.get_issue_closed_history_columns", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_closed_history_columns.sql", "original_file_path": "macros/get_issue_closed_history_columns.sql", "name": "get_issue_closed_history_columns", "macro_sql": "{% macro get_issue_closed_history_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"actor_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"closed\", \"datatype\": \"boolean\"},\n {\"name\": \"commit_sha\", \"datatype\": dbt.type_string()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.468087, "supported_languages": null}, "macro.github_source.get_repo_team_columns": {"unique_id": "macro.github_source.get_repo_team_columns", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_repo_team_columns.sql", "original_file_path": "macros/get_repo_team_columns.sql", "name": "get_repo_team_columns", "macro_sql": "{% macro get_repo_team_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"permission\", \"datatype\": dbt.type_string()},\n {\"name\": \"repository_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"team_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.468731, "supported_languages": null}, "macro.github_source.get_issue_label_columns": {"unique_id": "macro.github_source.get_issue_label_columns", "package_name": "github_source", "root_path": "/Users/joseph.markiewicz/Documents/dbt_packages/github/dbt_github/integration_tests/dbt_packages/github_source", "path": "macros/get_issue_label_columns.sql", "original_file_path": "macros/get_issue_label_columns.sql", "name": "get_issue_label_columns", "macro_sql": "{% macro get_issue_label_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"label_id\", \"datatype\": dbt.type_int()},\n {\"name\": \"issue_id\", \"datatype\": dbt.type_int()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1671481511.4692822, "supported_languages": null}}, "docs": {"dbt.__overview__": {"unique_id": "dbt.__overview__", "package_name": "dbt", "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.3.0/libexec/lib/python3.9/site-packages/dbt/include/global_project", "path": "overview.md", "original_file_path": "docs/overview.md", "name": "__overview__", "block_contents": "### Welcome!\n\nWelcome to the auto-generated documentation for your dbt project!\n\n### Navigation\n\nYou can use the `Project` and `Database` navigation tabs on the left side of the window to explore the models\nin your project.\n\n#### Project Tab\nThe `Project` tab mirrors the directory structure of your dbt project. In this tab, you can see all of the\nmodels defined in your dbt project, as well as models imported from dbt packages.\n\n#### Database Tab\nThe `Database` tab also exposes your models, but in a format that looks more like a database explorer. This view\nshows relations (tables and views) grouped into database schemas. Note that ephemeral models are _not_ shown\nin this interface, as they do not exist in the database.\n\n### Graph Exploration\nYou can click the blue icon on the bottom-right corner of the page to view the lineage graph of your models.\n\nOn model pages, you'll see the immediate parents and children of the model you're exploring. By clicking the `Expand`\nbutton at the top-right of this lineage pane, you'll be able to see all of the models that are used to build,\nor are built from, the model you're exploring.\n\nOnce expanded, you'll be able to use the `--select` and `--exclude` model selection syntax to filter the\nmodels in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax).\n\nNote that you can also right-click on models to interactively filter and explore the graph.\n\n---\n\n### More information\n\n- [What is dbt](https://docs.getdbt.com/docs/introduction)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [dbt Community](https://www.getdbt.com/community/) for questions and discussion"}}, "exposures": {}, "metrics": {}, "selectors": {}, "disabled": {}, "parent_map": {"seed.github_integration_tests.github_pull_request_review_data": [], "seed.github_integration_tests.github_label_data": [], "seed.github_integration_tests.github_repository_data": [], "seed.github_integration_tests.github_issue_merged_data": [], "seed.github_integration_tests.github_issue_data": [], "seed.github_integration_tests.github_repo_team_data": [], "seed.github_integration_tests.github_requested_reviewer_history_data": [], "seed.github_integration_tests.github_issue_label_data": [], "seed.github_integration_tests.github_issue_comment_data": [], "seed.github_integration_tests.github_issue_assignee_data": [], "seed.github_integration_tests.github_issue_closed_history_data": [], "seed.github_integration_tests.github_pull_request_data": [], "seed.github_integration_tests.github_team_data": [], "seed.github_integration_tests.github_user_data": [], "model.github.github__weekly_metrics": ["model.github.github__daily_metrics"], "model.github.github__monthly_metrics": ["model.github.github__daily_metrics"], "model.github.github__quarterly_metrics": ["model.github.github__daily_metrics"], "model.github.github__pull_requests": ["model.github.int_github__issue_joined"], "model.github.github__daily_metrics": ["model.github.github__issues", "model.github.github__pull_requests"], "model.github.github__issues": ["model.github.int_github__issue_joined"], "model.github.int_github__pull_request_times": ["model.github_source.stg_github__issue", "model.github_source.stg_github__issue_merged", "model.github_source.stg_github__pull_request", "model.github_source.stg_github__pull_request_review", "model.github_source.stg_github__requested_reviewer_history"], "model.github.int_github__pull_request_reviewers": ["model.github_source.stg_github__pull_request_review", "model.github_source.stg_github__user"], "model.github.int_github__issue_label_joined": ["model.github_source.stg_github__issue_label", "model.github_source.stg_github__label"], "model.github.int_github__issue_joined": ["model.github.int_github__issue_assignees", "model.github.int_github__issue_comments", "model.github.int_github__issue_labels", "model.github.int_github__issue_open_length", "model.github.int_github__pull_request_reviewers", "model.github.int_github__pull_request_times", "model.github.int_github__repository_teams", "model.github_source.stg_github__issue", "model.github_source.stg_github__pull_request", "model.github_source.stg_github__user"], "model.github.int_github__issue_labels": ["model.github.int_github__issue_label_joined"], "model.github.int_github__issue_assignees": ["model.github_source.stg_github__issue_assignee", "model.github_source.stg_github__user"], "model.github.int_github__issue_comments": ["model.github_source.stg_github__issue_comment"], "model.github.int_github__issue_open_length": ["model.github_source.stg_github__issue", "model.github_source.stg_github__issue_closed_history"], "model.github.int_github__repository_teams": ["model.github_source.stg_github__repo_team", "model.github_source.stg_github__repository", "model.github_source.stg_github__team"], "model.github_source.stg_github__issue_comment": ["model.github_source.stg_github__issue_comment_tmp", "model.github_source.stg_github__issue_comment_tmp"], "model.github_source.stg_github__requested_reviewer_history": ["model.github_source.stg_github__requested_reviewer_history_tmp", "model.github_source.stg_github__requested_reviewer_history_tmp"], "model.github_source.stg_github__issue_label": ["model.github_source.stg_github__issue_label_tmp", "model.github_source.stg_github__issue_label_tmp"], "model.github_source.stg_github__issue_merged": ["model.github_source.stg_github__issue_merged_tmp", "model.github_source.stg_github__issue_merged_tmp"], "model.github_source.stg_github__issue_closed_history": ["model.github_source.stg_github__issue_closed_history_tmp", "model.github_source.stg_github__issue_closed_history_tmp"], "model.github_source.stg_github__issue_assignee": ["model.github_source.stg_github__issue_assignee_tmp", "model.github_source.stg_github__issue_assignee_tmp"], "model.github_source.stg_github__repository": ["model.github_source.stg_github__repository_tmp", "model.github_source.stg_github__repository_tmp"], "model.github_source.stg_github__user": ["model.github_source.stg_github__user_tmp", "model.github_source.stg_github__user_tmp"], "model.github_source.stg_github__pull_request_review": ["model.github_source.stg_github__pull_request_review_tmp", "model.github_source.stg_github__pull_request_review_tmp"], "model.github_source.stg_github__repo_team": ["model.github_source.stg_github__repo_team_tmp", "model.github_source.stg_github__repo_team_tmp"], "model.github_source.stg_github__label": ["model.github_source.stg_github__label_tmp", "model.github_source.stg_github__label_tmp"], "model.github_source.stg_github__issue": ["model.github_source.stg_github__issue_tmp", "model.github_source.stg_github__issue_tmp"], "model.github_source.stg_github__team": ["model.github_source.stg_github__team_tmp", "model.github_source.stg_github__team_tmp"], "model.github_source.stg_github__pull_request": ["model.github_source.stg_github__pull_request_tmp", "model.github_source.stg_github__pull_request_tmp"], "model.github_source.stg_github__repository_tmp": ["source.github_source.github.repository"], "model.github_source.stg_github__label_tmp": ["source.github_source.github.label"], "model.github_source.stg_github__requested_reviewer_history_tmp": ["source.github_source.github.requested_reviewer_history"], "model.github_source.stg_github__issue_comment_tmp": ["source.github_source.github.issue_comment"], "model.github_source.stg_github__pull_request_review_tmp": ["source.github_source.github.pull_request_review"], "model.github_source.stg_github__issue_label_tmp": ["source.github_source.github.issue_label"], "model.github_source.stg_github__team_tmp": ["source.github_source.github.team"], "model.github_source.stg_github__pull_request_tmp": ["source.github_source.github.pull_request"], "model.github_source.stg_github__issue_merged_tmp": ["source.github_source.github.issue_merged"], "model.github_source.stg_github__user_tmp": ["source.github_source.github.user"], "model.github_source.stg_github__issue_closed_history_tmp": ["source.github_source.github.issue_closed_history"], "model.github_source.stg_github__issue_assignee_tmp": ["source.github_source.github.issue_assignee"], "model.github_source.stg_github__issue_tmp": ["source.github_source.github.issue"], "model.github_source.stg_github__repo_team_tmp": ["source.github_source.github.repo_team"], "test.github.unique_github__issues_issue_id.6723b9b1db": ["model.github.github__issues"], "test.github.not_null_github__issues_issue_id.fed0631e25": ["model.github.github__issues"], "test.github.unique_github__pull_requests_issue_id.ce23997907": ["model.github.github__pull_requests"], "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f": ["model.github.github__pull_requests"], "test.github.unique_github__daily_metrics_day.f98cab9456": ["model.github.github__daily_metrics"], "test.github.not_null_github__daily_metrics_day.647e494434": ["model.github.github__daily_metrics"], "test.github.unique_github__weekly_metrics_week.6794858a8e": ["model.github.github__weekly_metrics"], "test.github.not_null_github__weekly_metrics_week.4b0b928243": ["model.github.github__weekly_metrics"], "test.github.unique_github__monthly_metrics_month.3076284fbb": ["model.github.github__monthly_metrics"], "test.github.not_null_github__monthly_metrics_month.9e4fba84df": ["model.github.github__monthly_metrics"], "test.github.unique_github__quarterly_metrics_quarter.9165a921c1": ["model.github.github__quarterly_metrics"], "test.github.not_null_github__quarterly_metrics_quarter.92394d46dc": ["model.github.github__quarterly_metrics"], "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4": ["model.github_source.stg_github__issue_assignee"], "test.github_source.not_null_stg_github__label_label_id.9f07379974": ["model.github_source.stg_github__label"], "test.github_source.unique_stg_github__label_label_id.74d3c21466": ["model.github_source.stg_github__label"], "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d": ["model.github_source.stg_github__issue_closed_history"], "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a": ["model.github_source.stg_github__issue_comment"], "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f": ["model.github_source.stg_github__issue_comment"], "test.github_source.unique_stg_github__issue_issue_id.84891aeece": ["model.github_source.stg_github__issue"], "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7": ["model.github_source.stg_github__issue"], "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508": ["model.github_source.stg_github__pull_request_review"], "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790": ["model.github_source.stg_github__pull_request_review"], "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa": ["model.github_source.stg_github__pull_request"], "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71": ["model.github_source.stg_github__pull_request"], "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503": ["model.github_source.stg_github__repo_team"], "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c": ["model.github_source.stg_github__repo_team"], "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d": ["model.github_source.stg_github__repository"], "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f": ["model.github_source.stg_github__repository"], "test.github_source.unique_stg_github__team_team_id.94e9716ab4": ["model.github_source.stg_github__team"], "test.github_source.not_null_stg_github__team_team_id.440aefe7a7": ["model.github_source.stg_github__team"], "test.github_source.unique_stg_github__user_user_id.5c1a00cd90": ["model.github_source.stg_github__user"], "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b": ["model.github_source.stg_github__user"], "source.github_source.github.issue_assignee": [], "source.github_source.github.label": [], "source.github_source.github.issue_closed_history": [], "source.github_source.github.issue_label": [], "source.github_source.github.issue_comment": [], "source.github_source.github.issue_merged": [], "source.github_source.github.issue": [], "source.github_source.github.pull_request_review": [], "source.github_source.github.pull_request": [], "source.github_source.github.repo_team": [], "source.github_source.github.repository": [], "source.github_source.github.requested_reviewer_history": [], "source.github_source.github.team": [], "source.github_source.github.user": []}, "child_map": {"seed.github_integration_tests.github_pull_request_review_data": [], "seed.github_integration_tests.github_label_data": [], "seed.github_integration_tests.github_repository_data": [], "seed.github_integration_tests.github_issue_merged_data": [], "seed.github_integration_tests.github_issue_data": [], "seed.github_integration_tests.github_repo_team_data": [], "seed.github_integration_tests.github_requested_reviewer_history_data": [], "seed.github_integration_tests.github_issue_label_data": [], "seed.github_integration_tests.github_issue_comment_data": [], "seed.github_integration_tests.github_issue_assignee_data": [], "seed.github_integration_tests.github_issue_closed_history_data": [], "seed.github_integration_tests.github_pull_request_data": [], "seed.github_integration_tests.github_team_data": [], "seed.github_integration_tests.github_user_data": [], "model.github.github__weekly_metrics": ["test.github.not_null_github__weekly_metrics_week.4b0b928243", "test.github.unique_github__weekly_metrics_week.6794858a8e"], "model.github.github__monthly_metrics": ["test.github.not_null_github__monthly_metrics_month.9e4fba84df", "test.github.unique_github__monthly_metrics_month.3076284fbb"], "model.github.github__quarterly_metrics": ["test.github.not_null_github__quarterly_metrics_quarter.92394d46dc", "test.github.unique_github__quarterly_metrics_quarter.9165a921c1"], "model.github.github__pull_requests": ["model.github.github__daily_metrics", "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f", "test.github.unique_github__pull_requests_issue_id.ce23997907"], "model.github.github__daily_metrics": ["model.github.github__monthly_metrics", "model.github.github__quarterly_metrics", "model.github.github__weekly_metrics", "test.github.not_null_github__daily_metrics_day.647e494434", "test.github.unique_github__daily_metrics_day.f98cab9456"], "model.github.github__issues": ["model.github.github__daily_metrics", "test.github.not_null_github__issues_issue_id.fed0631e25", "test.github.unique_github__issues_issue_id.6723b9b1db"], "model.github.int_github__pull_request_times": ["model.github.int_github__issue_joined"], "model.github.int_github__pull_request_reviewers": ["model.github.int_github__issue_joined"], "model.github.int_github__issue_label_joined": ["model.github.int_github__issue_labels"], "model.github.int_github__issue_joined": ["model.github.github__issues", "model.github.github__pull_requests"], "model.github.int_github__issue_labels": ["model.github.int_github__issue_joined"], "model.github.int_github__issue_assignees": ["model.github.int_github__issue_joined"], "model.github.int_github__issue_comments": ["model.github.int_github__issue_joined"], "model.github.int_github__issue_open_length": ["model.github.int_github__issue_joined"], "model.github.int_github__repository_teams": ["model.github.int_github__issue_joined"], "model.github_source.stg_github__issue_comment": ["model.github.int_github__issue_comments", "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f", "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a"], "model.github_source.stg_github__requested_reviewer_history": ["model.github.int_github__pull_request_times"], "model.github_source.stg_github__issue_label": ["model.github.int_github__issue_label_joined"], "model.github_source.stg_github__issue_merged": ["model.github.int_github__pull_request_times"], "model.github_source.stg_github__issue_closed_history": ["model.github.int_github__issue_open_length", "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d"], "model.github_source.stg_github__issue_assignee": ["model.github.int_github__issue_assignees", "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4"], "model.github_source.stg_github__repository": ["model.github.int_github__repository_teams", "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f", "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d"], "model.github_source.stg_github__user": ["model.github.int_github__issue_assignees", "model.github.int_github__issue_joined", "model.github.int_github__pull_request_reviewers", "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b", "test.github_source.unique_stg_github__user_user_id.5c1a00cd90"], "model.github_source.stg_github__pull_request_review": ["model.github.int_github__pull_request_reviewers", "model.github.int_github__pull_request_times", "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790", "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508"], "model.github_source.stg_github__repo_team": ["model.github.int_github__repository_teams", "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503", "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c"], "model.github_source.stg_github__label": ["model.github.int_github__issue_label_joined", "test.github_source.not_null_stg_github__label_label_id.9f07379974", "test.github_source.unique_stg_github__label_label_id.74d3c21466"], "model.github_source.stg_github__issue": ["model.github.int_github__issue_joined", "model.github.int_github__issue_open_length", "model.github.int_github__pull_request_times", "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7", "test.github_source.unique_stg_github__issue_issue_id.84891aeece"], "model.github_source.stg_github__team": ["model.github.int_github__repository_teams", "test.github_source.not_null_stg_github__team_team_id.440aefe7a7", "test.github_source.unique_stg_github__team_team_id.94e9716ab4"], "model.github_source.stg_github__pull_request": ["model.github.int_github__issue_joined", "model.github.int_github__pull_request_times", "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71", "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa"], "model.github_source.stg_github__repository_tmp": ["model.github_source.stg_github__repository", "model.github_source.stg_github__repository"], "model.github_source.stg_github__label_tmp": ["model.github_source.stg_github__label", "model.github_source.stg_github__label"], "model.github_source.stg_github__requested_reviewer_history_tmp": ["model.github_source.stg_github__requested_reviewer_history", "model.github_source.stg_github__requested_reviewer_history"], "model.github_source.stg_github__issue_comment_tmp": ["model.github_source.stg_github__issue_comment", "model.github_source.stg_github__issue_comment"], "model.github_source.stg_github__pull_request_review_tmp": ["model.github_source.stg_github__pull_request_review", "model.github_source.stg_github__pull_request_review"], "model.github_source.stg_github__issue_label_tmp": ["model.github_source.stg_github__issue_label", "model.github_source.stg_github__issue_label"], "model.github_source.stg_github__team_tmp": ["model.github_source.stg_github__team", "model.github_source.stg_github__team"], "model.github_source.stg_github__pull_request_tmp": ["model.github_source.stg_github__pull_request", "model.github_source.stg_github__pull_request"], "model.github_source.stg_github__issue_merged_tmp": ["model.github_source.stg_github__issue_merged", "model.github_source.stg_github__issue_merged"], "model.github_source.stg_github__user_tmp": ["model.github_source.stg_github__user", "model.github_source.stg_github__user"], "model.github_source.stg_github__issue_closed_history_tmp": ["model.github_source.stg_github__issue_closed_history", "model.github_source.stg_github__issue_closed_history"], "model.github_source.stg_github__issue_assignee_tmp": ["model.github_source.stg_github__issue_assignee", "model.github_source.stg_github__issue_assignee"], "model.github_source.stg_github__issue_tmp": ["model.github_source.stg_github__issue", "model.github_source.stg_github__issue"], "model.github_source.stg_github__repo_team_tmp": ["model.github_source.stg_github__repo_team", "model.github_source.stg_github__repo_team"], "test.github.unique_github__issues_issue_id.6723b9b1db": [], "test.github.not_null_github__issues_issue_id.fed0631e25": [], "test.github.unique_github__pull_requests_issue_id.ce23997907": [], "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f": [], "test.github.unique_github__daily_metrics_day.f98cab9456": [], "test.github.not_null_github__daily_metrics_day.647e494434": [], "test.github.unique_github__weekly_metrics_week.6794858a8e": [], "test.github.not_null_github__weekly_metrics_week.4b0b928243": [], "test.github.unique_github__monthly_metrics_month.3076284fbb": [], "test.github.not_null_github__monthly_metrics_month.9e4fba84df": [], "test.github.unique_github__quarterly_metrics_quarter.9165a921c1": [], "test.github.not_null_github__quarterly_metrics_quarter.92394d46dc": [], "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4": [], "test.github_source.not_null_stg_github__label_label_id.9f07379974": [], "test.github_source.unique_stg_github__label_label_id.74d3c21466": [], "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d": [], "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a": [], "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f": [], "test.github_source.unique_stg_github__issue_issue_id.84891aeece": [], "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7": [], "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508": [], "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790": [], "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa": [], "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71": [], "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503": [], "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c": [], "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d": [], "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f": [], "test.github_source.unique_stg_github__team_team_id.94e9716ab4": [], "test.github_source.not_null_stg_github__team_team_id.440aefe7a7": [], "test.github_source.unique_stg_github__user_user_id.5c1a00cd90": [], "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b": [], "source.github_source.github.issue_assignee": ["model.github_source.stg_github__issue_assignee_tmp"], "source.github_source.github.label": ["model.github_source.stg_github__label_tmp"], "source.github_source.github.issue_closed_history": ["model.github_source.stg_github__issue_closed_history_tmp"], "source.github_source.github.issue_label": ["model.github_source.stg_github__issue_label_tmp"], "source.github_source.github.issue_comment": ["model.github_source.stg_github__issue_comment_tmp"], "source.github_source.github.issue_merged": ["model.github_source.stg_github__issue_merged_tmp"], "source.github_source.github.issue": ["model.github_source.stg_github__issue_tmp"], "source.github_source.github.pull_request_review": ["model.github_source.stg_github__pull_request_review_tmp"], "source.github_source.github.pull_request": ["model.github_source.stg_github__pull_request_tmp"], "source.github_source.github.repo_team": ["model.github_source.stg_github__repo_team_tmp"], "source.github_source.github.repository": ["model.github_source.stg_github__repository_tmp"], "source.github_source.github.requested_reviewer_history": ["model.github_source.stg_github__requested_reviewer_history_tmp"], "source.github_source.github.team": ["model.github_source.stg_github__team_tmp"], "source.github_source.github.user": ["model.github_source.stg_github__user_tmp"]}} \ No newline at end of file diff --git a/docs/run_results.json b/docs/run_results.json index 8a4ad35..164210a 100644 --- a/docs/run_results.json +++ b/docs/run_results.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v4.json", "dbt_version": "1.3.0", "generated_at": "2022-11-07T19:30:39.722706Z", "invocation_id": "373a774a-fbd2-4652-b5ce-ec2e726cba75", "env": {}}, "results": [{"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.619525Z", "completed_at": "2022-11-07T19:30:33.627499Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.628064Z", "completed_at": "2022-11-07T19:30:33.628767Z"}], "thread_id": "Thread-1", "execution_time": 0.011052131652832031, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_assignee_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.631007Z", "completed_at": "2022-11-07T19:30:33.636719Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.637195Z", "completed_at": "2022-11-07T19:30:33.637208Z"}], "thread_id": "Thread-1", "execution_time": 0.007628917694091797, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_closed_history_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.639578Z", "completed_at": "2022-11-07T19:30:33.645961Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.646429Z", "completed_at": "2022-11-07T19:30:33.646442Z"}], "thread_id": "Thread-1", "execution_time": 0.008515119552612305, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_comment_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.648395Z", "completed_at": "2022-11-07T19:30:33.659976Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.660432Z", "completed_at": "2022-11-07T19:30:33.660445Z"}], "thread_id": "Thread-1", "execution_time": 0.013390064239501953, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_label_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.662393Z", "completed_at": "2022-11-07T19:30:33.668094Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.668526Z", "completed_at": "2022-11-07T19:30:33.668537Z"}], "thread_id": "Thread-1", "execution_time": 0.0074596405029296875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_merged_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.670611Z", "completed_at": "2022-11-07T19:30:33.675488Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.675907Z", "completed_at": "2022-11-07T19:30:33.675917Z"}], "thread_id": "Thread-1", "execution_time": 0.006683826446533203, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.678008Z", "completed_at": "2022-11-07T19:30:33.682772Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.683174Z", "completed_at": "2022-11-07T19:30:33.683182Z"}], "thread_id": "Thread-1", "execution_time": 0.006666898727416992, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__label_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.685122Z", "completed_at": "2022-11-07T19:30:33.689468Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.689832Z", "completed_at": "2022-11-07T19:30:33.689839Z"}], "thread_id": "Thread-1", "execution_time": 0.005878925323486328, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__pull_request_review_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.691499Z", "completed_at": "2022-11-07T19:30:33.695414Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.695759Z", "completed_at": "2022-11-07T19:30:33.695767Z"}], "thread_id": "Thread-1", "execution_time": 0.005321979522705078, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__pull_request_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.697446Z", "completed_at": "2022-11-07T19:30:33.702741Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.703087Z", "completed_at": "2022-11-07T19:30:33.703094Z"}], "thread_id": "Thread-1", "execution_time": 0.0068781375885009766, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__repo_team_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.704797Z", "completed_at": "2022-11-07T19:30:33.771078Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.771665Z", "completed_at": "2022-11-07T19:30:33.771679Z"}], "thread_id": "Thread-1", "execution_time": 0.06832265853881836, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__repository_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.774509Z", "completed_at": "2022-11-07T19:30:33.780461Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.781010Z", "completed_at": "2022-11-07T19:30:33.781021Z"}], "thread_id": "Thread-1", "execution_time": 0.008328914642333984, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__requested_reviewer_history_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.783662Z", "completed_at": "2022-11-07T19:30:33.789236Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.789706Z", "completed_at": "2022-11-07T19:30:33.789716Z"}], "thread_id": "Thread-1", "execution_time": 0.007778167724609375, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__team_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.791942Z", "completed_at": "2022-11-07T19:30:33.796882Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.797328Z", "completed_at": "2022-11-07T19:30:33.797337Z"}], "thread_id": "Thread-1", "execution_time": 0.0067751407623291016, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__user_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.799507Z", "completed_at": "2022-11-07T19:30:33.802037Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.802450Z", "completed_at": "2022-11-07T19:30:33.802459Z"}], "thread_id": "Thread-1", "execution_time": 0.004419088363647461, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_assignee_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.804439Z", "completed_at": "2022-11-07T19:30:33.806875Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.807267Z", "completed_at": "2022-11-07T19:30:33.807276Z"}], "thread_id": "Thread-1", "execution_time": 0.00411534309387207, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_closed_history_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.809196Z", "completed_at": "2022-11-07T19:30:33.812936Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.813338Z", "completed_at": "2022-11-07T19:30:33.813347Z"}], "thread_id": "Thread-1", "execution_time": 0.0054492950439453125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_comment_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.815295Z", "completed_at": "2022-11-07T19:30:33.817642Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.818030Z", "completed_at": "2022-11-07T19:30:33.818039Z"}], "thread_id": "Thread-1", "execution_time": 0.004122018814086914, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.819977Z", "completed_at": "2022-11-07T19:30:33.822261Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.822648Z", "completed_at": "2022-11-07T19:30:33.822657Z"}], "thread_id": "Thread-1", "execution_time": 0.004009246826171875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_label_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.824398Z", "completed_at": "2022-11-07T19:30:33.826457Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.826788Z", "completed_at": "2022-11-07T19:30:33.826795Z"}], "thread_id": "Thread-1", "execution_time": 0.003511190414428711, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_merged_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.828396Z", "completed_at": "2022-11-07T19:30:33.830313Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.830640Z", "completed_at": "2022-11-07T19:30:33.830647Z"}], "thread_id": "Thread-1", "execution_time": 0.003320932388305664, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_label_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.832368Z", "completed_at": "2022-11-07T19:30:33.834256Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.834587Z", "completed_at": "2022-11-07T19:30:33.834594Z"}], "thread_id": "Thread-1", "execution_time": 0.003443002700805664, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_pull_request_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.836288Z", "completed_at": "2022-11-07T19:30:33.839304Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.839633Z", "completed_at": "2022-11-07T19:30:33.839640Z"}], "thread_id": "Thread-1", "execution_time": 0.004427194595336914, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_pull_request_review_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.841265Z", "completed_at": "2022-11-07T19:30:33.843255Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.843584Z", "completed_at": "2022-11-07T19:30:33.843592Z"}], "thread_id": "Thread-1", "execution_time": 0.0034189224243164062, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_repo_team_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.845183Z", "completed_at": "2022-11-07T19:30:33.847045Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.847343Z", "completed_at": "2022-11-07T19:30:33.847350Z"}], "thread_id": "Thread-1", "execution_time": 0.003203868865966797, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_repository_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.848799Z", "completed_at": "2022-11-07T19:30:33.850501Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.850784Z", "completed_at": "2022-11-07T19:30:33.850791Z"}], "thread_id": "Thread-1", "execution_time": 0.0029947757720947266, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_requested_reviewer_history_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.852040Z", "completed_at": "2022-11-07T19:30:33.853569Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.853828Z", "completed_at": "2022-11-07T19:30:33.853834Z"}], "thread_id": "Thread-1", "execution_time": 0.002716064453125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_team_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.855664Z", "completed_at": "2022-11-07T19:30:33.857610Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:33.857894Z", "completed_at": "2022-11-07T19:30:33.857901Z"}], "thread_id": "Thread-1", "execution_time": 0.0036928653717041016, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_user_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:33.859316Z", "completed_at": "2022-11-07T19:30:34.223739Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:34.224120Z", "completed_at": "2022-11-07T19:30:34.224131Z"}], "thread_id": "Thread-1", "execution_time": 0.3659529685974121, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_assignee"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:34.225954Z", "completed_at": "2022-11-07T19:30:34.552097Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:34.552466Z", "completed_at": "2022-11-07T19:30:34.552477Z"}], "thread_id": "Thread-1", "execution_time": 0.32767510414123535, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_closed_history"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:34.554302Z", "completed_at": "2022-11-07T19:30:34.964976Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:34.965466Z", "completed_at": "2022-11-07T19:30:34.965479Z"}], "thread_id": "Thread-1", "execution_time": 0.41246700286865234, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_comment"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:34.968083Z", "completed_at": "2022-11-07T19:30:35.319765Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:35.320264Z", "completed_at": "2022-11-07T19:30:35.320277Z"}], "thread_id": "Thread-1", "execution_time": 0.35375523567199707, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_label"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:35.322570Z", "completed_at": "2022-11-07T19:30:35.648027Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:35.648474Z", "completed_at": "2022-11-07T19:30:35.648486Z"}], "thread_id": "Thread-1", "execution_time": 0.32740306854248047, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_merged"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:35.650610Z", "completed_at": "2022-11-07T19:30:36.089539Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:36.089973Z", "completed_at": "2022-11-07T19:30:36.089985Z"}], "thread_id": "Thread-1", "execution_time": 0.4407308101654053, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:36.092281Z", "completed_at": "2022-11-07T19:30:36.518484Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:36.518958Z", "completed_at": "2022-11-07T19:30:36.518970Z"}], "thread_id": "Thread-1", "execution_time": 0.42825913429260254, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__label"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:36.521413Z", "completed_at": "2022-11-07T19:30:36.913951Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:36.914411Z", "completed_at": "2022-11-07T19:30:36.914423Z"}], "thread_id": "Thread-1", "execution_time": 0.3946530818939209, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__pull_request_review"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:36.916755Z", "completed_at": "2022-11-07T19:30:37.345344Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:37.345816Z", "completed_at": "2022-11-07T19:30:37.345829Z"}], "thread_id": "Thread-1", "execution_time": 0.43045592308044434, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__pull_request"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:37.348147Z", "completed_at": "2022-11-07T19:30:37.733769Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:37.734219Z", "completed_at": "2022-11-07T19:30:37.734231Z"}], "thread_id": "Thread-1", "execution_time": 0.38764095306396484, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__repo_team"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:37.736386Z", "completed_at": "2022-11-07T19:30:38.129363Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:38.129739Z", "completed_at": "2022-11-07T19:30:38.129750Z"}], "thread_id": "Thread-1", "execution_time": 0.3945930004119873, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__repository"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:38.131596Z", "completed_at": "2022-11-07T19:30:38.529213Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:38.529660Z", "completed_at": "2022-11-07T19:30:38.529672Z"}], "thread_id": "Thread-1", "execution_time": 0.3992478847503662, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__requested_reviewer_history"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:38.531557Z", "completed_at": "2022-11-07T19:30:38.873428Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:38.873806Z", "completed_at": "2022-11-07T19:30:38.873817Z"}], "thread_id": "Thread-1", "execution_time": 0.34338808059692383, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__team"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:38.875705Z", "completed_at": "2022-11-07T19:30:39.266104Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.266550Z", "completed_at": "2022-11-07T19:30:39.266563Z"}], "thread_id": "Thread-1", "execution_time": 0.39222073554992676, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__user"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.268905Z", "completed_at": "2022-11-07T19:30:39.288047Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.288553Z", "completed_at": "2022-11-07T19:30:39.288568Z"}], "thread_id": "Thread-1", "execution_time": 0.02110600471496582, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.290948Z", "completed_at": "2022-11-07T19:30:39.299352Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.299811Z", "completed_at": "2022-11-07T19:30:39.299824Z"}], "thread_id": "Thread-1", "execution_time": 0.010382890701293945, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.316251Z", "completed_at": "2022-11-07T19:30:39.328447Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.328877Z", "completed_at": "2022-11-07T19:30:39.328889Z"}], "thread_id": "Thread-1", "execution_time": 0.013937950134277344, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.330937Z", "completed_at": "2022-11-07T19:30:39.340474Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.340925Z", "completed_at": "2022-11-07T19:30:39.340937Z"}], "thread_id": "Thread-1", "execution_time": 0.011406898498535156, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.357140Z", "completed_at": "2022-11-07T19:30:39.362561Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.362936Z", "completed_at": "2022-11-07T19:30:39.362946Z"}], "thread_id": "Thread-1", "execution_time": 0.006936073303222656, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.364640Z", "completed_at": "2022-11-07T19:30:39.371246Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.371617Z", "completed_at": "2022-11-07T19:30:39.371627Z"}], "thread_id": "Thread-1", "execution_time": 0.008098125457763672, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__issue_issue_id.84891aeece"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.380426Z", "completed_at": "2022-11-07T19:30:39.385529Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.385896Z", "completed_at": "2022-11-07T19:30:39.385905Z"}], "thread_id": "Thread-1", "execution_time": 0.006596088409423828, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__label_label_id.9f07379974"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.387547Z", "completed_at": "2022-11-07T19:30:39.392545Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.392910Z", "completed_at": "2022-11-07T19:30:39.392919Z"}], "thread_id": "Thread-1", "execution_time": 0.006479024887084961, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__label_label_id.74d3c21466"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.394600Z", "completed_at": "2022-11-07T19:30:39.399667Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.400027Z", "completed_at": "2022-11-07T19:30:39.400035Z"}], "thread_id": "Thread-1", "execution_time": 0.006531953811645508, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.401651Z", "completed_at": "2022-11-07T19:30:39.406500Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.406859Z", "completed_at": "2022-11-07T19:30:39.406867Z"}], "thread_id": "Thread-1", "execution_time": 0.006375789642333984, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.408578Z", "completed_at": "2022-11-07T19:30:39.415279Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.415658Z", "completed_at": "2022-11-07T19:30:39.415669Z"}], "thread_id": "Thread-1", "execution_time": 0.008278131484985352, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.417380Z", "completed_at": "2022-11-07T19:30:39.422855Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.423253Z", "completed_at": "2022-11-07T19:30:39.423266Z"}], "thread_id": "Thread-1", "execution_time": 0.00705409049987793, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.425053Z", "completed_at": "2022-11-07T19:30:39.430618Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.431026Z", "completed_at": "2022-11-07T19:30:39.431039Z"}], "thread_id": "Thread-1", "execution_time": 0.007278919219970703, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.432891Z", "completed_at": "2022-11-07T19:30:39.438233Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.438608Z", "completed_at": "2022-11-07T19:30:39.438618Z"}], "thread_id": "Thread-1", "execution_time": 0.006883144378662109, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.440353Z", "completed_at": "2022-11-07T19:30:39.445691Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.446073Z", "completed_at": "2022-11-07T19:30:39.446085Z"}], "thread_id": "Thread-1", "execution_time": 0.006863117218017578, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.447797Z", "completed_at": "2022-11-07T19:30:39.452961Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.453327Z", "completed_at": "2022-11-07T19:30:39.453336Z"}], "thread_id": "Thread-1", "execution_time": 0.006639957427978516, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.482598Z", "completed_at": "2022-11-07T19:30:39.487778Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.488153Z", "completed_at": "2022-11-07T19:30:39.488163Z"}], "thread_id": "Thread-1", "execution_time": 0.0067861080169677734, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__team_team_id.440aefe7a7"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.489932Z", "completed_at": "2022-11-07T19:30:39.495300Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.495690Z", "completed_at": "2022-11-07T19:30:39.495702Z"}], "thread_id": "Thread-1", "execution_time": 0.00693202018737793, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__team_team_id.94e9716ab4"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.513498Z", "completed_at": "2022-11-07T19:30:39.520099Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.520473Z", "completed_at": "2022-11-07T19:30:39.520484Z"}], "thread_id": "Thread-1", "execution_time": 0.008114814758300781, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.522162Z", "completed_at": "2022-11-07T19:30:39.527712Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.528084Z", "completed_at": "2022-11-07T19:30:39.528095Z"}], "thread_id": "Thread-1", "execution_time": 0.007068157196044922, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__user_user_id.5c1a00cd90"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.579211Z", "completed_at": "2022-11-07T19:30:39.588662Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.589145Z", "completed_at": "2022-11-07T19:30:39.589156Z"}], "thread_id": "Thread-1", "execution_time": 0.011059045791625977, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__issues"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.591112Z", "completed_at": "2022-11-07T19:30:39.598858Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.599354Z", "completed_at": "2022-11-07T19:30:39.599364Z"}], "thread_id": "Thread-1", "execution_time": 0.00948786735534668, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__pull_requests"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.601230Z", "completed_at": "2022-11-07T19:30:39.606702Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.607074Z", "completed_at": "2022-11-07T19:30:39.607084Z"}], "thread_id": "Thread-1", "execution_time": 0.007153987884521484, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__issues_issue_id.fed0631e25"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.608845Z", "completed_at": "2022-11-07T19:30:39.614113Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.614500Z", "completed_at": "2022-11-07T19:30:39.614511Z"}], "thread_id": "Thread-1", "execution_time": 0.006802082061767578, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__issues_issue_id.6723b9b1db"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.616251Z", "completed_at": "2022-11-07T19:30:39.625768Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.626139Z", "completed_at": "2022-11-07T19:30:39.626150Z"}], "thread_id": "Thread-1", "execution_time": 0.011004924774169922, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__daily_metrics"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.628063Z", "completed_at": "2022-11-07T19:30:39.633271Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.633638Z", "completed_at": "2022-11-07T19:30:39.633648Z"}], "thread_id": "Thread-1", "execution_time": 0.006861209869384766, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.635298Z", "completed_at": "2022-11-07T19:30:39.641674Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.642059Z", "completed_at": "2022-11-07T19:30:39.642069Z"}], "thread_id": "Thread-1", "execution_time": 0.007893085479736328, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__pull_requests_issue_id.ce23997907"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.643775Z", "completed_at": "2022-11-07T19:30:39.648299Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.648673Z", "completed_at": "2022-11-07T19:30:39.648684Z"}], "thread_id": "Thread-1", "execution_time": 0.006093740463256836, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__monthly_metrics"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.650478Z", "completed_at": "2022-11-07T19:30:39.654697Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.655050Z", "completed_at": "2022-11-07T19:30:39.655059Z"}], "thread_id": "Thread-1", "execution_time": 0.005679130554199219, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__quarterly_metrics"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.656981Z", "completed_at": "2022-11-07T19:30:39.661494Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.661853Z", "completed_at": "2022-11-07T19:30:39.661863Z"}], "thread_id": "Thread-1", "execution_time": 0.006061077117919922, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__weekly_metrics"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.663654Z", "completed_at": "2022-11-07T19:30:39.668805Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.669186Z", "completed_at": "2022-11-07T19:30:39.669196Z"}], "thread_id": "Thread-1", "execution_time": 0.00665593147277832, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__daily_metrics_day.647e494434"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.670894Z", "completed_at": "2022-11-07T19:30:39.676101Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.676473Z", "completed_at": "2022-11-07T19:30:39.676484Z"}], "thread_id": "Thread-1", "execution_time": 0.006702899932861328, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__daily_metrics_day.f98cab9456"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.678139Z", "completed_at": "2022-11-07T19:30:39.684604Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.684979Z", "completed_at": "2022-11-07T19:30:39.684990Z"}], "thread_id": "Thread-1", "execution_time": 0.007952213287353516, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__monthly_metrics_month.9e4fba84df"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.686672Z", "completed_at": "2022-11-07T19:30:39.691914Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.692281Z", "completed_at": "2022-11-07T19:30:39.692292Z"}], "thread_id": "Thread-1", "execution_time": 0.006731986999511719, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__monthly_metrics_month.3076284fbb"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.693927Z", "completed_at": "2022-11-07T19:30:39.699064Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.699449Z", "completed_at": "2022-11-07T19:30:39.699459Z"}], "thread_id": "Thread-1", "execution_time": 0.0067059993743896484, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__quarterly_metrics_quarter.92394d46dc"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.701137Z", "completed_at": "2022-11-07T19:30:39.706213Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.706579Z", "completed_at": "2022-11-07T19:30:39.706588Z"}], "thread_id": "Thread-1", "execution_time": 0.006558895111083984, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__quarterly_metrics_quarter.9165a921c1"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.708247Z", "completed_at": "2022-11-07T19:30:39.713426Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.713799Z", "completed_at": "2022-11-07T19:30:39.713809Z"}], "thread_id": "Thread-1", "execution_time": 0.0066699981689453125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__weekly_metrics_week.4b0b928243"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-11-07T19:30:39.715505Z", "completed_at": "2022-11-07T19:30:39.720579Z"}, {"name": "execute", "started_at": "2022-11-07T19:30:39.720935Z", "completed_at": "2022-11-07T19:30:39.720945Z"}], "thread_id": "Thread-1", "execution_time": 0.006564140319824219, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__weekly_metrics_week.6794858a8e"}], "elapsed_time": 9.378747940063477, "args": {"write_json": true, "use_colors": true, "printer_width": 80, "version_check": true, "partial_parse": true, "static_parser": true, "profiles_dir": "/Users/sheri.nguyen/.dbt", "send_anonymous_usage_stats": true, "event_buffer_size": 100000, "quiet": false, "no_print": false, "compile": true, "which": "generate", "rpc_method": "docs.generate", "indirect_selection": "eager"}} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v4.json", "dbt_version": "1.3.0", "generated_at": "2022-12-19T20:25:29.095163Z", "invocation_id": "a5b4f899-7713-4d70-b134-5ae04769f65c", "env": {}}, "results": [{"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:27.343219Z", "completed_at": "2022-12-19T20:25:27.352409Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:27.352831Z", "completed_at": "2022-12-19T20:25:27.352840Z"}], "thread_id": "Thread-1", "execution_time": 0.011445999145507812, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_assignee_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:27.343432Z", "completed_at": "2022-12-19T20:25:27.352903Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:27.354015Z", "completed_at": "2022-12-19T20:25:27.354019Z"}], "thread_id": "Thread-3", "execution_time": 0.012428998947143555, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_comment_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:27.343363Z", "completed_at": "2022-12-19T20:25:27.352970Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:27.354279Z", "completed_at": "2022-12-19T20:25:27.354284Z"}], "thread_id": "Thread-2", "execution_time": 0.012998819351196289, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_closed_history_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:27.345871Z", "completed_at": "2022-12-19T20:25:27.353376Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:27.354649Z", "completed_at": "2022-12-19T20:25:27.354653Z"}], "thread_id": "Thread-4", "execution_time": 0.01277303695678711, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_label_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:27.356093Z", "completed_at": "2022-12-19T20:25:27.359966Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:27.366398Z", "completed_at": "2022-12-19T20:25:27.366411Z"}], "thread_id": "Thread-1", "execution_time": 0.012616157531738281, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_merged_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:27.359892Z", "completed_at": "2022-12-19T20:25:27.366659Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:27.368016Z", "completed_at": "2022-12-19T20:25:27.368021Z"}], "thread_id": "Thread-3", "execution_time": 0.012440919876098633, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:27.360150Z", "completed_at": "2022-12-19T20:25:27.367199Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:27.368456Z", "completed_at": "2022-12-19T20:25:27.368461Z"}], "thread_id": "Thread-4", "execution_time": 0.010064840316772461, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__pull_request_review_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:27.360053Z", "completed_at": "2022-12-19T20:25:27.367266Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:27.368562Z", "completed_at": "2022-12-19T20:25:27.368566Z"}], "thread_id": "Thread-2", "execution_time": 0.012870311737060547, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__label_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:27.369815Z", "completed_at": "2022-12-19T20:25:27.374377Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:27.381213Z", "completed_at": "2022-12-19T20:25:27.381220Z"}], "thread_id": "Thread-1", "execution_time": 0.01352691650390625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__pull_request_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:27.374508Z", "completed_at": "2022-12-19T20:25:27.381834Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:27.382851Z", "completed_at": "2022-12-19T20:25:27.382855Z"}], "thread_id": "Thread-3", "execution_time": 0.013149023056030273, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__repo_team_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:27.374684Z", "completed_at": "2022-12-19T20:25:27.381905Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:27.382938Z", "completed_at": "2022-12-19T20:25:27.382941Z"}], "thread_id": "Thread-2", "execution_time": 0.009978771209716797, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__requested_reviewer_history_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:27.374603Z", "completed_at": "2022-12-19T20:25:27.381976Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:27.383021Z", "completed_at": "2022-12-19T20:25:27.383025Z"}], "thread_id": "Thread-4", "execution_time": 0.010545969009399414, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__repository_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:27.384081Z", "completed_at": "2022-12-19T20:25:27.387846Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:27.392368Z", "completed_at": "2022-12-19T20:25:27.392375Z"}], "thread_id": "Thread-1", "execution_time": 0.011374950408935547, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__team_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:27.388096Z", "completed_at": "2022-12-19T20:25:27.393602Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:27.394713Z", "completed_at": "2022-12-19T20:25:27.394717Z"}], "thread_id": "Thread-2", "execution_time": 0.008254051208496094, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_assignee_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:27.388277Z", "completed_at": "2022-12-19T20:25:27.394058Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:27.395041Z", "completed_at": "2022-12-19T20:25:27.395046Z"}], "thread_id": "Thread-4", "execution_time": 0.008357763290405273, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_closed_history_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:27.388008Z", "completed_at": "2022-12-19T20:25:27.394121Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:27.395130Z", "completed_at": "2022-12-19T20:25:27.395133Z"}], "thread_id": "Thread-3", "execution_time": 0.009238958358764648, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__user_tmp"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:27.396306Z", "completed_at": "2022-12-19T20:25:27.398722Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:27.400407Z", "completed_at": "2022-12-19T20:25:27.400413Z"}], "thread_id": "Thread-1", "execution_time": 0.007939815521240234, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_comment_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:27.398997Z", "completed_at": "2022-12-19T20:25:27.402473Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:27.403408Z", "completed_at": "2022-12-19T20:25:27.403412Z"}], "thread_id": "Thread-2", "execution_time": 0.007376909255981445, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:27.399171Z", "completed_at": "2022-12-19T20:25:27.402863Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:27.403744Z", "completed_at": "2022-12-19T20:25:27.403749Z"}], "thread_id": "Thread-4", "execution_time": 0.0063931941986083984, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_label_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:27.399241Z", "completed_at": "2022-12-19T20:25:27.402939Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:27.403826Z", "completed_at": "2022-12-19T20:25:27.403830Z"}], "thread_id": "Thread-3", "execution_time": 0.006487846374511719, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_issue_merged_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:27.405127Z", "completed_at": "2022-12-19T20:25:27.407267Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:27.409487Z", "completed_at": "2022-12-19T20:25:27.409492Z"}], "thread_id": "Thread-1", "execution_time": 0.008264303207397461, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_label_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:27.407479Z", "completed_at": "2022-12-19T20:25:27.411444Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:27.412654Z", "completed_at": "2022-12-19T20:25:27.412658Z"}], "thread_id": "Thread-2", "execution_time": 0.00784921646118164, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_pull_request_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:27.407616Z", "completed_at": "2022-12-19T20:25:27.411913Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:27.412992Z", "completed_at": "2022-12-19T20:25:27.412996Z"}], "thread_id": "Thread-4", "execution_time": 0.006891012191772461, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_pull_request_review_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:27.407679Z", "completed_at": "2022-12-19T20:25:27.412021Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:27.413073Z", "completed_at": "2022-12-19T20:25:27.413076Z"}], "thread_id": "Thread-3", "execution_time": 0.006909370422363281, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_repo_team_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:27.414088Z", "completed_at": "2022-12-19T20:25:27.416221Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:27.417607Z", "completed_at": "2022-12-19T20:25:27.417611Z"}], "thread_id": "Thread-1", "execution_time": 0.00778508186340332, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_repository_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:27.416417Z", "completed_at": "2022-12-19T20:25:27.420274Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:27.421171Z", "completed_at": "2022-12-19T20:25:27.421175Z"}], "thread_id": "Thread-2", "execution_time": 0.007325887680053711, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_requested_reviewer_history_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:27.416548Z", "completed_at": "2022-12-19T20:25:27.420646Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:27.421464Z", "completed_at": "2022-12-19T20:25:27.421467Z"}], "thread_id": "Thread-4", "execution_time": 0.006356000900268555, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_team_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:27.416612Z", "completed_at": "2022-12-19T20:25:27.420719Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:27.421535Z", "completed_at": "2022-12-19T20:25:27.421537Z"}], "thread_id": "Thread-3", "execution_time": 0.006324052810668945, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.github_integration_tests.github_user_data"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:27.422490Z", "completed_at": "2022-12-19T20:25:27.812440Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:27.813139Z", "completed_at": "2022-12-19T20:25:27.813148Z"}], "thread_id": "Thread-1", "execution_time": 0.42143893241882324, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_assignee"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:27.429573Z", "completed_at": "2022-12-19T20:25:27.812603Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:27.813332Z", "completed_at": "2022-12-19T20:25:27.813335Z"}], "thread_id": "Thread-2", "execution_time": 0.420259952545166, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_comment"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:27.429841Z", "completed_at": "2022-12-19T20:25:27.812693Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:27.813421Z", "completed_at": "2022-12-19T20:25:27.813425Z"}], "thread_id": "Thread-3", "execution_time": 0.414287805557251, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_label"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:27.429756Z", "completed_at": "2022-12-19T20:25:27.812868Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:27.813607Z", "completed_at": "2022-12-19T20:25:27.813610Z"}], "thread_id": "Thread-4", "execution_time": 0.415191650390625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_closed_history"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:27.882276Z", "completed_at": "2022-12-19T20:25:28.193479Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:28.194209Z", "completed_at": "2022-12-19T20:25:28.194217Z"}], "thread_id": "Thread-4", "execution_time": 0.37694501876831055, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__label"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:27.846200Z", "completed_at": "2022-12-19T20:25:28.193601Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:28.194374Z", "completed_at": "2022-12-19T20:25:28.194376Z"}], "thread_id": "Thread-3", "execution_time": 0.3777761459350586, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__pull_request_review"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:27.846049Z", "completed_at": "2022-12-19T20:25:28.193913Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:28.194604Z", "completed_at": "2022-12-19T20:25:28.194607Z"}], "thread_id": "Thread-2", "execution_time": 0.37867212295532227, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:27.845964Z", "completed_at": "2022-12-19T20:25:28.194137Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:28.194746Z", "completed_at": "2022-12-19T20:25:28.194749Z"}], "thread_id": "Thread-1", "execution_time": 0.3796710968017578, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__issue_merged"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:28.225940Z", "completed_at": "2022-12-19T20:25:28.566522Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:28.566699Z", "completed_at": "2022-12-19T20:25:28.566705Z"}], "thread_id": "Thread-3", "execution_time": 0.3678269386291504, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__repo_team"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:28.226130Z", "completed_at": "2022-12-19T20:25:28.592251Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:28.593371Z", "completed_at": "2022-12-19T20:25:28.593373Z"}], "thread_id": "Thread-2", "execution_time": 0.3955261707305908, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__requested_reviewer_history"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:28.233692Z", "completed_at": "2022-12-19T20:25:28.592152Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:28.593287Z", "completed_at": "2022-12-19T20:25:28.593291Z"}], "thread_id": "Thread-1", "execution_time": 0.39544010162353516, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__repository"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:28.225856Z", "completed_at": "2022-12-19T20:25:28.591781Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:28.592344Z", "completed_at": "2022-12-19T20:25:28.592352Z"}], "thread_id": "Thread-4", "execution_time": 0.40160703659057617, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__pull_request"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:28.622281Z", "completed_at": "2022-12-19T20:25:28.636931Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:28.637467Z", "completed_at": "2022-12-19T20:25:28.637471Z"}], "thread_id": "Thread-1", "execution_time": 0.01604771614074707, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_assignee_issue_id__user_id.7e32c758e4"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:28.639220Z", "completed_at": "2022-12-19T20:25:28.648263Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:28.648626Z", "completed_at": "2022-12-19T20:25:28.648634Z"}], "thread_id": "Thread-4", "execution_time": 0.011157035827636719, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__issue_comment_issue_comment_id.11ddd56f0f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:28.644277Z", "completed_at": "2022-12-19T20:25:28.648525Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:28.649229Z", "completed_at": "2022-12-19T20:25:28.649235Z"}], "thread_id": "Thread-1", "execution_time": 0.010689735412597656, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__issue_comment_issue_comment_id.695b2e454a"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:28.650592Z", "completed_at": "2022-12-19T20:25:28.656992Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:28.657226Z", "completed_at": "2022-12-19T20:25:28.657233Z"}], "thread_id": "Thread-4", "execution_time": 0.007758140563964844, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.dbt_utils_unique_combination_of_columns_stg_github__issue_closed_history_issue_id__updated_at.b98ed2830d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:28.659350Z", "completed_at": "2022-12-19T20:25:28.665841Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:28.666210Z", "completed_at": "2022-12-19T20:25:28.666219Z"}], "thread_id": "Thread-4", "execution_time": 0.007931232452392578, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__label_label_id.9f07379974"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:28.659429Z", "completed_at": "2022-12-19T20:25:28.665925Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:28.666313Z", "completed_at": "2022-12-19T20:25:28.666316Z"}], "thread_id": "Thread-1", "execution_time": 0.007947683334350586, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__label_label_id.74d3c21466"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:28.668007Z", "completed_at": "2022-12-19T20:25:28.673317Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:28.673709Z", "completed_at": "2022-12-19T20:25:28.673715Z"}], "thread_id": "Thread-1", "execution_time": 0.006526947021484375, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__pull_request_review_pull_request_review_id.1092c62508"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:28.667935Z", "completed_at": "2022-12-19T20:25:28.673392Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:28.673804Z", "completed_at": "2022-12-19T20:25:28.673808Z"}], "thread_id": "Thread-4", "execution_time": 0.007044792175292969, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__pull_request_review_pull_request_review_id.c646eee790"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:28.675649Z", "completed_at": "2022-12-19T20:25:28.688601Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:28.689392Z", "completed_at": "2022-12-19T20:25:28.689398Z"}], "thread_id": "Thread-4", "execution_time": 0.014780998229980469, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__issue_issue_id.74e7778ca7"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:28.690332Z", "completed_at": "2022-12-19T20:25:28.696859Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:28.697105Z", "completed_at": "2022-12-19T20:25:28.697110Z"}], "thread_id": "Thread-1", "execution_time": 0.007843732833862305, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__issue_issue_id.84891aeece"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:28.693495Z", "completed_at": "2022-12-19T20:25:28.697559Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:28.698131Z", "completed_at": "2022-12-19T20:25:28.698136Z"}], "thread_id": "Thread-4", "execution_time": 0.008043050765991211, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__repo_team_repository_id.7076be2503"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:28.698215Z", "completed_at": "2022-12-19T20:25:28.701795Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:28.704611Z", "completed_at": "2022-12-19T20:25:28.704618Z"}], "thread_id": "Thread-1", "execution_time": 0.0071849822998046875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__repo_team_team_id.000230e64c"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:28.701739Z", "completed_at": "2022-12-19T20:25:28.705356Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:28.705673Z", "completed_at": "2022-12-19T20:25:28.705677Z"}], "thread_id": "Thread-4", "execution_time": 0.006960868835449219, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__repository_repository_id.fa3c9c712f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:28.705600Z", "completed_at": "2022-12-19T20:25:28.708955Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:28.716826Z", "completed_at": "2022-12-19T20:25:28.716833Z"}], "thread_id": "Thread-1", "execution_time": 0.011980056762695312, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__repository_repository_id.cf6398db3d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:28.717813Z", "completed_at": "2022-12-19T20:25:28.721874Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:28.724747Z", "completed_at": "2022-12-19T20:25:28.724753Z"}], "thread_id": "Thread-1", "execution_time": 0.00762176513671875, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__pull_request_pull_request_id.bc2132ee71"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:28.721819Z", "completed_at": "2022-12-19T20:25:28.725264Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:28.725903Z", "completed_at": "2022-12-19T20:25:28.725908Z"}], "thread_id": "Thread-4", "execution_time": 0.004766941070556641, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__pull_request_pull_request_id.8f1ca366fa"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:28.594267Z", "completed_at": "2022-12-19T20:25:28.850854Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:28.851021Z", "completed_at": "2022-12-19T20:25:28.851027Z"}], "thread_id": "Thread-3", "execution_time": 0.28167200088500977, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__team"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:28.877006Z", "completed_at": "2022-12-19T20:25:28.887448Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:28.888557Z", "completed_at": "2022-12-19T20:25:28.888562Z"}], "thread_id": "Thread-1", "execution_time": 0.012786149978637695, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__team_team_id.440aefe7a7"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:28.881293Z", "completed_at": "2022-12-19T20:25:28.888078Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:28.888649Z", "completed_at": "2022-12-19T20:25:28.888651Z"}], "thread_id": "Thread-3", "execution_time": 0.012754201889038086, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__team_team_id.94e9716ab4"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:28.622130Z", "completed_at": "2022-12-19T20:25:28.926328Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:28.926503Z", "completed_at": "2022-12-19T20:25:28.926509Z"}], "thread_id": "Thread-2", "execution_time": 0.3349428176879883, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github_source.stg_github__user"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:28.959292Z", "completed_at": "2022-12-19T20:25:28.970946Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:28.972011Z", "completed_at": "2022-12-19T20:25:28.972017Z"}], "thread_id": "Thread-3", "execution_time": 0.014815807342529297, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.not_null_stg_github__user_user_id.3ac9bb7b4b"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:28.959366Z", "completed_at": "2022-12-19T20:25:28.971321Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:28.972365Z", "completed_at": "2022-12-19T20:25:28.972369Z"}], "thread_id": "Thread-2", "execution_time": 0.014892101287841797, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github_source.unique_stg_github__user_user_id.5c1a00cd90"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:28.992782Z", "completed_at": "2022-12-19T20:25:29.002727Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:29.003086Z", "completed_at": "2022-12-19T20:25:29.003092Z"}], "thread_id": "Thread-4", "execution_time": 0.011413097381591797, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__issues"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:28.992885Z", "completed_at": "2022-12-19T20:25:29.002837Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:29.003160Z", "completed_at": "2022-12-19T20:25:29.003163Z"}], "thread_id": "Thread-3", "execution_time": 0.01145029067993164, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__pull_requests"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:29.005460Z", "completed_at": "2022-12-19T20:25:29.018165Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:29.018921Z", "completed_at": "2022-12-19T20:25:29.018928Z"}], "thread_id": "Thread-1", "execution_time": 0.01512598991394043, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__issues_issue_id.fed0631e25"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:29.005676Z", "completed_at": "2022-12-19T20:25:29.018313Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:29.018996Z", "completed_at": "2022-12-19T20:25:29.018998Z"}], "thread_id": "Thread-2", "execution_time": 0.015111923217773438, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__issues_issue_id.6723b9b1db"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:29.008270Z", "completed_at": "2022-12-19T20:25:29.018494Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:29.019177Z", "completed_at": "2022-12-19T20:25:29.019180Z"}], "thread_id": "Thread-4", "execution_time": 0.015205144882202148, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__daily_metrics"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:29.008349Z", "completed_at": "2022-12-19T20:25:29.018766Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:29.019932Z", "completed_at": "2022-12-19T20:25:29.019934Z"}], "thread_id": "Thread-3", "execution_time": 0.015497922897338867, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__pull_requests_issue_id.7a49ca5a6f"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:29.022402Z", "completed_at": "2022-12-19T20:25:29.029569Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:29.032254Z", "completed_at": "2022-12-19T20:25:29.032261Z"}], "thread_id": "Thread-1", "execution_time": 0.01188206672668457, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__pull_requests_issue_id.ce23997907"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:29.025125Z", "completed_at": "2022-12-19T20:25:29.032111Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:29.032978Z", "completed_at": "2022-12-19T20:25:29.032982Z"}], "thread_id": "Thread-2", "execution_time": 0.012086868286132812, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__monthly_metrics"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:29.025215Z", "completed_at": "2022-12-19T20:25:29.032185Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:29.033166Z", "completed_at": "2022-12-19T20:25:29.033171Z"}], "thread_id": "Thread-4", "execution_time": 0.012261152267456055, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__quarterly_metrics"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:29.025295Z", "completed_at": "2022-12-19T20:25:29.032462Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:29.033753Z", "completed_at": "2022-12-19T20:25:29.033757Z"}], "thread_id": "Thread-3", "execution_time": 0.012730121612548828, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.github.github__weekly_metrics"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:29.035937Z", "completed_at": "2022-12-19T20:25:29.072260Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:29.077583Z", "completed_at": "2022-12-19T20:25:29.077590Z"}], "thread_id": "Thread-1", "execution_time": 0.04391026496887207, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__daily_metrics_day.647e494434"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:29.039787Z", "completed_at": "2022-12-19T20:25:29.077454Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:29.078282Z", "completed_at": "2022-12-19T20:25:29.078285Z"}], "thread_id": "Thread-2", "execution_time": 0.04349994659423828, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__daily_metrics_day.f98cab9456"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:29.039995Z", "completed_at": "2022-12-19T20:25:29.077645Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:29.078555Z", "completed_at": "2022-12-19T20:25:29.078558Z"}], "thread_id": "Thread-4", "execution_time": 0.043637990951538086, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__monthly_metrics_month.9e4fba84df"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:29.072160Z", "completed_at": "2022-12-19T20:25:29.077818Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:29.078888Z", "completed_at": "2022-12-19T20:25:29.078890Z"}], "thread_id": "Thread-3", "execution_time": 0.043493032455444336, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__monthly_metrics_month.3076284fbb"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:29.080295Z", "completed_at": "2022-12-19T20:25:29.086003Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:29.092414Z", "completed_at": "2022-12-19T20:25:29.092421Z"}], "thread_id": "Thread-1", "execution_time": 0.014005899429321289, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__quarterly_metrics_quarter.92394d46dc"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:29.083389Z", "completed_at": "2022-12-19T20:25:29.092216Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:29.093129Z", "completed_at": "2022-12-19T20:25:29.093132Z"}], "thread_id": "Thread-2", "execution_time": 0.01361703872680664, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__quarterly_metrics_quarter.9165a921c1"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:29.083571Z", "completed_at": "2022-12-19T20:25:29.092638Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:29.093716Z", "completed_at": "2022-12-19T20:25:29.093719Z"}], "thread_id": "Thread-4", "execution_time": 0.013712882995605469, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.not_null_github__weekly_metrics_week.4b0b928243"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2022-12-19T20:25:29.085941Z", "completed_at": "2022-12-19T20:25:29.092697Z"}, {"name": "execute", "started_at": "2022-12-19T20:25:29.093793Z", "completed_at": "2022-12-19T20:25:29.093796Z"}], "thread_id": "Thread-3", "execution_time": 0.013680696487426758, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.github.unique_github__weekly_metrics_week.6794858a8e"}], "elapsed_time": 2.6256532669067383, "args": {"write_json": true, "use_colors": true, "printer_width": 80, "version_check": true, "partial_parse": true, "static_parser": true, "profiles_dir": "/Users/joseph.markiewicz/.dbt", "send_anonymous_usage_stats": true, "event_buffer_size": 100000, "quiet": false, "no_print": false, "target": "postgres", "compile": true, "which": "generate", "rpc_method": "docs.generate", "indirect_selection": "eager"}} \ No newline at end of file From 2bb98ba16a417b72b4f0fe5d50b9416536c1c22e Mon Sep 17 00:00:00 2001 From: fivetran-joemarkiewicz Date: Tue, 20 Dec 2022 13:53:40 -0600 Subject: [PATCH 30/30] update package dependency --- packages.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages.yml b/packages.yml index e4157ef..648af40 100644 --- a/packages.yml +++ b/packages.yml @@ -1,7 +1,3 @@ packages: -# - package: fivetran/github_source -# version: [">=0.6.0", "<0.7.0"] - -# Update before merge - - git: https://github.com/fivetran/dbt_github_source.git - revision: MagicBot/dbt-utils-cross-db-migration \ No newline at end of file +- package: fivetran/github_source + version: [">=0.6.0", "<0.7.0"] \ No newline at end of file